|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteasik.StateManager
public class StateManager
The state manager is a class that keeps track of the current state of the program. Different states are used in order to interpret more complicated inputs. An example of this would be the process needed to create a commutative diagram. First there are several clicks required to select each path. Paths can listen to what's going on with the UI, and can change and collect information that way. The state manager works like a stack. New states are pushed on top and then the state manager forwards any important messages up to the active state.
Field Summary | |
---|---|
private boolean |
_finished
Boolean to record whether the user has pressed the |
private java.util.LinkedList<EasikState> |
_states
The stack. |
Constructor Summary | |
---|---|
StateManager(Easik inApp)
Initialize the state manager |
Method Summary | |
---|---|
void |
cancelClicked()
Informs the top element that the cancel button has been clicked. |
void |
finishClicked()
Informs the top element that the finish button has been clicked. |
boolean |
getFinished()
Gets the value currently stored in |
void |
nextClicked()
Informs the top element that the next button has been clicked |
EasikState |
peekState()
Non destructively take a look at the top item on the stack. |
EasikState |
popState()
Pop the state off of the top of the stack. |
void |
pushState(EasikState toPush)
Pushes a state onto the stack, calls the 'pushed on' hook after being added. |
void |
resetFinished()
Resets the value of |
void |
selectionUpdated()
Hook for informing the current active state that the selection has been updated |
void |
updateStatus()
When called, this sends an updated state status string to the status bar |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private boolean _finished
private java.util.LinkedList<EasikState> _states
Constructor Detail |
---|
public StateManager(Easik inApp)
inApp
- The current instance of this applicationMethod Detail |
---|
public void selectionUpdated()
public EasikState peekState()
public EasikState popState()
public void pushState(EasikState toPush)
toPush
- The new state being pushed onpublic void updateStatus()
public void nextClicked()
public void cancelClicked()
public void finishClicked()
public boolean getFinished()
public void resetFinished()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |