org.grinvin.gred.guides

Class VerticalIsometricGrid

Implemented Interfaces:
Guides

public class VerticalIsometricGrid
extends AbstractGuides

Guides based on a isometric grid with vertical lines. The number of triangles in a column is configurable.

Nested Class Summary

Nested classes/interfaces inherited from class org.grinvin.gred.guides.AbstractGuides

AbstractGuides.ButtonIcon

Field Summary

Fields inherited from class org.grinvin.gred.guides.AbstractGuides

GUIDE_COLOR, GUIDE_STROKE, buttonIcon

Constructor Summary

VerticalIsometricGrid(int numberOfTriangles)
Create a new object of this type.

Method Summary

void
paint(Graphics2D g2, double scale, double maxX, double maxY)
Paint the grid
void
setNumberOfTriangles(int numberOfTriangles)
Set the number of divisions used by this gridtriangles in a column.
void
snap(double[] coords)
Snap coordinates to the closest grid position.

Methods inherited from class org.grinvin.gred.guides.AbstractGuides

getButtonIcon, paint, snap

Constructor Details

VerticalIsometricGrid

public VerticalIsometricGrid(int numberOfTriangles)
Create a new object of this type. Set the number of divisions used by this gridtriangles in a column.
Parameters:
numberOfTriangles - Number of triangles in a column.

Method Details

paint

public void paint(Graphics2D g2,
                  double scale,
                  double maxX,
                  double maxY)
Paint the grid
Specified by:
paint in interface Guides
Overrides:
paint in interface AbstractGuides

setNumberOfTriangles

public void setNumberOfTriangles(int numberOfTriangles)
Set the number of divisions used by this gridtriangles in a column.
Parameters:
numberOfTriangles - Number of triangles in a column.

snap

public void snap(double[] coords)
Snap coordinates to the closest grid position.
Specified by:
snap in interface Guides
Overrides:
snap in interface AbstractGuides