public interface GraphRenderer
There are two rendering mechanisms in the Swing ui package : the viewer and the renderers. The viewer is a complete architecture to render a graph in a panel or frame, handling all the details. The renderer architecture is a way to only render the graph in any surface, handled directly by the developer. When using the render you are must handle the graphic graph by yourself, but you have a lot more flexibility.
The viewer mechanisms uses graph renderers.
Modifier and Type | Method and Description |
---|---|
Collection<GraphicElement> |
allNodesOrSpritesIn(double x1,
double y1,
double x2,
double y2)
Search for all the nodes and sprites contained inside the rectangle
(x1,y1)-(x2,y2).
|
void |
beginSelectionAt(double x1,
double y1)
Called by the mouse manager to specify where a node and sprite selection
started.
|
void |
close() |
void |
endSelectionAt(double x2,
double y2)
Called by the mouse manager to specify where a node and spite selection
stopped.
|
GraphicElement |
findNodeOrSpriteAt(double x,
double y)
Search for the first node or sprite (in that order) that contains the
point at coordinates (x, y).
|
Camera |
getCamera()
Get a camera object to provide control commands on the view.
|
void |
moveElementAtPx(GraphicElement element,
double x,
double y)
Force an element to move at the given location in pixels.
|
void |
open(GraphicGraph graph,
Container drawingSurface) |
void |
render(Graphics2D g,
int x,
int y,
int width,
int height)
Redisplay or update the graph.
|
void |
screenshot(String filename,
int width,
int height) |
void |
selectionGrowsAt(double x,
double y)
The selection already started grows toward position (x, y).
|
void |
setBackLayerRenderer(LayerRenderer renderer)
Set a layer renderer that will be called each time the graph needs to be
redrawn before the graph is rendered.
|
void |
setForeLayoutRenderer(LayerRenderer renderer)
Set a layer renderer that will be called each time the graph needs to be
redrawn after the graph is rendered.
|
void open(GraphicGraph graph, Container drawingSurface)
void close()
Camera getCamera()
GraphicElement findNodeOrSpriteAt(double x, double y)
x
- The point abscissa.y
- The point ordinate.Collection<GraphicElement> allNodesOrSpritesIn(double x1, double y1, double x2, double y2)
x1
- The rectangle lowest point abscissa.y1
- The rectangle lowest point ordinate.x2
- The rectangle highest point abscissa.y2
- The rectangle highest point ordinate.void render(Graphics2D g, int x, int y, int width, int height)
void beginSelectionAt(double x1, double y1)
x1
- The selection start abscissa.y1
- The selection start ordinate.void selectionGrowsAt(double x, double y)
x
- The new end selection abscissa.y
- The new end selection ordinate.void endSelectionAt(double x2, double y2)
x2
- The selection stop abscissa.y2
- The selection stop ordinate.void moveElementAtPx(GraphicElement element, double x, double y)
element
- The element.x
- The requested position abscissa in pixels.y
- The requested position ordinate in pixels.void screenshot(String filename, int width, int height)
void setBackLayerRenderer(LayerRenderer renderer)
renderer
- The renderer (or null to remove it).void setForeLayoutRenderer(LayerRenderer renderer)
renderer
- The renderer (or null to remove it).Copyright © 2015. All rights reserved.