turingmachine
Class CTMDataLink

java.lang.Object
  extended by turingmachine.CTMData
      extended by turingmachine.CTMDataLink
All Implemented Interfaces:
java.io.Serializable

class CTMDataLink
extends CTMData
implements java.io.Serializable

Data for a link between states.


Field Summary
private  CTMPoint mCtrl
          The control point for the curve on this link.
private  CTMDataState mStateFrom
          The state this link links from.
private  CTMDataState mStateTo
          The state this link links to.
private  java.util.ArrayList<CTMDataTransition> mTransitions
          The transitions for this link.
(package private) static long serialVersionUID
          Serial id, so future version will load old files
 
Constructor Summary
CTMDataLink(CTMDocument document, CTMDataState stateFrom, CTMDataState stateTo)
          Constructor.
 
Method Summary
 void addTransition()
          Add new transition data to this link data.
 void delete()
          Delete this link and any transition that it contains.
 CTMDataState geStateTo()
          Get the state that this link links to.
 CTMPoint getCtrl()
          Get the current control position.
 CTMDataState getStateFrom()
          Get the state that this link links from.
 void setCtrl(java.awt.geom.Point2D aPoint)
          Set the control points position in fromState to toState midpoint coordinates.
 void transitionDeleted(CTMDataTransition dataTransition)
          Handle notification from a data transition that it has been deleted.
 java.util.Iterator<CTMDataTransition> transitionsIterator()
          Get the transition data iterator.
 
Methods inherited from class turingmachine.CTMData
getDataParent, getDocument, getModificationCount, isDeleted, touch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
Serial id, so future version will load old files

See Also:
Constant Field Values

mStateFrom

private CTMDataState mStateFrom
The state this link links from.


mStateTo

private CTMDataState mStateTo
The state this link links to.


mCtrl

private CTMPoint mCtrl
The control point for the curve on this link.


mTransitions

private java.util.ArrayList<CTMDataTransition> mTransitions
The transitions for this link.

Constructor Detail

CTMDataLink

public CTMDataLink(CTMDocument document,
                   CTMDataState stateFrom,
                   CTMDataState stateTo)
Constructor.

Parameters:
document - The document this state belongs to.
stateFrom - The state this links from.
stateTo - The state this links to.
Method Detail

addTransition

public void addTransition()
Add new transition data to this link data.


transitionDeleted

public void transitionDeleted(CTMDataTransition dataTransition)
Handle notification from a data transition that it has been deleted.

Parameters:
dataTransition - CTMDataTransition The data transition that has been deleted.

transitionsIterator

public java.util.Iterator<CTMDataTransition> transitionsIterator()
Get the transition data iterator.

Returns:
The transition data iterator.

getCtrl

public CTMPoint getCtrl()
Get the current control position.

Returns:
The location of the control position is fromState to toState midpoint coordinates.

setCtrl

public void setCtrl(java.awt.geom.Point2D aPoint)
Set the control points position in fromState to toState midpoint coordinates.

Parameters:
aPoint - the new control point location.

getStateFrom

public CTMDataState getStateFrom()
Get the state that this link links from.

Returns:
The state this link links from.

geStateTo

public CTMDataState geStateTo()
Get the state that this link links to.

Returns:
The state this link links to.

delete

public void delete()
Delete this link and any transition that it contains.

Overrides:
delete in class CTMData