public interface View
Modifier and Type | Method and Description |
---|---|
void |
addKeyListener(KeyListener l)
Add key ui listener.
|
void |
addMouseListener(MouseListener l)
Add mouse ui listener.
|
void |
addMouseMotionListener(MouseMotionListener l)
Add mouse motion ui listener.
|
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(GraphicGraph graph)
Close definitively this view.
|
void |
display(GraphicGraph graph,
boolean graphChanged)
Redisplay or update the view contents.
|
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).
|
void |
freezeElement(GraphicElement element,
boolean frozen)
Freeze an element so that the optional layout cannot move it.
|
Camera |
getCamera()
Get a camera object to provide control commands on the view.
|
String |
getId()
Get the unique view id.
|
void |
moveElementAtPx(GraphicElement element,
double x,
double y)
Force an element to move at the given location in pixels.
|
void |
removeKeyListener(KeyListener l)
Remove key ui listener.
|
void |
removeMouseListener(MouseListener l)
Remove mouse ui listener.
|
void |
removeMouseMotionListener(MouseMotionListener l)
Remove mouse motion ui listener.
|
void |
requestFocus()
Request ui focus.
|
void |
selectionGrowsAt(double x,
double y)
The selection already started grows toward position (x, y).
|
void |
setMouseManager(MouseManager manager)
Change the manager for mouse events on this view.
|
void |
setShortcutManager(ShortcutManager manager)
Change the manager for key and shortcuts events on this view.
|
String getId()
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 display(GraphicGraph graph, boolean graphChanged)
graph
- The graphic graph to represent.graphChanged
- True if the graph changed since the last call to this method.void close(GraphicGraph graph)
graph
- The graphic graph.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 freezeElement(GraphicElement element, boolean frozen)
element
- The element.frozen
- If true the element cannot be moved automatically.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 setMouseManager(MouseManager manager)
MouseManager.init(org.graphstream.ui.graphicGraph.GraphicGraph, View)
method must not yet have been called.manager
- The new manager, or null to set the default manager.MouseManager
void setShortcutManager(ShortcutManager manager)
ShortcutManager.init(org.graphstream.ui.graphicGraph.GraphicGraph, View)
method must not yet have been called.manager
- The new manager, or null to set the default managerShortcutManager
void requestFocus()
void addKeyListener(KeyListener l)
l
- the listenervoid removeKeyListener(KeyListener l)
l
- the listenervoid addMouseListener(MouseListener l)
l
- the listenervoid removeMouseListener(MouseListener l)
l
- the listenervoid addMouseMotionListener(MouseMotionListener l)
l
- the listenervoid removeMouseMotionListener(MouseMotionListener l)
l
- the listenerCopyright © 2015. All rights reserved.