public interface View
Modifier and Type | Method and Description |
---|---|
<T,U> void |
addListener(T descriptor,
U listener)
Generic method for add a new Listener.
|
java.util.Collection<GraphicElement> |
allGraphicElementsIn(java.util.EnumSet<InteractiveElement> types,
double x1,
double y1,
double x2,
double y2)
Search for all the graphic elements 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 |
enableMouseOptions()
This is a shortcut to a call setShortcutManager with a MouseOverMouseManager instance and with
(InteractiveElement.EDGE, InteractiveElement.NODE, InteractiveElement.SPRITE).
|
void |
endSelectionAt(double x2,
double y2)
Called by the mouse manager to specify where a node and spite selection
stopped.
|
GraphicElement |
findGraphicElementAt(java.util.EnumSet<InteractiveElement> types,
double x,
double y)
Search for the first GraphicElement among the specified types (precedence:
node, edge, sprite) 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.
|
java.lang.String |
getIdView()
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 |
openInAFrame(boolean on)
Open this view in a frame.
|
<T,U> void |
removeListener(T descriptor,
U listener)
Generic method for remove a Listener.
|
java.lang.Object |
requireFocus()
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.
|
java.lang.String getIdView()
Camera getCamera()
GraphicElement findGraphicElementAt(java.util.EnumSet<InteractiveElement> types, double x, double y)
types
- The types to checkx
- The point abscissa.y
- The point ordinate.java.util.Collection<GraphicElement> allGraphicElementsIn(java.util.EnumSet<InteractiveElement> types, double x1, double y1, double x2, double y2)
types
- The set of types to checkx1
- 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 openInAFrame(boolean on)
on
- Add the view in its own frame or remove it if it already was in
its own frame.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 enableMouseOptions()
java.lang.Object requireFocus()
<T,U> void addListener(T descriptor, U listener)
T
- Describe the listenerU
- Listener<T,U> void removeListener(T descriptor, U listener)
T
- Describe the listenerU
- Listener