Package org.graffiti.graphics
Class AWTImageAttribute
java.lang.Object
org.graffiti.attributes.AbstractAttribute
org.graffiti.attributes.CompositeAttribute
org.graffiti.graphics.AWTImageAttribute
- All Implemented Interfaces:
Attribute,DeepCopy,Displayable
public class AWTImageAttribute extends CompositeAttribute
Contains the awt image graphic attribute.
- Version:
- $Revision: 1.6 $
- Author:
- breu
-
Field Summary
-
Constructor Summary
Constructors Constructor Description AWTImageAttribute(String id)Standard constructor.AWTImageAttribute(String id, Image value)Constructor for AWTImage. -
Method Summary
Modifier and Type Method Description Objectcopy()Copies the image to a new image with the same size.AttributegetAttribute(String id)Returns the attribute with the given id.CollectionAttributegetAttributes()Transforms theCompositeAttributeinto the basehierarchy.ImagegetImage()Returns the 'image'-value of the encapsulated awt-image.ObjectgetValue()Returns the value of this attribute.voidsetAttribute(String id, Attribute att)Sets the given attribute to the given value.voidsetDefaultValue()The attribute's value is set so that itsgetValue()method will not returnnull.voidsetImage(Image i)Sets the 'image'-value.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
-
AWTImageAttribute
Constructor for AWTImage.- Parameters:
id- the id of the attribute.value- the value of the attribute.
-
AWTImageAttribute
Standard constructor. Creates an new image with size 0 of type int-argb.- Parameters:
id- the id 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)
-
getAttribute
Description copied from class:CompositeAttributeReturns the attribute with the given id. Proper ids can be obtained by callinggetAttributes()and then traversing the containedAttributesand callinggetId()on them. The returnedAttributeis intended to be read-only. Changes to the attribute have no effect on the coresponding value in theCompositeAttribute.- Overrides:
getAttributein classCompositeAttribute- Parameters:
id- the id of the attribute searched for.- Returns:
- the attribute with the given id.
- Throws:
AttributeNotFoundException- if the searched attribute is not found.- See Also:
CompositeAttribute.getAttribute(String)
-
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()
-
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()
-
setImage
Sets the 'image'-value.- Parameters:
i- 'image'-value to be set.
-
getImage
Returns the 'image'-value of the encapsulated awt-image.- Returns:
- the 'image'-value of the encapsulated awt-image.
-
getValue
Returns the value of this attribute. This attribute just returns the image.- Returns:
- the value of this attribute.
-
copy
Copies the image to a new image with the same size.- Returns:
- the copied image.
- See Also:
DeepCopy.copy()
-