org.grinvin.gred.guides

Class BullsEye

Implemented Interfaces:
Guides

public class BullsEye
extends AbstractGuides

Guides consisting of concentric circles divided into sectors. The number of circles and sectors 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

BullsEye(int numberOfCircles, int numberOfSectors)
Create a new object of this type.

Method Summary

void
paint(Graphics2D g2, double scale, double maxX, double maxY)
Paint the bull's eye.
void
setNumberOfDivisions(int numberOfCircles, int numberOfSectors)
Set the number of divisions used by this grid.
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

BullsEye

public BullsEye(int numberOfCircles,
                int numberOfSectors)
Create a new object of this type.
Parameters:
numberOfCircles - Number of rows in the grid, i.e., one less than the number of horizontal grid lines.
numberOfSectors - Number of columns in the grid, i.e., one less than the number of vertical grid lines.

Method Details

paint

public void paint(Graphics2D g2,
                  double scale,
                  double maxX,
                  double maxY)
Paint the bull's eye.
Specified by:
paint in interface Guides
Overrides:
paint in interface AbstractGuides

setNumberOfDivisions

public void setNumberOfDivisions(int numberOfCircles,
                                 int numberOfSectors)
Set the number of divisions used by this grid.
Parameters:
numberOfCircles - Number of circles in the bull's eye.
numberOfSectors -

snap

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