Package games.stendhal.client.gui
Class MouseHandler
java.lang.Object
games.stendhal.client.gui.MouseHandler
- All Implemented Interfaces:
MouseListener
,MouseMotionListener
,EventListener
- Direct Known Subclasses:
GroundContainerMouseState
Sane mouse handling for components that want to implement drag and drop or
pass mouse events to EntityViews.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Check if the control key was down during the mouse event.protected boolean
Check if the shift key was down during the mouse event.void
Java's official mouseClick handler; we don't use this because it doesn't register clicks while the mouse is moving at all.void
void
void
void
mouseMoved(MouseEvent arg0)
void
void
protected abstract void
onDragStart(Point point)
Called when mouse dragging starts.protected abstract boolean
onMouseClick(Point point)
Called on left mouse single click.protected abstract boolean
onMouseDoubleClick(Point point)
Called on left double click.protected abstract void
onMouseRightClick(Point point)
Called on right mouse single click.
-
Constructor Details
-
MouseHandler
public MouseHandler()
-
-
Method Details
-
onMouseClick
Called on left mouse single click.- Parameters:
point
- location- Returns:
true
if the click was handled
-
onMouseDoubleClick
Called on left double click.- Parameters:
point
- location- Returns:
true
if the click was handled
-
onMouseRightClick
Called on right mouse single click.- Parameters:
point
- location
-
onDragStart
Called when mouse dragging starts.- Parameters:
point
- location
-
mouseClicked
Java's official mouseClick handler; we don't use this because it doesn't register clicks while the mouse is moving at all.- Specified by:
mouseClicked
in interfaceMouseListener
- Parameters:
e
-
-
mouseEntered
- Specified by:
mouseEntered
in interfaceMouseListener
-
mouseExited
- Specified by:
mouseExited
in interfaceMouseListener
-
mousePressed
- Specified by:
mousePressed
in interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleased
in interfaceMouseListener
-
mouseDragged
- Specified by:
mouseDragged
in interfaceMouseMotionListener
-
mouseMoved
- Specified by:
mouseMoved
in interfaceMouseMotionListener
-
isCtrlDown
protected boolean isCtrlDown()Check if the control key was down during the mouse event.- Returns:
true
if the control key was down
-
isShiftDown
protected boolean isShiftDown()Check if the shift key was down during the mouse event.- Returns:
true
if the shift key was down
-