be.ac.ulg.montefiore.run.totem.visualtopo.guiModules.topEdit.graph
Class MyEditingGraphMousePlugin

java.lang.Object
  extended by edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
      extended by be.ac.ulg.montefiore.run.totem.visualtopo.guiModules.topEdit.graph.MyEditingGraphMousePlugin
All Implemented Interfaces:
BatchModeCapable, edu.uci.ics.jung.visualization.control.GraphMousePlugin, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener

public class MyEditingGraphMousePlugin
extends edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, BatchModeCapable

A plugin that can create vertices and directed edges using mouse gestures. Based on EditingGraphMousePlugin by Tom Nelson. When batch mode is false, each element creation (vertex, edge) triggers a dialog to edit the properties of corresponding node and link. Otherwise default objects are created.

Author:
Gaƫl Monfort (monfort@run.montefiore.ulg.ac.be)

Field Summary
 
Fields inherited from class edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
cursor, modifiers
 
Constructor Summary
MyEditingGraphMousePlugin()
           
MyEditingGraphMousePlugin(int modifiers)
          create instance and prepare shapes for visual effects
 
Method Summary
 boolean checkModifiers(java.awt.event.MouseEvent e)
          overrided to be more flexible, and pass events with key combinations.
 boolean getBatchMode()
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
          If startVertex is non-null, stretch an edge shape between startVertex and the mouse pointer to simulate edge creation
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
          If the mouse is pressed in an empty area, create a new vertex there.
 void mouseReleased(java.awt.event.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 setBatchMode(boolean batchMode)
           
 void setVertexLocations(edu.uci.ics.jung.visualization.SettableVertexLocationFunction vertexLocations)
          sets the vertex locations.
 
Methods inherited from class edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
getCursor, getModifiers, setCursor, setModifiers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyEditingGraphMousePlugin

public MyEditingGraphMousePlugin()

MyEditingGraphMousePlugin

public MyEditingGraphMousePlugin(int modifiers)
create instance and prepare shapes for visual effects

Parameters:
modifiers -
Method Detail

setBatchMode

public void setBatchMode(boolean batchMode)
Specified by:
setBatchMode in interface BatchModeCapable

getBatchMode

public boolean getBatchMode()
Specified by:
getBatchMode in interface BatchModeCapable

setVertexLocations

public void setVertexLocations(edu.uci.ics.jung.visualization.SettableVertexLocationFunction vertexLocations)
sets the vertex locations. Needed to place new vertices

Parameters:
vertexLocations -

checkModifiers

public boolean checkModifiers(java.awt.event.MouseEvent e)
overrided to be more flexible, and pass events with key combinations. The default responds to both ButtonOne and ButtonOne+Shift

Specified by:
checkModifiers in interface edu.uci.ics.jung.visualization.control.GraphMousePlugin
Overrides:
checkModifiers in class edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
If the mouse is pressed in an empty area, create a new vertex there. If the mouse is pressed on an existing vertex, prepare to create an edge from that vertex to another

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.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. If shift was also pressed, create a directed edge instead.

Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
If startVertex is non-null, stretch an edge shape between startVertex and the mouse pointer to simulate edge creation

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener


Copyright © 2004-2007 Research Unit in Networking, All Rights Reserved.