org.graffiti.plugin.view
Interface Grid

All Known Implementing Classes:
AbstractGrid, NoGrid

public interface Grid

Classes implementing Grid represent grids, which can be displayed by some Views. Supporting views return true on View.supportsGrid(). All parameters are given in logical (i.e. attribute system) coordinates. To define a parameter for a concrete grid, declare a public field in the implementing class and annotate it with GridParameter.

Version:
$Revision$ $Date$
Author:
Andreas Gleißner
See Also:
View, AbstractGrid, GridAttribute

Field Summary
static String DESCRIPTION_PATTERN
           
static String NAME_PATTERN
           
 
Method Summary
 Point2D getOrigin()
          Returns the origin of the grid.
 List<Shape> getShapes(Rectangle2D area)
          Returns a list of shapes to present the grid in the specified area.
 double getSnapTolerance()
          Returns the snap tolerance of the grid.
 boolean isBendSnap()
          Returns if the snap behavior of the grid is enabled for bends.
 void setBendSnap(boolean isBendSnap)
          Sets if the snap behavior of the grid is enabled for bends.
 void setOrigin(Point2D origin)
          Sets the origin of the grid.
 void setSnapTolerance(double snapTolerance)
          Sets the snap tolerance of the grid.
 Point2D snapBend(Point2D point)
          Returns the new position of a bend that was previously located at the specified point and snap in the grid.
 Point2D snapNode(Point2D point)
          Returns the new position of a node that was previously located at the specified point and snaps in the grid.
 

Field Detail

NAME_PATTERN

static final String NAME_PATTERN
See Also:
Constant Field Values

DESCRIPTION_PATTERN

static final String DESCRIPTION_PATTERN
See Also:
Constant Field Values
Method Detail

setOrigin

void setOrigin(Point2D origin)
Sets the origin of the grid.

Parameters:
origin - the origin of the grid.

getOrigin

Point2D getOrigin()
Returns the origin of the grid.

Returns:
the origin of the grid.

setSnapTolerance

void setSnapTolerance(double snapTolerance)
Sets the snap tolerance of the grid.

Parameters:
snapTolerance - the snap tolerance of the grid. Negative values denote a disabled snap behavior.

getSnapTolerance

double getSnapTolerance()
Returns the snap tolerance of the grid.

Returns:
the snap tolerance of the grid. Negative values denote a disabled snap behavior.

setBendSnap

void setBendSnap(boolean isBendSnap)
Sets if the snap behavior of the grid is enabled for bends.

Parameters:
isBendSnap - denotes if the snap behavior of the grid is enabled for bends.

isBendSnap

boolean isBendSnap()
Returns if the snap behavior of the grid is enabled for bends.

Returns:
if the snap behavior of the grid is enabled for bends.

snapNode

Point2D snapNode(Point2D point)
Returns the new position of a node that was previously located at the specified point and snaps in the grid.

Parameters:
point - the previous position of the node.
Returns:
the new position of the node.

snapBend

Point2D snapBend(Point2D point)
Returns the new position of a bend that was previously located at the specified point and snap in the grid.

Parameters:
point - the previous position of the bend.
Returns:
the new position of the bend.

getShapes

List<Shape> getShapes(Rectangle2D area)
Returns a list of shapes to present the grid in the specified area.

Parameters:
area - the area.
Returns:
a list of shapes to present the grid in the specified area.


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