org.grinvin.render
Class DefaultRenderer
java.lang.Object
org.grinvin.render.DefaultRenderer
- Renderer
public class DefaultRenderer
extends java.lang.Object
Default implementation of a renderer. Renders vertices as small circles
and edges as solid lines. Is a singleton class whose sole instance should
be retrieved by means of the method
getInstance()
.
static Renderer | getInstance() - Get the singleton instance of this renderer.
|
void | paint(Edge edge, double[] coordinates_first, double[] coordinates_second, boolean rollover, boolean selected, Graphics2D g2) - Render an Edge
|
void | paint(Vertex vertex, double[] coordinates, boolean rollover, boolean selected, Graphics2D g2) - Render a Vertex
|
DefaultRenderer
protected DefaultRenderer()
getInstance
public static Renderer getInstance()
Get the singleton instance of this renderer.
paint
public void paint(Edge edge,
double[] coordinates_first,
double[] coordinates_second,
boolean rollover,
boolean selected,
Graphics2D g2)
Render an Edge
- paint in interface Renderer
edge
- Edge to rendercoordinates_first
- Coordinates of the first Vertexcoordinates_second
- Coordinates of the second Vertexrollover
- Is this the current rollover?selected
- Is this Edge selected?g2
- Panel to paint on
paint
public void paint(Vertex vertex,
double[] coordinates,
boolean rollover,
boolean selected,
Graphics2D g2)
Render a Vertex
- paint in interface Renderer
vertex
- Vertex to rendercoordinates
- Coordinates of the Vertexrollover
- Is this the current rollover?selected
- Is this Vertex selected?g2
- Panel to paint on