org.graffiti.graphics
Class RenderedImageAttribute

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

public class RenderedImageAttribute
extends CompositeAttribute

Contains the rendered image graphic attribute.

Version:
$Revision: 5768 $
Author:
breu

Field Summary
 
Fields inherited from class org.graffiti.attributes.AbstractAttribute
id
 
Fields inherited from interface org.graffiti.attributes.Attribute
SEPARATOR
 
Constructor Summary
RenderedImageAttribute(String id)
          Standard constructor.
RenderedImageAttribute(String id, BufferedImage value)
          Constructor for RenderedImageAttribute.
 
Method Summary
 Object copy()
          Copies the image to a new image with the same size.
protected  void doSetValue(Object o)
          Sets the value of this object to the given value.
 Attribute getAttribute(String id)
          Returns the attribute with the given id.
 CollectionAttribute getAttributes()
          Transforms the CompositeAttribute into the basehierarchy.
 BufferedImage getImage()
          Returns the 'image'-value of the encapsulated RenderedImage.
 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 its getValue() method will not return null.
 void setImage(BufferedImage i)
          Sets the 'image'-value.
 
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

RenderedImageAttribute

public RenderedImageAttribute(String id,
                              BufferedImage value)
Constructor for RenderedImageAttribute.

Parameters:
id - the id of the attribute.
value - the value of the attribute.

RenderedImageAttribute

public RenderedImageAttribute(String id)
Standard constructor. Creates an new image with size 0 of type int-argb.

Parameters:
id - the id 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)

getAttribute

public Attribute getAttribute(String id)
                       throws AttributeNotFoundException
Description copied from class: CompositeAttribute
Returns the attribute with the given id. Proper ids can be obtained by calling getAttributes() and then traversing the contained Attributes and calling getId() on them. The returned Attribute is intended to be read-only. Changes to the attribute have no effect on the coresponding value in the CompositeAttribute.

Overrides:
getAttribute in class CompositeAttribute
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

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()

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()

setImage

public void setImage(BufferedImage i)
Sets the 'image'-value.

Parameters:
i - 'image'-value to be set.

getImage

public BufferedImage getImage()
Returns the 'image'-value of the encapsulated RenderedImage.

Returns:
the 'image'-value of the encapsulated RenderedImage.

getValue

public Object getValue()
Returns the value of this attribute. This attribute just returns the image.

Returns:
the value of this attribute.

copy

public Object copy()
Copies the image to a new image with the same size.

Returns:
the copied image.
See Also:
DeepCopy.copy()

doSetValue

protected void doSetValue(Object o)
Sets the value of this object to the given value.

Specified by:
doSetValue in class AbstractAttribute
Parameters:
o - the new value of this object.
Throws:
IllegalArgumentException - DOCUMENT ME!


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