Class AWTImageAttribute

All Implemented Interfaces:
Attribute, DeepCopy, Displayable

public class AWTImageAttribute
extends CompositeAttribute
Contains the awt image graphic attribute.
Version:
$Revision: 1.6 $
Author:
breu
  • Constructor Details

    • AWTImageAttribute

      public AWTImageAttribute​(String id, Image value)
      Constructor for AWTImage.
      Parameters:
      id - the id of the attribute.
      value - the value of the attribute.
    • AWTImageAttribute

      public AWTImageAttribute​(String id)
      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, 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​(Image i)
      Sets the 'image'-value.
      Parameters:
      i - 'image'-value to be set.
    • getImage

      public Image getImage()
      Returns the 'image'-value of the encapsulated awt-image.
      Returns:
      the 'image'-value of the encapsulated awt-image.
    • 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()