easik.states
Class AddPathToConstraintState

java.lang.Object
  extended by easik.states.EasikState
      extended by easik.states.AddPathToConstraintState
All Implemented Interfaces:
PathAcceptingState

public class AddPathToConstraintState
extends EasikState
implements PathAcceptingState

This state is used to add a new path to a current constraint

Since:
2006-08-17 Kevin Green
Version:
2006-08-23 Kevin Green
Author:
Kevin Green 2006

Field Summary
private  Constraint _constraint
          The constraint being edited
private  boolean _finished
          Stores whether the user has finished adding paths to this constraint
private  java.util.ArrayList<SketchPath> _paths
          The paths involved in this constraint
 
Fields inherited from class easik.states.EasikState
_ourSketch
 
Constructor Summary
AddPathToConstraintState(Sketch inSketch, java.util.ArrayList<SketchPath> curPaths, Constraint curConstraint)
          Constructor for creating a new state to collect paths and make a diagram.
 
Method Summary
 void passPath(SketchPath inPath)
          Called when a new path has been completed by a state above this on the stack.
 void poppedOff()
          Nothing to do when it gets popped off, as it always pops itself off when completed.
 void pushedOn()
          When this state is pushed on, it sends a message in a popup and then pushes a path collection state.
 java.lang.String toString()
          This state is called "Adding Path(s)".
 
Methods inherited from class easik.states.EasikState
cancelClicked, finishClicked, gotFocus, nextClicked, resetColors, selectionUpdated, setCancelButton, setFinishButton, setNextButton
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_paths

private java.util.ArrayList<SketchPath> _paths
The paths involved in this constraint


_constraint

private Constraint _constraint
The constraint being edited


_finished

private boolean _finished
Stores whether the user has finished adding paths to this constraint

Constructor Detail

AddPathToConstraintState

public AddPathToConstraintState(Sketch inSketch,
                                java.util.ArrayList<SketchPath> curPaths,
                                Constraint curConstraint)
Constructor for creating a new state to collect paths and make a diagram.

Parameters:
inSketch - The sketch being worked with.
curPaths - The current paths of the constraint
curConstraint - The current constraint
Method Detail

passPath

public void passPath(SketchPath inPath)
Called when a new path has been completed by a state above this on the stack. If it is null, then cancel, otherwise check to see if the user selected the 'next' or 'finish' option.

Specified by:
passPath in interface PathAcceptingState
Parameters:
inPath - The last path in, null if it was a cancellation

pushedOn

public void pushedOn()
When this state is pushed on, it sends a message in a popup and then pushes a path collection state.

Specified by:
pushedOn in class EasikState

poppedOff

public void poppedOff()
Nothing to do when it gets popped off, as it always pops itself off when completed.

Specified by:
poppedOff in class EasikState

toString

public java.lang.String toString()
This state is called "Adding Path(s)".

Specified by:
toString in class EasikState
Returns:
The string literal described above.