easik.states
Class EasikState

java.lang.Object
  extended by easik.states.EasikState
Direct Known Subclasses:
AddCommutativeDiagramState, AddPathToConstraintState, AddProductConstraintState, AddPullbackConstraintState, AddSumConstraintState, BasicEditingState, GetPathState, LoadingState

public abstract class EasikState
extends java.lang.Object

This is the base state. It contains stubs and abstract methods for allowing a class to be treated like a state, and to take part in the State Manager

Version:
2006-08-02 Kevin Green
Author:
Rob Fletcher 2005, Vera Ranieri 2006, Kevin Green 2006

Field Summary
private  boolean _cancelOn
          Records the state of the cancel button
private  boolean _finishOn
          Records the state of the finish button
private  boolean _nextOn
          Records state of the next button
protected  Sketch _ourSketch
          The current sketch
 
Constructor Summary
EasikState()
           
 
Method Summary
 void cancelClicked()
          Optional hook for when the cancel button is clicked
 void finishClicked()
          Optional hook for when the finish button is clicked.
 void gotFocus()
          When this state gets the top spot again, this gets executed.
 void nextClicked()
          Optional hook for when the next button is clicked
abstract  void poppedOff()
          Hook to record when state has been popped off
abstract  void pushedOn()
          Hook to record when state has been pushed on
 void resetColors()
          Resets the graph colors to what they are by default.
 void selectionUpdated()
          Hook to record when selection has been updated
protected  void setCancelButton(boolean inButton)
          Use this function to toggle the usability of the cancel button.
protected  void setFinishButton(boolean inButton)
          Use this function to toggle the usability of the finish button.
protected  void setNextButton(boolean inButton)
          Use this function to toggle the usability of the ok button.
abstract  java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_nextOn

private boolean _nextOn
Records state of the next button


_cancelOn

private boolean _cancelOn
Records the state of the cancel button


_finishOn

private boolean _finishOn
Records the state of the finish button


_ourSketch

protected Sketch _ourSketch
The current sketch

Constructor Detail

EasikState

public EasikState()
Method Detail

selectionUpdated

public void selectionUpdated()
Hook to record when selection has been updated


pushedOn

public abstract void pushedOn()
Hook to record when state has been pushed on


poppedOff

public abstract void poppedOff()
Hook to record when state has been popped off


toString

public abstract java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
The string representation of this state

gotFocus

public void gotFocus()
When this state gets the top spot again, this gets executed. Restores buttons and labels. If overridden, be sure to at call super.gotfocus() first.


cancelClicked

public void cancelClicked()
Optional hook for when the cancel button is clicked


nextClicked

public void nextClicked()
Optional hook for when the next button is clicked


finishClicked

public void finishClicked()
Optional hook for when the finish button is clicked.

Since:
2006-05-30 Vera Ranieri

setCancelButton

protected void setCancelButton(boolean inButton)
Use this function to toggle the usability of the cancel button. It remembers the state in a separate boolean so it can be restored.

Parameters:
inButton - Status of the button

setNextButton

protected void setNextButton(boolean inButton)
Use this function to toggle the usability of the ok button. It remembers the state in a separate boolean so it can be restored.

Parameters:
inButton - Status of the button

setFinishButton

protected void setFinishButton(boolean inButton)
Use this function to toggle the usability of the finish button. It remembers the state in a separate boolean so it can be restored.

Parameters:
inButton - Status of the button
Since:
2006-05-30 Vera Ranieri

resetColors

public void resetColors()
Resets the graph colors to what they are by default.