com.horstmann.violet
Class StateNode

java.lang.Object
  extended by com.horstmann.violet.framework.AbstractNode
      extended by com.horstmann.violet.framework.RectangularNode
          extended by com.horstmann.violet.StateNode
All Implemented Interfaces:
Node, java.io.Serializable, java.lang.Cloneable

public class StateNode
extends RectangularNode

A node in a state diagram.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.horstmann.violet.framework.AbstractNode
SHADOW_GAP
 
Constructor Summary
StateNode()
          Construct a state node with a default size
 
Method Summary
 java.lang.Object clone()
           
 void draw(java.awt.Graphics2D g2)
          Draw the node.
 MultiLineString getName()
          Gets the name property value.
 java.awt.Shape getShape()
           
 void layout(Graph g, java.awt.Graphics2D g2, Grid grid)
          Lays out the node and its children.
 void setName(MultiLineString newValue)
          Sets the name property value.
 
Methods inherited from class com.horstmann.violet.framework.RectangularNode
contains, getBounds, getConnectionPoint, setBounds, translate
 
Methods inherited from class com.horstmann.violet.framework.AbstractNode
addChild, addChild, addEdge, addNode, getChildren, getParent, removeChild, removeEdge, removeNode, setParent, setPersistenceDelegate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StateNode

public StateNode()
Construct a state node with a default size

Method Detail

draw

public void draw(java.awt.Graphics2D g2)
Description copied from interface: Node
Draw the node.

Specified by:
draw in interface Node
Overrides:
draw in class AbstractNode
Parameters:
g2 - the graphics context

getShape

public java.awt.Shape getShape()
Overrides:
getShape in class RectangularNode
Returns:
the shape to be used for computing the drop shadow

layout

public void layout(Graph g,
                   java.awt.Graphics2D g2,
                   Grid grid)
Description copied from interface: Node
Lays out the node and its children.

Specified by:
layout in interface Node
Overrides:
layout in class RectangularNode
Parameters:
g - the ambient graph
g2 - the graphics context
grid - the grid to snap to

setName

public void setName(MultiLineString newValue)
Sets the name property value.

Parameters:
newValue - the new state name

getName

public MultiLineString getName()
Gets the name property value.

Parameters:
the - state name

clone

public java.lang.Object clone()
Specified by:
clone in interface Node
Overrides:
clone in class RectangularNode