public class SwingBasicGraphRenderer extends GraphRendererBase
This is a minimal implementation of a renderer that only supports a subset of the CSS :
| Constructor and Description |
|---|
SwingBasicGraphRenderer() |
| 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 |
close() |
void |
elementStyleChanged(Element element,
StyleGroup oldStyle,
StyleGroup style)
The style of the element changed.
|
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 renderingSurface) |
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 |
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.
|
beginSelectionAt, endSelectionAt, getRenderingSurface, selectionGrowsAtpublic void open(GraphicGraph graph, Container renderingSurface)
open in interface GraphRendereropen in class GraphRendererBasepublic void close()
close in interface GraphRendererclose in class GraphRendererBasepublic Camera getCamera()
GraphRendererpublic Collection<GraphicElement> allNodesOrSpritesIn(double x1, double y1, double x2, double y2)
GraphRendererx1 - The rectangle lowest point abscissa.y1 - The rectangle lowest point ordinate.x2 - The rectangle highest point abscissa.y2 - The rectangle highest point ordinate.public GraphicElement findNodeOrSpriteAt(double x, double y)
GraphRendererx - The point abscissa.y - The point ordinate.public void render(Graphics2D g, int x, int y, int width, int height)
GraphRendererpublic void moveElementAtPx(GraphicElement element, double x, double y)
GraphRendererelement - The element.x - The requested position abscissa in pixels.y - The requested position ordinate in pixels.public void screenshot(String filename, int width, int height)
public void setBackLayerRenderer(LayerRenderer renderer)
GraphRendererrenderer - The renderer (or null to remove it).public void setForeLayoutRenderer(LayerRenderer renderer)
GraphRendererrenderer - The renderer (or null to remove it).public void elementStyleChanged(Element element, StyleGroup oldStyle, StyleGroup style)
StyleGroupListenerelement - The element.oldStyle - The old style.style - The changed style or the new style of the element.Copyright © 2015. All rights reserved.