Package org.opentrafficsim.draw.graphs
Class PointerHandler
java.lang.Object
org.opentrafficsim.draw.graphs.PointerHandler
- All Implemented Interfaces:
MouseListener
,MouseMotionListener
,EventListener
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
void
mouseExited
(MouseEvent mouseEvent) void
mouseMoved
(MouseEvent mouseEvent) void
void
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.
-
Constructor Details
-
PointerHandler
public PointerHandler()
-
-
Method Details
-
mouseDragged
- Specified by:
mouseDragged
in interfaceMouseMotionListener
-
mouseMoved
- Specified by:
mouseMoved
in interfaceMouseMotionListener
-
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 arearangeValue
- double; the Y-value (in domain units), or Double.NaN if the pointer is outside the data area
-
mouseClicked
- Specified by:
mouseClicked
in interfaceMouseListener
-
mousePressed
- Specified by:
mousePressed
in interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleased
in interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEntered
in interfaceMouseListener
-
mouseExited
- Specified by:
mouseExited
in interfaceMouseListener
-