Package org.graffiti.graphics
Class LineModeAttribute
java.lang.Object
org.graffiti.attributes.AbstractAttribute
org.graffiti.attributes.CompositeAttribute
org.graffiti.graphics.LineModeAttribute
- All Implemented Interfaces:
Attribute
,DeepCopy
,Displayable
public class LineModeAttribute extends CompositeAttribute
Attribute class for a dash-object, which encapsulates the information needed
to specify stroke properties.
- Version:
- $Revision: 1.7 $
- Author:
- schoeffl
-
Field Summary
-
Constructor Summary
Constructors Constructor Description LineModeAttribute(String id)
Constructor for LineModeAttribute.LineModeAttribute(String id, Dash d)
Constructor for LineModeAttribute. -
Method Summary
Modifier and Type Method Description Object
copy()
Returns a deep copy of thisAttribute
.CollectionAttribute
getAttributes()
Transforms theCompositeAttribute
into the basehierarchy.float[]
getDashArray()
Returns the dashArray of the encapsulated Dash.float
getDashPhase()
Returns the dashPhase of the encapsulated Dash.Object
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 itsgetValue()
method will not returnnull
.Methods inherited from class org.graffiti.attributes.CompositeAttribute
getAttribute
Methods inherited from class org.graffiti.attributes.AbstractAttribute
addEdgeAttributeType, addNodeAttributeType, getAttributable, getDescription, getIcon, getId, getName, getParent, getPath, getTypedAttribute, isDeleted, isTypedAttributeFromID, setDeleted, setDescription, setId, setParent, setValue, toString, toString, toXMLString
-
Constructor Details
-
LineModeAttribute
Constructor for LineModeAttribute.- Parameters:
id
- the id of the attribute.
-
LineModeAttribute
Constructor for LineModeAttribute.- Parameters:
id
- the id of the attribute.d
- the dash-value of the attribute.
-
-
Method Details
-
setAttribute
public void setAttribute(String id, Attribute att) throws AttributeNotFoundException, IllegalArgumentExceptionDescription copied from class:CompositeAttribute
Sets the given attribute to the given value. The attribute that is already locationpath
is overwritten!- Specified by:
setAttribute
in classCompositeAttribute
- Parameters:
id
- the id of the attribute to be set.att
- theAttribute
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
- ifatt
has not the appropriate type.- See Also:
CompositeAttribute.setAttribute(String, Attribute)
-
getAttributes
Description copied from class:CompositeAttribute
Transforms theCompositeAttribute
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 theCollectionAttribute
have no effect on the values of thisCompositeAttribute
.- Specified by:
getAttributes
in classCompositeAttribute
- 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 itsgetValue()
method will not returnnull
.- See Also:
Attribute.setDefaultValue()
-
getValue
Returns a dash object contained in this attribute.- Returns:
- a dash object contained in this attribute.
-
copy
Returns a deep copy of thisAttribute
.- Returns:
- a deep copy of this
Attribute
. - See Also:
DeepCopy.copy()
-