Package net.sf.jaxodraw.gui.grid
Interface JaxoGrid
- All Known Subinterfaces:
JaxoPaintableGrid
- All Known Implementing Classes:
JaxoDefaultGrid
public interface JaxoGrid
Grid: A grid "is" a collection of Points in the plane.
An arbitrary point can be mapped to its closest point on the grid.
This interface only knows about points on the grid, not about painting.
In general, the grid is assumed to be infinite in all directions, not restricted
to current bounding boxes or canvas size (of course, a specific grid could, e.g.,
claim that there are no grid points with negative coordinates).
- Since:
- 2.0
-
Method Summary
-
Method Details
-
isSnapped
Determines if 'p' is on the grid. This is equivalent top.equals(snappedPoint(p))
.- Parameters:
p
- The point to snap.- Returns:
- True if p is on the grid.
-
snappedPoint
Closest point to 'p' on the grid.- Parameters:
p
- The point to snap.- Returns:
- The closest grid point.
-
snapPoint
Change 'p' to the closest point on the grid.- Parameters:
p
- The point to snap.
-