fcmodeler.attributes
Class FillValue

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

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

A specific value of the fill attribute.

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

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

Constructor Detail

FillValue

public FillValue()
Creates a new FillValue representing the color white.

FillValue

public FillValue(java.awt.Color color)
Creates a new FillValue using the specified color.
Parameters:
color - the color to be used in this color value.

FillValue

public FillValue(java.lang.String color)
Creates a new FillValue using the specified string description. The string must either be a color name contained in ColorFactory or the rgb values for a color specified as "[red, green, blue]".
Parameters:
color - the string description of this color value.
Method Detail

equals

public boolean equals(java.lang.Object o)
Compares the specified object with this fill 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 fill value.
Returns:
true if the specified object is equal to this fill value.

getAttribute

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

getColor

public java.awt.Color getColor()
Returns the color used in this fill value.
Returns:
the color used in this fill value.

hashCode

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

setNodeValue

public void setNodeValue(NodeFigure figure)
Sets the fill color of the specified node figure to the color contained in this fill value.
Specified by:
setNodeValue in interface NodeVisualAttributeValue
Parameters:
figure - the node figure to update.

setPermanentNodeValue

public void setPermanentNodeValue(NodeFigure figure)
Sets the permanent fill color of the specified node figure to the color contained in this fill value.
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 fill value.
Specified by:
toString in interface VisualAttributeValue
Overrides:
toString in class java.lang.Object
Returns:
a string representation of this fill value.

valueOf

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