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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanCheck if the control key was down during the mouse event.protected booleanCheck if the shift key was down during the mouse event.voidJava's official mouseClick handler; we don't use this because it doesn't register clicks while the mouse is moving at all.voidvoidvoidvoidmouseMoved(MouseEvent arg0)voidvoidprotected abstract voidonDragStart(Point point)Called when mouse dragging starts.protected abstract booleanonMouseClick(Point point)Called on left mouse single click.protected abstract booleanonMouseDoubleClick(Point point)Called on left double click.protected abstract voidonMouseRightClick(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:
trueif the click was handled
-
onMouseDoubleClick
Called on left double click.- Parameters:
point- location- Returns:
trueif 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:
mouseClickedin interfaceMouseListener- Parameters:
e-
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
isCtrlDown
protected boolean isCtrlDown()Check if the control key was down during the mouse event.- Returns:
trueif the control key was down
-
isShiftDown
protected boolean isShiftDown()Check if the shift key was down during the mouse event.- Returns:
trueif the shift key was down
-