Package org.opentrafficsim.draw.graphs
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-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2015-07-26 01:01:13 +0200 (Sun, 26 Jul 2015) $, @version $Revision: 1155 $, by $Author: averbraeck $,
initial version Aug 13, 2014
- Author:
- Peter Knoppers
-
Constructor Summary
Constructors Constructor Description PointerHandler() -
Method Summary
Modifier and Type Method Description voidmouseClicked(MouseEvent e)voidmouseDragged(MouseEvent e)voidmouseEntered(MouseEvent e)voidmouseExited(MouseEvent mouseEvent)voidmouseMoved(MouseEvent mouseEvent)voidmousePressed(MouseEvent e)voidmouseReleased(MouseEvent e)abstract voidupdateHint(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:
mouseDraggedin interfaceMouseMotionListener
-
mouseMoved
- Specified by:
mouseMovedin 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:
mouseClickedin interfaceMouseListener
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-