org.grinvin.gred
Interface Guides
- AbstractGuides, BullsEye, GridLines, NullGuides, VerticalIsometricGrid
A guide class can be associated to a
GraphPanel
to provide
visible guides to preferred positions for vertices, and to allow a
'snap to guides' functionality.
Icon | getButtonIcon() - Return a small icon representing this type of graph.
|
void | paint(Graphics2D g2, double scale, double maxX, double maxY) - Draw guides onto the panel background.
|
void | snap(double[] coords) - Adjust the given coordinate array to correspond with 'guide'
positions.
|
getButtonIcon
public Icon getButtonIcon()
Return a small icon representing this type of graph.
paint
public void paint(Graphics2D g2,
double scale,
double maxX,
double maxY)
Draw guides onto the panel background.
g2
- Graphics environment with origin in the center of the panelscale
- Number of pixels to one unitmaxX
- Maximum X-value that is still in the visible region of the panelmaxY
- Maximum Y-value that is still in the visible region of the panel
snap
public void snap(double[] coords)
Adjust the given coordinate array to correspond with 'guide'
positions.