org.grinvin.gred.guides
Class GridLines
- Guides
Guides based on a square grid within the -1.0 - 1.0 rectangle. The number of
horizontal and vertical grid lines is configurable.
GridLines(int numberOfRows, int numberOfColumns) - Create a new object of this type.
|
void | paint(Graphics2D g2, double scale, double maxX, double maxY) - Paint a grid with the requested number of subdivisions
|
void | setNumberOfDivisions(int numberOfRows, int numberOfColumns) - Set the number of divisions used by this grid.
|
void | snap(double[] coords) - Snap coordinates to the closest grid position.
|
GridLines
public GridLines(int numberOfRows,
int numberOfColumns)
Create a new object of this type.
numberOfRows
- Number of rows in the grid, i.e., one less than the
number of horizontal grid lines.numberOfColumns
- Number of columns in the grid, i.e., one less than the
number of vertical grid lines.
paint
public void paint(Graphics2D g2,
double scale,
double maxX,
double maxY)
Paint a grid with the requested number of subdivisions
- paint in interface Guides
- paint in interface AbstractGuides
setNumberOfDivisions
public void setNumberOfDivisions(int numberOfRows,
int numberOfColumns)
Set the number of divisions used by this grid.
numberOfRows
- Number of rows in the grid, i.e., one less than the
number of horizontal grid lines.numberOfColumns
- Number of columns in the grid, i.e., one less than the
number of vertical grid lines.
snap
public void snap(double[] coords)
Snap coordinates to the closest grid position.
- snap in interface Guides
- snap in interface AbstractGuides