org.graffiti.graphics.grid
Class GridOriginAttribute

java.lang.Object
  extended by org.graffiti.attributes.AbstractAttribute
      extended by org.graffiti.attributes.AbstractCollectionAttribute
          extended by org.graffiti.attributes.LinkedHashMapAttribute
              extended by org.graffiti.graphics.grid.GridOriginAttribute
All Implemented Interfaces:
Attribute, CollectionAttribute, SortedCollectionAttribute, DeepCopy, Displayable<Object>

public final class GridOriginAttribute
extends LinkedHashMapAttribute

Attribute representing the origin of a grid.

Version:
$Revision$ $Date$
Author:
Kathrin Hanauer, Andreas Gleißner

Field Summary
 
Fields inherited from class org.graffiti.attributes.AbstractCollectionAttribute
attributes
 
Fields inherited from class org.graffiti.attributes.AbstractAttribute
id
 
Fields inherited from interface org.graffiti.attributes.Attribute
SEPARATOR
 
Constructor Summary
protected GridOriginAttribute(GridAttribute gridAttribute)
          Constructs a GridOriginAttribute with the specified parent.
 
Method Summary
protected  void applyOnGrid()
          Sets the origin of the grid represented by the parent attribute to the value of this attribute.
 GridOriginAttribute copy()
          Copies this CollectionAttribute and returns the copy.
 double getX()
          Returns the x coordinate.
 double getY()
          Returns the y coordinate.
protected  void setFromGrid(Grid grid)
          Sets the value of this attribute to the origin of the specified grid.
 void setParent(CollectionAttribute parent)
          Sets the parent of this attribute.
 void setX(double value)
          Sets the x coordinate.
 void setY(double value)
          Sets the y coordinate.
 
Methods inherited from class org.graffiti.attributes.LinkedHashMapAttribute
doSetValue, getCollection, setCollection, setDefaultValue, toXMLString
 
Methods inherited from class org.graffiti.attributes.AbstractCollectionAttribute
add, add, containsAttribute, getAttributable, getAttribute, getValue, isEmpty, remove, remove, setAttributable, toString
 
Methods inherited from class org.graffiti.attributes.AbstractAttribute
callPostAttributeAdded, callPostAttributeChanged, callPostAttributeRemoved, callPreAttributeAdded, callPreAttributeChanged, callPreAttributeRemoved, getDescription, getId, getName, getParent, getPath, getSpaces, getStandardXML, setDescription, setValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.graffiti.attributes.CollectionAttribute
add, add, containsAttribute, getAttribute, isEmpty, remove, remove, setAttributable
 
Methods inherited from interface org.graffiti.attributes.Attribute
getAttributable, getId, getParent, getPath, getValue, setValue, toString
 
Methods inherited from interface org.graffiti.plugin.Displayable
getDescription, getName, setDescription
 

Constructor Detail

GridOriginAttribute

protected GridOriginAttribute(GridAttribute gridAttribute)
Constructs a GridOriginAttribute with the specified parent.

Parameters:
gridAttribute - the parent of the constructed attribute.
Method Detail

getX

public double getX()
Returns the x coordinate.

Returns:
the x coordinate.

setX

public void setX(double value)
Sets the x coordinate.

Parameters:
value - the x coordinate.

getY

public double getY()
Returns the y coordinate.

Returns:
the y coordinate.

setY

public void setY(double value)
Sets the y coordinate.

Parameters:
value - the y coordinate.

copy

public GridOriginAttribute copy()
Copies this CollectionAttribute and returns the copy. All sub-attributes will be copied, too, i.e. a deep-copy is returned.

Specified by:
copy in interface DeepCopy
Overrides:
copy in class LinkedHashMapAttribute
Returns:
a copy of the CollectionAttribute.

setParent

public void setParent(CollectionAttribute parent)
               throws FieldAlreadySetException
Sets the parent of this attribute. It must be a GridAttribute.

Specified by:
setParent in interface Attribute
Overrides:
setParent in class AbstractAttribute
Parameters:
parent - the parent of this attribute, which must be a GridAttribute.
Throws:
FieldAlreadySetException - DOCUMENT ME!

applyOnGrid

protected void applyOnGrid()
Sets the origin of the grid represented by the parent attribute to the value of this attribute.


setFromGrid

protected void setFromGrid(Grid grid)
Sets the value of this attribute to the origin of the specified grid.

Parameters:
grid - the grid whose origin is to be copied.


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