org.graffiti.graphics.grid
Class GridAttribute

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.GridAttribute
All Implemented Interfaces:
Attribute, CollectionAttribute, SortedCollectionAttribute, DeepCopy, Displayable<Object>

public class GridAttribute
extends LinkedHashMapAttribute

Attribute representing a grid.

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

Field Summary
static String GRID_CLASS
          Id of the contained GridClassAttribute.
static String GRID_ORIGIN
          Id of the contained GridOriginAttribute.
static String GRID_PARAMETERS
          Id of the contained GridParametersAttribute.
static String GRID_SNAP
          Id of the contained SnapOnGridAttribute.
 
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
GridAttribute(String id)
          Constructs a GridAttribute with the specified id.
 
Method Summary
 GridAttribute copy()
          Returns a clone of this attribute.
 Grid getGrid()
          Returns the grid represented by this attribute.
 GridOriginAttribute getOriginAttribute()
          Returns an attribute representing the origin of the grid.
 GridParametersAttribute getParametersAttribute()
          Returns an attribute representing the parameters specific to the type of the grid.
 SnapOnGridAttribute getSnapAttribute()
          Returns an attribute representing the snap behavior of the grid.
protected  void postChange()
          Decreases the counter.
protected  void preChange()
          Increases the counter.
 void setClass(Class<? extends Grid> newClass)
          Sets the type of the grid.
 void setGrid(Grid grid)
          Makes this attribute to represent the specified grid.
 
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, setParent, 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, setParent, setValue, toString
 
Methods inherited from interface org.graffiti.plugin.Displayable
getDescription, getName, setDescription
 

Field Detail

GRID_CLASS

public static final String GRID_CLASS
Id of the contained GridClassAttribute.

See Also:
Constant Field Values

GRID_SNAP

public static final String GRID_SNAP
Id of the contained SnapOnGridAttribute.

See Also:
Constant Field Values

GRID_ORIGIN

public static final String GRID_ORIGIN
Id of the contained GridOriginAttribute.

See Also:
Constant Field Values

GRID_PARAMETERS

public static final String GRID_PARAMETERS
Id of the contained GridParametersAttribute.

See Also:
Constant Field Values
Constructor Detail

GridAttribute

public GridAttribute(String id)
Constructs a GridAttribute with the specified id.

Parameters:
id - the id of the GridAttribute.
Method Detail

setClass

public void setClass(Class<? extends Grid> newClass)
Sets the type of the grid.

Parameters:
newClass - the Class object representing the type of the grid.

preChange

protected void preChange()
Increases the counter. If the counter reaches one, a new AttributeEvent is created.


postChange

protected void postChange()
Decreases the counter. If the counter reaches zero, the previously created AttributeEvent is raised.


getGrid

public Grid getGrid()
Returns the grid represented by this attribute. The same object is returned while the grid type remains the same.

Returns:
the grid represented by this attribute.

setGrid

public void setGrid(Grid grid)
Makes this attribute to represent the specified grid. The grid returned by getGrid() will be a clone of the specified grid.

Parameters:
grid - the grid to be represented by this attribute.

copy

public GridAttribute copy()
Returns a clone of this attribute.

Specified by:
copy in interface DeepCopy
Overrides:
copy in class LinkedHashMapAttribute
Returns:
a clone of this attribute.

getSnapAttribute

public SnapOnGridAttribute getSnapAttribute()
Returns an attribute representing the snap behavior of the grid.

Returns:
an attribute representing the snap behavior of the grid.

getOriginAttribute

public GridOriginAttribute getOriginAttribute()
Returns an attribute representing the origin of the grid.

Returns:
an attribute representing the origin of the grid.

getParametersAttribute

public GridParametersAttribute getParametersAttribute()
Returns an attribute representing the parameters specific to the type of the grid.

Returns:
an attribute representing the parameters specific to the type of the grid.


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