com.horstmann.violet
Class CallNode

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

public class CallNode
extends RectangularNode

A method call node in a scenario diagram.

See Also:
Serialized Form

Field Summary
static int CALL_YGAP
           
 
Fields inherited from class com.horstmann.violet.framework.AbstractNode
SHADOW_GAP
 
Constructor Summary
CallNode()
          Construct a call node with a default size
 
Method Summary
 boolean addEdge(Edge e, java.awt.geom.Point2D p1, java.awt.geom.Point2D p2)
          Adds an edge that originates at this node.
 boolean addNode(Node n, java.awt.geom.Point2D p)
          Adds a node as a child node to this node.
 void draw(java.awt.Graphics2D g2)
          Draw the node.
 java.awt.geom.Point2D getConnectionPoint(Direction d)
          Get the best connection point to connect this node with another node.
 ImplicitParameterNode getImplicitParameter()
          Gets the implicit parameter of this call.
 boolean isOpenBottom()
          Gets the openBottom property.
 void layout(Graph g, java.awt.Graphics2D g2, Grid grid)
          Lays out the node and its children.
 void removeEdge(Graph g, Edge e)
          Notifies this node that an edge is being removed.
 void removeNode(Graph g, Node n)
          Notifies this node that a node is being removed.
 void setImplicitParameter(ImplicitParameterNode newValue)
          Sets the implicit parameter of this call.
 void setOpenBottom(boolean newValue)
          Sets the openBottom property.
 void setSignaled(boolean newValue)
          Sets the signaled property.
 
Methods inherited from class com.horstmann.violet.framework.RectangularNode
clone, contains, getBounds, getShape, setBounds, translate
 
Methods inherited from class com.horstmann.violet.framework.AbstractNode
addChild, addChild, getChildren, getParent, removeChild, setParent, setPersistenceDelegate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CALL_YGAP

public static int CALL_YGAP
Constructor Detail

CallNode

public CallNode()
Construct a call 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

getImplicitParameter

public ImplicitParameterNode getImplicitParameter()
Gets the implicit parameter of this call.

Returns:
the implicit parameter node

setImplicitParameter

public void setImplicitParameter(ImplicitParameterNode newValue)
Sets the implicit parameter of this call.

Parameters:
newValue - the implicit parameter node

getConnectionPoint

public java.awt.geom.Point2D getConnectionPoint(Direction d)
Description copied from interface: Node
Get the best connection point to connect this node with another node. This should be a point on the boundary of the shape of this node.

Specified by:
getConnectionPoint in interface Node
Overrides:
getConnectionPoint in class RectangularNode
Parameters:
d - the direction from the center of the bounding rectangle towards the boundary
Returns:
the recommended connection point

addEdge

public boolean addEdge(Edge e,
                       java.awt.geom.Point2D p1,
                       java.awt.geom.Point2D p2)
Description copied from interface: Node
Adds an edge that originates at this node.

Specified by:
addEdge in interface Node
Overrides:
addEdge in class AbstractNode
Parameters:
e - the edge to add
Returns:
true if the edge was added

removeEdge

public void removeEdge(Graph g,
                       Edge e)
Description copied from interface: Node
Notifies this node that an edge is being removed.

Specified by:
removeEdge in interface Node
Overrides:
removeEdge in class AbstractNode
Parameters:
g - the ambient graph
e - the edge to be removed

removeNode

public void removeNode(Graph g,
                       Node n)
Description copied from interface: Node
Notifies this node that a node is being removed.

Specified by:
removeNode in interface Node
Overrides:
removeNode in class AbstractNode
Parameters:
g - the ambient graph
n - the node to be removed

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

addNode

public boolean addNode(Node n,
                       java.awt.geom.Point2D p)
Description copied from interface: Node
Adds a node as a child node to this node.

Specified by:
addNode in interface Node
Overrides:
addNode in class AbstractNode
Parameters:
n - the child node
p - the point at which the node is being added
Returns:
true if this node accepts the given node as a child

setSignaled

public void setSignaled(boolean newValue)
Sets the signaled property.

Parameters:
newValue - true if this node is the target of a signal edge

isOpenBottom

public boolean isOpenBottom()
Gets the openBottom property.

Returns:
true if this node is the target of a signal edge

setOpenBottom

public void setOpenBottom(boolean newValue)
Sets the openBottom property.

Parameters:
newValue - true if this node is the target of a signal edge