Class PointerHandler

java.lang.Object
org.opentrafficsim.draw.graphs.PointerHandler
All Implemented Interfaces:
MouseListener, MouseMotionListener, EventListener

public abstract class PointerHandler extends Object implements MouseListener, MouseMotionListener
Handle mouse events for a graph.

Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
Peter Knoppers
  • Constructor Details

    • PointerHandler

      public PointerHandler()
  • Method Details

    • mouseDragged

      public void mouseDragged(MouseEvent e)
      Specified by:
      mouseDragged in interface MouseMotionListener
    • mouseMoved

      public void mouseMoved(MouseEvent mouseEvent)
      Specified by:
      mouseMoved in interface MouseMotionListener
    • updateHint

      public abstract void updateHint(double domainValue, double rangeValue)
      Called when the pointer is positioned inside the data area of the graph, or when it leaves the data area.
      When the mouse is outside the data area both parameters are set to Double.NaN.
      Parameters:
      domainValue - double; the X-value (in domain units), or Double.NaN if the pointer is outside the data area
      rangeValue - double; the Y-value (in domain units), or Double.NaN if the pointer is outside the data area
    • mouseClicked

      public void mouseClicked(MouseEvent e)
      Specified by:
      mouseClicked in interface MouseListener
    • mousePressed

      public void mousePressed(MouseEvent e)
      Specified by:
      mousePressed in interface MouseListener
    • mouseReleased

      public void mouseReleased(MouseEvent e)
      Specified by:
      mouseReleased in interface MouseListener
    • mouseEntered

      public void mouseEntered(MouseEvent e)
      Specified by:
      mouseEntered in interface MouseListener
    • mouseExited

      public void mouseExited(MouseEvent mouseEvent)
      Specified by:
      mouseExited in interface MouseListener