fcmodeler.attributes
Class DashValue

java.lang.Object
  |
  +--fcmodeler.attributes.DashValue
All Implemented Interfaces:
EdgeVisualAttributeValue, VisualAttributeValue

public final class DashValue
extends java.lang.Object
implements VisualAttributeValue, EdgeVisualAttributeValue

A specific value of the dash attribute. This class represents a dash array, with the first element being the "on" value and the second element being the "off" value.

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

Constructor Summary
DashValue()
          Creates a new DashValue representing the dash array [2.0,2.0].
DashValue(float[] dash)
          Creates a new DashValue using the specified array.
DashValue(java.lang.String dash)
          Creates a new DashValue using the specified string description.
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares the specified object with this dash value for equality.
 VisualAttribute getAttribute()
           
 float[] getDash()
          Returns the array used in this dash value.
 int hashCode()
          Returns the hash code for this visual attribute value.
 void setEdgeValue(EdgeFigure figure)
          Sets the dash array of the specified edge figure to the array contained in this dash value.
 void setPermanentEdgeValue(EdgeFigure figure)
          Sets the permanent dash array of the specified edge figure to the array contained in this dash value.
 java.lang.String toString()
          Returns a string representation of this visual attribute value.
static DashValue valueOf(java.lang.String value)
          Returns a new DashValue instance, created using the specified string description.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DashValue

public DashValue()
Creates a new DashValue representing the dash array [2.0,2.0].

DashValue

public DashValue(float[] dash)
Creates a new DashValue using the specified array. If both elements of the array are equal to 0.0f, the dash value represents a solid line.
Parameters:
dash - the dash array to be used in this dash value.

DashValue

public DashValue(java.lang.String dash)
Creates a new DashValue using the specified string description. The string must be formatted as "[on,off]".
Parameters:
dash - the string representation of this dash value.
Method Detail

equals

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

getAttribute

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

getDash

public float[] getDash()
Returns the array used in this dash value.
Returns:
the array used in this dash value.

hashCode

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

setEdgeValue

public void setEdgeValue(EdgeFigure figure)
Sets the dash array of the specified edge figure to the array contained in this dash value.
Specified by:
setEdgeValue in interface EdgeVisualAttributeValue
Parameters:
figure - the edge figure to update.

setPermanentEdgeValue

public void setPermanentEdgeValue(EdgeFigure figure)
Sets the permanent dash array of the specified edge figure to the array contained in this dash value.
Specified by:
setPermanentEdgeValue in interface EdgeVisualAttributeValue
Parameters:
figure - the edge figure to update.

toString

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

valueOf

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