Documentation of 'edu.uci.ics.jung.visualization.control.AbstractModalGraphMouse' Java class
AbstractModalGraphMouse
edu.uci.ics.jung.visualization.control

Class AbstractModalGraphMouse

  • All Implemented Interfaces:
    ModalGraphMouse, VisualizationViewer.GraphMouse, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.awt.ItemSelectable, java.util.EventListener
    Direct Known Subclasses:
    AnnotatingModalGraphMouse, DefaultModalGraphMouse, EditingModalGraphMouse, ModalLensGraphMouse


    public abstract class AbstractModalGraphMouse
    extends PluggableGraphMouse
    implements ModalGraphMouse, java.awt.ItemSelectable
    AbstractModalGraphMouse is a PluggableGraphMouse class that manages a collection of plugins for picking and transforming the graph. Additionally, it carries the notion of a Mode: Picking or Translating. Switching between modes allows for a more natural choice of mouse modifiers to be used for the various plugins. The default modifiers are intended to mimick those of mainstream software applications in order to be intuitive to users. To change between modes, two different controls are offered, a combo box and a menu system. These controls are lazily created in their respective 'getter' methods so they don't impact code that does not intend to use them. The menu control can be placed in an unused corner of the GraphZoomScrollPane, which is a common location for mouse mode selection menus in mainstream applications. Users must implement the loadPlugins() method to create and install the GraphMousePlugins. The order of the plugins is important, as they are evaluated against the mask parameters in the order that they are added.
    • Method Detail

      • setZoomAtMouse

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

        public java.awt.event.ItemListener getModeListener()
        Specified by:
        getModeListener in interface ModalGraphMouse
        Returns:
        Returns the modeListener.
      • getModeKeyListener

        public java.awt.event.KeyListener getModeKeyListener()
        Returns:
        the modeKeyListener
      • setModeKeyListener

        public void setModeKeyListener(java.awt.event.KeyListener modeKeyListener)
        Parameters:
        modeKeyListener - the modeKeyListener to set
      • getModeComboBox

        public javax.swing.JComboBox<ModalGraphMouse.Mode> getModeComboBox()
        Returns:
        Returns the modeBox.
      • getModeMenu

        public javax.swing.JMenu getModeMenu()
        create (if necessary) and return a menu that will change the mode
        Returns:
        the menu
      • addItemListener

        public void addItemListener(java.awt.event.ItemListener aListener)
        add a listener for mode changes
        Specified by:
        addItemListener in interface java.awt.ItemSelectable
      • removeItemListener

        public void removeItemListener(java.awt.event.ItemListener aListener)
        remove a listener for mode changes
        Specified by:
        removeItemListener in interface java.awt.ItemSelectable
      • getItemListeners

        public java.awt.event.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 java.lang.Object[] getSelectedObjects()
        Specified by:
        getSelectedObjects in interface java.awt.ItemSelectable

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.