fcmodeler.attributes
Class NodeShapeValue

java.lang.Object
  |
  +--fcmodeler.attributes.NodeShapeValue
All Implemented Interfaces:
NodeVisualAttributeValue, VisualAttributeValue

public final class NodeShapeValue
extends java.lang.Object
implements VisualAttributeValue, NodeVisualAttributeValue

A specific value of the node shape attribute.

Since:
JDK1.3
Version:
$Revision: 1.2 $
Author:
Zach Cox

Constructor Summary
NodeShapeValue()
          Creates a new NodeShapeValue using a rectangle node shape.
NodeShapeValue(NodeShape nodeShape)
          Creates a new NodeShapeValue using the specified node shape.
NodeShapeValue(java.lang.String nodeShape)
          Creates a new NodeShapeValue using the specified string description of the node shape.
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares the specified object with this node shape value for equality.
 VisualAttribute getAttribute()
           
 NodeShape getNodeShape()
          Returns the node shape of this node shape value.
 int hashCode()
          Returns the hash code for this node shape value.
 void setNodeValue(NodeFigure figure)
          Sets the node shape of the specified node figure to the shape contained in this node shape value.
 void setPermanentNodeValue(NodeFigure figure)
          Sets the permanent node shape of the specified node figure to the shape contained in this node shape value.
 java.lang.String toString()
          Returns a string representation of this node shape value.
static NodeShapeValue valueOf(java.lang.String value)
          Returns a new NodeShapeValue instance, created using the specified string description.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NodeShapeValue

public NodeShapeValue()
Creates a new NodeShapeValue using a rectangle node shape.

NodeShapeValue

public NodeShapeValue(NodeShape nodeShape)
Creates a new NodeShapeValue using the specified node shape. The supplied NodeShape is cloned in order to create a defensive copy.
Parameters:
nodeShape - the node shape to use for this node shape value.

NodeShapeValue

public NodeShapeValue(java.lang.String nodeShape)
Creates a new NodeShapeValue using the specified string description of the node shape.
Parameters:
nodeShape - the string description of the node shape for this node shape value.
Method Detail

equals

public boolean equals(java.lang.Object o)
Compares the specified object with this node shape value for equality.
Specified by:
equals in interface VisualAttributeValue
Overrides:
equals in class java.lang.Object
Parameters:
o - the object to be compared for equality with this node shape value.
Returns:
true if the specified object is equal to this node shape value.

getAttribute

public VisualAttribute getAttribute()
Specified by:
getAttribute in interface VisualAttributeValue

getNodeShape

public NodeShape getNodeShape()
Returns the node shape of this node shape value.
Returns:
the node shape of this node shape value.

hashCode

public int hashCode()
Returns the hash code for this node shape value.
Specified by:
hashCode in interface VisualAttributeValue
Overrides:
hashCode in class java.lang.Object
Returns:
the hash code for this node shape value.

setNodeValue

public void setNodeValue(NodeFigure figure)
Sets the node shape of the specified node figure to the shape contained in this node shape value. The supplied NodeFigure receives a copy of the internal NodeShape each time this method is called.
Specified by:
setNodeValue in interface NodeVisualAttributeValue
Parameters:
figure - the node figure to update.

setPermanentNodeValue

public void setPermanentNodeValue(NodeFigure figure)
Sets the permanent node shape of the specified node figure to the shape contained in this node shape value. The supplied NodeFigure receives a copy of the internal NodeShape each time this method is called.
Specified by:
setPermanentNodeValue in interface NodeVisualAttributeValue
Parameters:
figure - the node figure to update.

toString

public java.lang.String toString()
Returns a string representation of this node shape value.
Specified by:
toString in interface VisualAttributeValue
Overrides:
toString in class java.lang.Object
Returns:
a string representation of this node shape value.

valueOf

public static NodeShapeValue valueOf(java.lang.String value)
Returns a new NodeShapeValue instance, created using the specified string description.
Parameters:
value - the string description to be used in creating the new NodeShapeValue instance.
Returns:
the new NodeShapeValue instance.