org.tigris.gef.base
Class GuideGrid

java.lang.Object
  extended by org.tigris.gef.base.Guide
      extended by org.tigris.gef.base.GuideGrid
All Implemented Interfaces:
java.io.Serializable

public class GuideGrid
extends Guide

Constrains interactions to certain coordinates. In this case, GuideGrid makes objects snap to a grid. Note that GuideGrid is an invisible object that controls the behavior of the Editor and Modes. It is conceptually related to the visible grid (implemented in LayerGrid), but there is no functional relationship between them in this framework.

See Also:
Serialized Form

Field Summary
protected  int _gridSize
          Size of the grid.
 
Constructor Summary
GuideGrid(int size)
          Make a new GuideGrid instance with the given grid size.
 
Method Summary
 void adjust()
          Bring up a dialog box to set the grid snap parameters.
 int gridSize()
          Reply the size of the grid to snap points to.
 void gridSize(int g)
          Set the size of the grid.
 void snap(java.awt.Point p)
          Modify the given point to be on the guideline (In this case, a gridline)
 
Methods inherited from class org.tigris.gef.base.Guide
snapTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_gridSize

protected int _gridSize
Size of the grid.

Constructor Detail

GuideGrid

public GuideGrid(int size)
Make a new GuideGrid instance with the given grid size.

Method Detail

gridSize

public int gridSize()
Reply the size of the grid to snap points to.


gridSize

public void gridSize(int g)
Set the size of the grid.


snap

public void snap(java.awt.Point p)
Modify the given point to be on the guideline (In this case, a gridline)

Specified by:
snap in class Guide

adjust

public void adjust()
Bring up a dialog box to set the grid snap parameters. Needs-More-Work: use the property sheet to change guide parameters.

Overrides:
adjust in class Guide