com.horstmann.violet
Class ClassNode

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

public class ClassNode
extends RectangularNode

A class node in a class diagram.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.horstmann.violet.framework.AbstractNode
SHADOW_GAP
 
Constructor Summary
ClassNode()
          Construct a class node with a default size
 
Method Summary
 boolean addNode(Node n, java.awt.geom.Point2D p)
          Adds a node as a child node to this node.
 java.lang.Object clone()
           
 void draw(java.awt.Graphics2D g2)
          Draw the node.
 MultiLineString getAttributes()
          Gets the attributes property value.
 MultiLineString getMethods()
          Gets the methods property value.
 MultiLineString getName()
          Gets the name property value.
 void layout(Graph g, java.awt.Graphics2D g2, Grid grid)
          Lays out the node and its children.
 void setAttributes(MultiLineString newValue)
          Sets the attributes property value.
 void setMethods(MultiLineString newValue)
          Sets the methods property value.
 void setName(MultiLineString newValue)
          Sets the name property value.
 
Methods inherited from class com.horstmann.violet.framework.RectangularNode
contains, getBounds, getConnectionPoint, getShape, setBounds, translate
 
Methods inherited from class com.horstmann.violet.framework.AbstractNode
addChild, addChild, addEdge, 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

ClassNode

public ClassNode()
Construct a class 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

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

setName

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

Parameters:
newValue - the class name

getName

public MultiLineString getName()
Gets the name property value.

Returns:
the class name

setAttributes

public void setAttributes(MultiLineString newValue)
Sets the attributes property value.

Parameters:
newValue - the attributes of this class

getAttributes

public MultiLineString getAttributes()
Gets the attributes property value.

Returns:
the attributes of this class

setMethods

public void setMethods(MultiLineString newValue)
Sets the methods property value.

Parameters:
newValue - the methods of this class

getMethods

public MultiLineString getMethods()
Gets the methods property value.

Returns:
the methods of this class

clone

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