Class TranslatingGraphMousePlugin

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

    public class TranslatingGraphMousePlugin
    extends AbstractGraphMousePlugin
    implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener
    TranslatingGraphMousePlugin uses a MouseButtonOne press and drag gesture to translate the graph display in the x and y direction. The default MouseButtonOne modifier can be overridden to cause a different mouse gesture to translate the display.
    • Constructor Detail

      • TranslatingGraphMousePlugin

        public TranslatingGraphMousePlugin()
      • TranslatingGraphMousePlugin

        public TranslatingGraphMousePlugin​(int modifiers)
        create an instance with passed modifer value
        Parameters:
        modifiers - the mouse event modifier to activate this function
    • Method Detail

      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent e)
        Check the event modifiers. Set the 'down' point for later use. If this event satisfies the modifiers, change the cursor to the system 'move cursor'
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
        Parameters:
        e - the event
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent e)
        unset the 'down' point and change the cursoe back to the system default cursor
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
      • mouseDragged

        public void mouseDragged​(java.awt.event.MouseEvent e)
        chack the modifiers. If accepted, translate the graph according to the dragging of the mouse pointer
        Specified by:
        mouseDragged in interface java.awt.event.MouseMotionListener
        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)
        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