Class AnimatedPickingGraphMousePlugin<V,​E>

  • All Implemented Interfaces:
    GraphMousePlugin, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener
    Direct Known Subclasses:
    SatelliteAnimatedPickingGraphMousePlugin

    public class AnimatedPickingGraphMousePlugin<V,​E>
    extends AbstractGraphMousePlugin
    implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener
    AnimatedPickingGraphMousePlugin supports the picking of one Graph Vertex. When the mouse is released, the graph is translated so that the picked Vertex is moved to the center of the view. This translation is conducted in an animation Thread so that the graph slides to its new position
    Author:
    Tom Nelson
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void mouseClicked​(java.awt.event.MouseEvent e)  
      void mouseDragged​(java.awt.event.MouseEvent arg0)  
      void mouseEntered​(java.awt.event.MouseEvent e)
      show a special cursor while the mouse is inside the window
      void mouseExited​(java.awt.event.MouseEvent e)
      revert to the default cursor when the mouse leaves this window
      void mouseMoved​(java.awt.event.MouseEvent e)  
      void mousePressed​(java.awt.event.MouseEvent e)
      If the event occurs on a Vertex, pick that single Vertex
      void mouseReleased​(java.awt.event.MouseEvent e)
      If a Vertex was picked in the mousePressed event, start a Thread to animate the translation of the graph so that the picked Vertex moves to the center of the view
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • vertex

        protected V vertex
        the picked Vertex
    • Constructor Detail

      • AnimatedPickingGraphMousePlugin

        public AnimatedPickingGraphMousePlugin()
        Creates an instance with default modifiers of BUTTON1_MASK and CTRL_MASK
      • AnimatedPickingGraphMousePlugin

        public AnimatedPickingGraphMousePlugin​(int selectionModifiers)
        Creates an instance with the specified mouse event modifiers.
        Parameters:
        selectionModifiers - the mouse event modifiers to use.
    • Method Detail

      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent e)
        If the event occurs on a Vertex, pick that single Vertex
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
        Parameters:
        e - the event
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent e)
        If a Vertex was picked in the mousePressed event, start a Thread to animate the translation of the graph so that the picked Vertex moves to the center of the view
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
        Parameters:
        e - the event
      • 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)
        show a special cursor while the mouse is inside the window
        Specified by:
        mouseEntered in interface java.awt.event.MouseListener
      • mouseExited

        public void mouseExited​(java.awt.event.MouseEvent e)
        revert to the default cursor when the mouse leaves this window
        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
      • mouseDragged

        public void mouseDragged​(java.awt.event.MouseEvent arg0)
        Specified by:
        mouseDragged in interface java.awt.event.MouseMotionListener