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 Objectcopy()Returns a deep copy of thisAttribute.CollectionAttributegetAttributes()Transforms theCompositeAttributeinto the basehierarchy.float[]getDashArray()Returns the dashArray of the encapsulated Dash.floatgetDashPhase()Returns the dashPhase of the encapsulated Dash.ObjectgetValue()Returns a dash object contained in this attribute.voidsetAttribute(String id, Attribute att)Sets the given attribute to the given value.voidsetDashArray(float[] da)Sets the dashArray of the encapsulated Dash to the given array.voidsetDashPhase(float dp)Sets the dashPhase of the encapsulated Dash to the given value.voidsetDefaultValue()The attribute's value is set so that itsgetValue()method will not returnnull.Methods inherited from class org.graffiti.attributes.CompositeAttribute
getAttributeMethods 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:CompositeAttributeSets the given attribute to the given value. The attribute that is already locationpathis overwritten!- Specified by:
setAttributein classCompositeAttribute- Parameters:
id- the id of the attribute to be set.att- theAttributecontaining the new value for the value asociated with the given id.- Throws:
AttributeNotFoundException- if there is no value associated with the given id.IllegalArgumentException- ifatthas not the appropriate type.- See Also:
CompositeAttribute.setAttribute(String, Attribute)
-
getAttributes
Description copied from class:CompositeAttributeTransforms theCompositeAttributeinto 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 theCollectionAttributehave no effect on the values of thisCompositeAttribute.- Specified by:
getAttributesin 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:AttributeThe 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()
-