public class EditingGraphMousePlugin<V,E> extends AbstractGraphMousePlugin implements MouseListener, MouseMotionListener
| Modifier and Type | Field and Description |
|---|---|
protected EdgeSupport<V,E> |
edgeSupport |
protected VertexSupport<V,E> |
vertexSupport |
cursor, down, modifiers| Constructor and Description |
|---|
EditingGraphMousePlugin(int modifiers,
com.google.common.base.Supplier<V> vertexFactory,
com.google.common.base.Supplier<E> edgeFactory)
Creates an instance and prepares shapes for visual effects.
|
EditingGraphMousePlugin(com.google.common.base.Supplier<V> vertexFactory,
com.google.common.base.Supplier<E> edgeFactory)
Creates an instance and prepares shapes for visual effects, using the default modifiers
of BUTTON1_MASK.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkModifiers(MouseEvent e)
Overridden to be more flexible, and pass events with
key combinations.
|
EdgeSupport<V,E> |
getEdgeSupport() |
VertexSupport<V,E> |
getVertexSupport() |
void |
mouseClicked(MouseEvent e) |
void |
mouseDragged(MouseEvent e)
If startVertex is non-null, stretch an edge shape between
startVertex and the mouse pointer to simulate edge creation
|
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e) |
void |
mouseMoved(MouseEvent e) |
void |
mousePressed(MouseEvent e)
If the mouse is pressed in an empty area, create a new vertex there.
|
void |
mouseReleased(MouseEvent e)
If startVertex is non-null, and the mouse is released over an
existing vertex, create an undirected edge from startVertex to
the vertex under the mouse pointer.
|
void |
setEdgeSupport(EdgeSupport<V,E> edgeSupport) |
void |
setVertexSupport(VertexSupport<V,E> vertexSupport) |
getCursor, getModifiers, setCursor, setModifiersprotected VertexSupport<V,E> vertexSupport
protected EdgeSupport<V,E> edgeSupport
public EditingGraphMousePlugin(com.google.common.base.Supplier<V> vertexFactory, com.google.common.base.Supplier<E> edgeFactory)
vertexFactory - for creating verticesedgeFactory - for creating edgespublic EditingGraphMousePlugin(int modifiers,
com.google.common.base.Supplier<V> vertexFactory,
com.google.common.base.Supplier<E> edgeFactory)
modifiers - the mouse event modifiers to usevertexFactory - for creating verticesedgeFactory - for creating edgespublic boolean checkModifiers(MouseEvent e)
checkModifiers in interface GraphMousePlugincheckModifiers in class AbstractGraphMousePlugine - an event to compare topublic void mousePressed(MouseEvent e)
mousePressed in interface MouseListenerpublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenerpublic void mouseDragged(MouseEvent e)
mouseDragged in interface MouseMotionListenerpublic void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenerpublic void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenerpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenerpublic void mouseMoved(MouseEvent e)
mouseMoved in interface MouseMotionListenerpublic VertexSupport<V,E> getVertexSupport()
public void setVertexSupport(VertexSupport<V,E> vertexSupport)
public EdgeSupport<V,E> getEdgeSupport()
public void setEdgeSupport(EdgeSupport<V,E> edgeSupport)
Copyright © 2016. All rights reserved.