Class LabelEditingGraphMousePlugin<V,E>
- java.lang.Object
-
- org.jungrapht.visualization.control.AbstractGraphMousePlugin
-
- org.jungrapht.visualization.control.LabelEditingGraphMousePlugin<V,E>
-
- Type Parameters:
V- vertex typeE- edge type
- All Implemented Interfaces:
MouseListener,EventListener,GraphMousePlugin
public class LabelEditingGraphMousePlugin<V,E> extends AbstractGraphMousePlugin implements MouseListener
- Author:
- Tom Nelson
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jungrapht.visualization.control.AbstractGraphMousePlugin
AbstractGraphMousePlugin.Selecting
-
-
Field Summary
Fields Modifier and Type Field Description protected Eedgethe selected Edge, if anyprotected Map<E,String>edgeLabelMapHolds edge to String associations that may be used in the edge label functionprotected intselectionModifiersprotected Vvertexthe selected Vertex, if anyprotected Map<V,String>vertexLabelMapHolds vertex String associations that may be used in the vertex label function-
Fields inherited from class org.jungrapht.visualization.control.AbstractGraphMousePlugin
cursor, down, modifiers
-
-
Constructor Summary
Constructors Constructor Description LabelEditingGraphMousePlugin(Map<V,String> vertexLabelMap, Map<E,String> edgeLabelMap)create an instance with default settingsLabelEditingGraphMousePlugin(Map<V,String> vertexLabelMap, Map<E,String> edgeLabelMap, int selectionModifiers)create an instance with overrides
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidmouseClicked(MouseEvent e)If the mouse is double-clicked on a vertex, show a popup to request a new label for the vertex.voidmouseEntered(MouseEvent e)voidmouseExited(MouseEvent e)voidmousePressed(MouseEvent e)voidmouseReleased(MouseEvent e)-
Methods inherited from class org.jungrapht.visualization.control.AbstractGraphMousePlugin
checkModifiers, getCursor, getModifiersEx, setCursor, setModifiers
-
-
-
-
Field Detail
-
vertex
protected V vertex
the selected Vertex, if any
-
edge
protected E edge
the selected Edge, if any
-
vertexLabelMap
protected Map<V,String> vertexLabelMap
Holds vertex String associations that may be used in the vertex label function
-
edgeLabelMap
protected Map<E,String> edgeLabelMap
Holds edge to String associations that may be used in the edge label function
-
selectionModifiers
protected int selectionModifiers
-
-
Method Detail
-
mouseClicked
public void mouseClicked(MouseEvent e)
If the mouse is double-clicked on a vertex, show a popup to request a new label for the vertex. The label becomes the value for the vertex key in the vertexLabelMap- Specified by:
mouseClickedin interfaceMouseListener- Parameters:
e- the event
-
mouseReleased
public void mouseReleased(MouseEvent e)
- Specified by:
mouseReleasedin interfaceMouseListener
-
mousePressed
public void mousePressed(MouseEvent e)
- Specified by:
mousePressedin interfaceMouseListener
-
mouseEntered
public void mouseEntered(MouseEvent e)
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
public void mouseExited(MouseEvent e)
- Specified by:
mouseExitedin interfaceMouseListener
-
-