org.grinvin.gred.guides

Class NullGuides

Implemented Interfaces:
Guides

public class NullGuides
extends java.lang.Object
implements Guides

Trivial implementation of Guides which paints no background and which prefers vertices to keep their requested positions.

Constructor Summary

NullGuides()

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.

Constructor Details

NullGuides

public NullGuides()

Method Details

getButtonIcon

public Icon getButtonIcon()
Return a small icon representing this type of graph.
Specified by:
getButtonIcon in interface Guides

paint

public void paint(Graphics2D g2,
                  double scale,
                  double maxX,
                  double maxY)
Draw guides onto the panel background.
Specified by:
paint in interface Guides
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.
Specified by:
snap in interface Guides