org.grinvin.gred

Interface Guides

Known Implementing Classes:
AbstractGuides, BullsEye, GridLines, NullGuides, VerticalIsometricGrid

public interface Guides

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.

Method Summary

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.

Method Details

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.
Parameters:
g2 - Graphics environment with origin in the center of the panel
scale - Number of pixels to one unit
maxX - Maximum X-value that is still in the visible region of the panel
maxY - 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.