edu.cs.ai.kreator.ui.gui.components.controller
Class EvidencePreviewGuideController

java.lang.Object
  extended by edu.cs.ai.kreator.ui.gui.components.controller.QueryPreviewGuideController
      extended by edu.cs.ai.kreator.ui.gui.components.controller.EvidencePreviewGuideController

public class EvidencePreviewGuideController
extends QueryPreviewGuideController

A class observing and previewing the construction of custom evidences. Actually the evidences dont support specific domains, only the value true or false.

Author:
Tim Janus

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.cs.ai.kreator.ui.gui.components.controller.QueryPreviewGuideController
QueryPreviewGuideController.KeyListener, QueryPreviewGuideController.ParameterPair
 
Field Summary
protected  java.lang.Boolean defaultValue
           
protected  java.lang.String evidenceValue
          String encoding the evidenceValue.
protected static java.lang.String LINK_ID_EVIDENCE
          URL ID linking to the STATE_RESULT
 
Fields inherited from class edu.cs.ai.kreator.ui.gui.components.controller.QueryPreviewGuideController
ACTION_CHANGED, ACTION_DO, allowConstantAppending, doLabel, internalStateChange, language, LINK_ID_DO, LINK_ID_PREDICATE, LINK_ID_PREFIX_PARAMETER, outputPane, parameters, predicate, state, STATE_NO_KNOWLEDGEBASE, STATE_PREDICATE, workList
 
Constructor Summary
EvidencePreviewGuideController(PreviewGuideControls controls)
          Ctor
 
Method Summary
protected  boolean applyWorkListSelection()
          This method apply the selection change in the work list.
protected  java.lang.String buildGuideOutput()
          Builds the guide line output helping the user performing the next step.
protected  java.lang.String buildPreviewOutput()
          Builds the preview output string showing the user what he had constructed so far.
protected  void checkStateValid(int newState)
           
 AtomExpression getEvidence()
           
 int getStateCount()
           
protected  int getStateResultId()
           
 boolean isValid()
           
protected  void onHyperlinkEvent(javax.swing.event.HyperlinkEvent e)
          Decide what to do if the user clicks a hyperlink Sub classes defining more hyperlinks should override this method to add the wished functionality when the user clicks on the link.
protected  void processStateNavigation(java.awt.event.KeyEvent event)
          Navigate through different states by a given KeyEvent.
 void reset(java.lang.String reason)
           
protected  void switchState(int newState)
          Switch the current state to newState
 
Methods inherited from class edu.cs.ai.kreator.ui.gui.components.controller.QueryPreviewGuideController
addActionListener, buildErrorOutput, changeWorkListContent, getQuery, informActionListener, removeActionListener, reset, reset, setLanguage, setParameter, updateOutput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultValue

protected java.lang.Boolean defaultValue

evidenceValue

protected java.lang.String evidenceValue
String encoding the evidenceValue.


LINK_ID_EVIDENCE

protected static final java.lang.String LINK_ID_EVIDENCE
URL ID linking to the STATE_RESULT

See Also:
Constant Field Values
Constructor Detail

EvidencePreviewGuideController

public EvidencePreviewGuideController(PreviewGuideControls controls)
Ctor

Parameters:
controls -
field -
button -
Method Detail

getStateCount

public int getStateCount()
Overrides:
getStateCount in class QueryPreviewGuideController

reset

public void reset(java.lang.String reason)
Overrides:
reset in class QueryPreviewGuideController

isValid

public boolean isValid()
Overrides:
isValid in class QueryPreviewGuideController

getEvidence

public AtomExpression getEvidence()
Returns:
the evidence designed in the contorl. if the evidence is not valid null is returned.

buildPreviewOutput

protected java.lang.String buildPreviewOutput()
Description copied from class: QueryPreviewGuideController
Builds the preview output string showing the user what he had constructed so far. Using html links for mouse click navigation. Overload this method for showing the user the custom object he's actually constructing.

Overrides:
buildPreviewOutput in class QueryPreviewGuideController
Returns:
html formatted string with preview output.

buildGuideOutput

protected java.lang.String buildGuideOutput()
Description copied from class: QueryPreviewGuideController
Builds the guide line output helping the user performing the next step. Overload this method for custom guide output.

Overrides:
buildGuideOutput in class QueryPreviewGuideController
Returns:
html formatted string with guide output.

switchState

protected void switchState(int newState)
Description copied from class: QueryPreviewGuideController
Switch the current state to newState

Overrides:
switchState in class QueryPreviewGuideController

checkStateValid

protected void checkStateValid(int newState)
Overrides:
checkStateValid in class QueryPreviewGuideController

applyWorkListSelection

protected boolean applyWorkListSelection()
Description copied from class: QueryPreviewGuideController
This method apply the selection change in the work list. This means it sets a new predicate to the query if a predicate was select. Subclasses defining new states should overload this method to switch automatically in a new state if the work of the previous one is done.

Overrides:
applyWorkListSelection in class QueryPreviewGuideController
Returns:
true if a state change occurred after work list selection change was applied otherwise false.

processStateNavigation

protected void processStateNavigation(java.awt.event.KeyEvent event)
Description copied from class: QueryPreviewGuideController
Navigate through different states by a given KeyEvent. Sub classes defining more states should override this method, so that the user is able to select the new states with the keyboard too.

Overrides:
processStateNavigation in class QueryPreviewGuideController
Parameters:
event - reference to the KeyEvent

onHyperlinkEvent

protected void onHyperlinkEvent(javax.swing.event.HyperlinkEvent e)
Description copied from class: QueryPreviewGuideController
Decide what to do if the user clicks a hyperlink Sub classes defining more hyperlinks should override this method to add the wished functionality when the user clicks on the link.

Overrides:
onHyperlinkEvent in class QueryPreviewGuideController
Parameters:
e - Reference to the HyperLinkEvent

getStateResultId

protected int getStateResultId()