edu.uci.ics.jung.visualization.control
Class EditingModalGraphMouse

java.lang.Object
  extended by edu.uci.ics.jung.visualization.control.PluggableGraphMouse
      extended by edu.uci.ics.jung.visualization.control.EditingModalGraphMouse
All Implemented Interfaces:
ModalGraphMouse, VisualizationViewer.GraphMouse, MouseListener, MouseMotionListener, MouseWheelListener, ItemSelectable, EventListener

public class EditingModalGraphMouse
extends PluggableGraphMouse
implements ModalGraphMouse, ItemSelectable

Author:
Tom Nelson

Nested Class Summary
 
Nested classes/interfaces inherited from interface edu.uci.ics.jung.visualization.control.ModalGraphMouse
ModalGraphMouse.Mode
 
Field Summary
protected  GraphMousePlugin animatedPickingPlugin
           
protected  GraphMousePlugin editingPlugin
           
protected  float in
          used by the scaling plugins for zoom in
protected  EventListenerList listenerList
          listeners for mode changes
protected  ModalGraphMouse.Mode mode
          the current mode
protected  JComboBox modeBox
          a JComboBox control available to set the mode
protected  ItemListener modeListener
          a listener for mode changes
protected  JMenu modeMenu
          a menu available to set the mode
protected  float out
          used by the scaling plugins for zoom out
protected  GraphMousePlugin pickingPlugin
           
protected  GraphMousePlugin rotatingPlugin
           
protected  GraphMousePlugin scalingPlugin
           
protected  GraphMousePlugin shearingPlugin
           
protected  GraphMousePlugin translatingPlugin
           
 
Constructor Summary
EditingModalGraphMouse()
          create an instance with default values
EditingModalGraphMouse(float in, float out)
          create an instance with passed values
 
Method Summary
 void addItemListener(ItemListener aListener)
          add a listener for mode changes
protected  void fireItemStateChanged(ItemEvent e)
          Notifies all listeners that have registered interest for notification on this event type.
 ItemListener[] getItemListeners()
          Returns an array of all the ItemListeners added to this JComboBox with addItemListener().
 JComboBox getModeComboBox()
           
 ItemListener getModeListener()
           
 JMenu getModeMenu()
          create (if necessary) and return a menu that will change the mode
 Object[] getSelectedObjects()
           
protected  void loadPlugins()
          create the plugins, and load the plugins for TRANSFORMING mode
 void removeItemListener(ItemListener aListener)
          remove a listener for mode changes
protected  void setEditingMode()
           
 void setMode(ModalGraphMouse.Mode mode)
          setter for the Mode.
protected  void setPickingMode()
           
protected  void setTransformingMode()
           
 void setVertexLocations(SettableVertexLocationFunction vertexLocations)
           
 void setZoomAtMouse(boolean zoomAtMouse)
           
 
Methods inherited from class edu.uci.ics.jung.visualization.control.PluggableGraphMouse
add, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.event.MouseListener
mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased
 
Methods inherited from interface java.awt.event.MouseMotionListener
mouseDragged, mouseMoved
 
Methods inherited from interface java.awt.event.MouseWheelListener
mouseWheelMoved
 

Field Detail

in

protected float in
used by the scaling plugins for zoom in


out

protected float out
used by the scaling plugins for zoom out


modeListener

protected ItemListener modeListener
a listener for mode changes


modeBox

protected JComboBox modeBox
a JComboBox control available to set the mode


modeMenu

protected JMenu modeMenu
a menu available to set the mode


mode

protected ModalGraphMouse.Mode mode
the current mode


listenerList

protected EventListenerList listenerList
listeners for mode changes


pickingPlugin

protected GraphMousePlugin pickingPlugin

translatingPlugin

protected GraphMousePlugin translatingPlugin

animatedPickingPlugin

protected GraphMousePlugin animatedPickingPlugin

scalingPlugin

protected GraphMousePlugin scalingPlugin

rotatingPlugin

protected GraphMousePlugin rotatingPlugin

shearingPlugin

protected GraphMousePlugin shearingPlugin

editingPlugin

protected GraphMousePlugin editingPlugin
Constructor Detail

EditingModalGraphMouse

public EditingModalGraphMouse()
create an instance with default values


EditingModalGraphMouse

public EditingModalGraphMouse(float in,
                              float out)
create an instance with passed values

Parameters:
in - override value for scale in
out - override value for scale out
Method Detail

loadPlugins

protected void loadPlugins()
create the plugins, and load the plugins for TRANSFORMING mode


setVertexLocations

public void setVertexLocations(SettableVertexLocationFunction vertexLocations)

setMode

public void setMode(ModalGraphMouse.Mode mode)
setter for the Mode.

Specified by:
setMode in interface ModalGraphMouse

setPickingMode

protected void setPickingMode()

setTransformingMode

protected void setTransformingMode()

setEditingMode

protected void setEditingMode()

setZoomAtMouse

public void setZoomAtMouse(boolean zoomAtMouse)
Parameters:
zoomAtMouse - The zoomAtMouse to set.

getModeListener

public ItemListener getModeListener()
Specified by:
getModeListener in interface ModalGraphMouse
Returns:
Returns the modeListener.

getModeComboBox

public JComboBox getModeComboBox()
Returns:
Returns the modeBox.

getModeMenu

public JMenu getModeMenu()
create (if necessary) and return a menu that will change the mode

Returns:
the menu

addItemListener

public void addItemListener(ItemListener aListener)
add a listener for mode changes

Specified by:
addItemListener in interface ItemSelectable

removeItemListener

public void removeItemListener(ItemListener aListener)
remove a listener for mode changes

Specified by:
removeItemListener in interface ItemSelectable

getItemListeners

public ItemListener[] getItemListeners()
Returns an array of all the ItemListeners added to this JComboBox with addItemListener().

Returns:
all of the ItemListeners added or an empty array if no listeners have been added
Since:
1.4

getSelectedObjects

public Object[] getSelectedObjects()
Specified by:
getSelectedObjects in interface ItemSelectable

fireItemStateChanged

protected void fireItemStateChanged(ItemEvent e)
Notifies all listeners that have registered interest for notification on this event type.

Parameters:
e - the event of interest
See Also:
EventListenerList