org.graffiti.graphics
Class LineModeAttribute

java.lang.Object
  extended by org.graffiti.attributes.AbstractAttribute
      extended by org.graffiti.attributes.CompositeAttribute
          extended by org.graffiti.graphics.LineModeAttribute
All Implemented Interfaces:
Attribute, DeepCopy, Displayable<Object>

public class LineModeAttribute
extends CompositeAttribute

Attribute class for a dash-object, which encapsulates the information needed to specify stroke properties.

Version:
$Revision: 5768 $
Author:
schoeffl

Field Summary
 
Fields inherited from class org.graffiti.attributes.AbstractAttribute
id
 
Fields inherited from interface org.graffiti.attributes.Attribute
SEPARATOR
 
Constructor Summary
LineModeAttribute(String id)
          Constructor for LineModeAttribute.
LineModeAttribute(String id, Dash d)
          Constructor for LineModeAttribute.
 
Method Summary
 Object copy()
          Returns a deep copy of this Attribute.
protected  void doSetValue(Object v)
          Sets the value of this Attribute to the given value without informing the ListenerManager.
 CollectionAttribute getAttributes()
          Transforms the CompositeAttribute into the basehierarchy.
 float[] getDashArray()
          Returns the dashArray of the encapsulated Dash.
 float getDashPhase()
          Returns the dashPhase of the encapsulated Dash.
 Dash getValue()
          Returns a dash object contained in this attribute.
 void setAttribute(String id, Attribute att)
          Sets the given attribute to the given value.
 void setDashArray(float[] da)
          Sets the dashArray of the encapsulated Dash to the given array.
 void setDashPhase(float dp)
          Sets the dashPhase of the encapsulated Dash to the given value.
 void setDefaultValue()
          The attribute's value is set so that its getValue() method will not return null.
 
Methods inherited from class org.graffiti.attributes.CompositeAttribute
getAttribute
 
Methods inherited from class org.graffiti.attributes.AbstractAttribute
callPostAttributeAdded, callPostAttributeChanged, callPostAttributeRemoved, callPreAttributeAdded, callPreAttributeChanged, callPreAttributeRemoved, getAttributable, getDescription, getId, getName, getParent, getPath, getSpaces, getStandardXML, setDescription, setParent, setValue, toString, toString, toXMLString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LineModeAttribute

public LineModeAttribute(String id)
Constructor for LineModeAttribute.

Parameters:
id - the id of the attribute.

LineModeAttribute

public LineModeAttribute(String id,
                         Dash d)
Constructor for LineModeAttribute.

Parameters:
id - the id of the attribute.
d - the dash-value of the attribute.
Method Detail

setAttribute

public void setAttribute(String id,
                         Attribute att)
                  throws AttributeNotFoundException,
                         IllegalArgumentException
Description copied from class: CompositeAttribute
Sets the given attribute to the given value. The attribute that is already location path is overwritten!

Specified by:
setAttribute in class CompositeAttribute
Parameters:
id - the id of the attribute to be set.
att - the Attribute containing the new value for the value asociated with the given id.
Throws:
AttributeNotFoundException - if there is no value associated with the given id.
IllegalArgumentException - if att has not the appropriate type.
See Also:
CompositeAttribute.setAttribute(String, Attribute)

getAttributes

public CollectionAttribute getAttributes()
Description copied from class: CompositeAttribute
Transforms the CompositeAttribute into the basehierarchy. Maps relative paths to the apropriate 'standard attributes' (e.g. IntegerAttribute, StringAttribute etc.) of the composite attribute. This representation is intended to be read-only - changes to the CollectionAttribute have no effect on the values of this CompositeAttribute.

Specified by:
getAttributes in class CompositeAttribute
Returns:
the values of the composite attribute in a CollectionAttribute.
See Also:
CompositeAttribute.getAttributes()

setDashArray

public void setDashArray(float[] da)
Sets the dashArray of the encapsulated Dash to the given array.

Parameters:
da - ths new array to set the dashArray to.

getDashArray

public float[] getDashArray()
Returns the dashArray of the encapsulated Dash.

Returns:
the dashArray of the encapsulated Dash.

setDashPhase

public void setDashPhase(float dp)
Sets the dashPhase of the encapsulated Dash to the given value.

Parameters:
dp - the new value for the dashPhase.

getDashPhase

public float getDashPhase()
Returns the dashPhase of the encapsulated Dash.

Returns:
the dashPhase of the encapsulated Dash.

setDefaultValue

public void setDefaultValue()
Description copied from interface: Attribute
The attribute's value is set so that its getValue() method will not return null.

See Also:
Attribute.setDefaultValue()

getValue

public Dash getValue()
Returns a dash object contained in this attribute.

Returns:
a dash object contained in this attribute.

copy

public Object copy()
Returns a deep copy of this Attribute.

Returns:
a deep copy of this Attribute.
See Also:
DeepCopy.copy()

doSetValue

protected void doSetValue(Object v)
                   throws IllegalArgumentException
Description copied from class: AbstractAttribute
Sets the value of this Attribute to the given value without informing the ListenerManager.

Specified by:
doSetValue in class AbstractAttribute
Parameters:
v - the new value.
Throws:
IllegalArgumentException - if v is not of the apropriate type.
See Also:
AbstractAttribute.doSetValue(Object)


Generated at 2012-05-30 11:00:36 PM CEST