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 Object
copy()
Copies the image to a new image with the same size.Attribute
getAttribute(String id)
Returns the attribute with the given id.CollectionAttribute
getAttributes()
Transforms theCompositeAttribute
into the basehierarchy.Image
getImage()
Returns the 'image'-value of the encapsulated awt-image.Object
getValue()
Returns the value of this attribute.void
setAttribute(String id, Attribute att)
Sets the given attribute to the given value.void
setDefaultValue()
The attribute's value is set so that itsgetValue()
method will not returnnull
.void
setImage(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: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)
-
getAttribute
Description copied from class:CompositeAttribute
Returns the attribute with the given id. Proper ids can be obtained by callinggetAttributes()
and then traversing the containedAttributes
and callinggetId()
on them. The returnedAttribute
is intended to be read-only. Changes to the attribute have no effect on the coresponding value in theCompositeAttribute
.- Overrides:
getAttribute
in 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: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()
-
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()
-
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()
-