Class DimensionAttribute

All Implemented Interfaces:
Comparable<Object>, Attribute, CollectionAttribute, DeepCopy, GraphicAttributeConstants, Displayable

public class DimensionAttribute
extends HashMapAttribute
implements GraphicAttributeConstants
Contains the graphic attribute dimension, that represents the minimal surrounding rectangle
Version:
$Revision: 1.7 $
Author:
breu
  • Constructor Details

    • DimensionAttribute

      public DimensionAttribute​(String id)
      Constructor for Dimension.
      Parameters:
      id - the id of the attribute.
    • DimensionAttribute

      public DimensionAttribute​(String id, Dimension d)
      Constructor for Dimension.
      Parameters:
      id - the id of the attribute.
      d - the dimension-value of the attribute.
    • DimensionAttribute

      public DimensionAttribute​(String id, double h, double w)
      Constructor for Dimension.
      Parameters:
      id - the id of the attribute.
      h - the height-value of the attribute.
      w - the width-value of the attribute.
    • DimensionAttribute

      public DimensionAttribute​(String id, DoubleAttribute h, DoubleAttribute w)
      Constructor for Dimension.
      Parameters:
      id - the id of the attribute.
      h - the height-value of the attribute.
      w - the width-value of the attribute.
  • Method Details

    • setCollection

      public void setCollection​(Map<String,​Attribute> attrs)
      Sets the collection of attributes contained within this CollectionAttribute. The dimension values are set, additional values are simply added (that means that if there exists already a subattribute with the same id, an exception will be thrown).
      Specified by:
      setCollection in interface CollectionAttribute
      Overrides:
      setCollection in class HashMapAttribute
      Parameters:
      attrs - the map that contains all attributes.
      Throws:
      IllegalArgumentException - DOCUMENT ME!
    • setDimension

      public void setDimension​(Dimension d)
      Sets the Dimension of the attribute.
      Parameters:
      d - the dimension-value of the attribute.
    • setDimension

      public void setDimension​(double w, double h)
      Sets the Dimension of the attribute.
      Parameters:
      w - the dimension-value of the attribute.
      h - DOCUMENT ME!
    • getDimension

      public Dimension getDimension()
      Returns the Dimension of the attribute.
      Returns:
      the Dimension of the attribute.
    • setHeight

      public void setHeight​(double h)
      Sets the 'height'-value.
      Parameters:
      h - the 'height'-value to be set.
    • getHeight

      public double getHeight()
      Returns the 'height'-value of the encapsulated dimension.
      Returns:
      the 'height'-value of the encapsulated dimension.
    • setWidth

      public void setWidth​(double w)
      Sets the 'width'-value.
      Parameters:
      w - the 'width'-value to be set.
    • getWidth

      public double getWidth()
      Returns the 'width'-value of the encapsulated dimension.
      Returns:
      the 'width'-value of the encapsulated dimension.
    • copy

      public Object copy()
      Returns a deep copy of this object.
      Specified by:
      copy in interface DeepCopy
      Overrides:
      copy in class HashMapAttribute
      Returns:
      A deep copy of this object.