Class ContourPlot.CoordSysPanning

  • All Implemented Interfaces:
    ContourPlot.InteractionConstants, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.util.EventListener
    Enclosing class:
    ContourPlot

    public class ContourPlot.CoordSysPanning
    extends java.awt.event.MouseAdapter
    implements ContourPlot.InteractionConstants
    The CoordSysPanning class implements a MouseListener and MouseMotionListener that realize panning functionality for the coordinate view of the ContourPlot.CoordSysRenderer. When registering this with an ContourPlot.JPlotterCanvas and CoordSysRenderer dragging with the left mouse button over the Canvas while holding down CTRL will set the coordinate view accordingly.

    Intended use: CoordSysPanning pan = new CoordSysPanning(canvas, coordsys).register();

    Per default the extended modifier mask for a dragging mouse event to trigger panning is InputEvent.CTRL_DOWN_MASK. If this is undesired the extModifierMask has to be overridden.
    For example to not need to press any key:

    new CoordSysPanning(canvas){{extModifierMask=0;}}.register();
    Author:
    hageldave
    • Field Detail

      • startPoint

        protected java.awt.Point startPoint
      • canvas

        protected java.awt.Component canvas
      • extModifierMask

        protected int extModifierMask
      • axes

        protected int axes
    • Method Detail

      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent e)
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
        Overrides:
        mousePressed in class java.awt.event.MouseAdapter
      • mouseDragged

        public void mouseDragged​(java.awt.event.MouseEvent e)
        Specified by:
        mouseDragged in interface java.awt.event.MouseMotionListener
        Overrides:
        mouseDragged in class java.awt.event.MouseAdapter
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent e)
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
        Overrides:
        mouseReleased in class java.awt.event.MouseAdapter
      • isTriggerMouseEvent

        protected boolean isTriggerMouseEvent​(java.awt.event.MouseEvent e,
                                              int method)