Package nz.ac.waikato.cms.gui.core
Class MouseUtils
java.lang.Object
nz.ac.waikato.cms.gui.core.MouseUtils
Helper class for mouse events.
- Version:
- $Revision: 14478 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks whether no modified key is pressed.static booleanChecks whether the mouse event is a double-click event (with the left mouse button).static booleanChecks whether the mouse event is a left-click event.static booleanChecks whether the mouse event is a middle/wheel-click event.static booleanChecks whether the mouse event is a "print screen" event: Alt+Shift+Left-Click.static booleanChecks whether the mouse event is a right-click event.static voidsetDefaultCursor(Component comp) Sets the default cursor for the specified component.static voidsetWaitCursor(Component comp) Sets the wait cursor for the specified component.
-
Constructor Details
-
MouseUtils
public MouseUtils()
-
-
Method Details
-
isLeftClick
Checks whether the mouse event is a left-click event. Ctrl/Alt/Shift are allowed.- Parameters:
e- the event- Returns:
- true if a left-click event
-
isDoubleClick
Checks whether the mouse event is a double-click event (with the left mouse button). Ctrl/Alt/Shift are allowed.- Parameters:
e- the event- Returns:
- true if a double-click event
-
isMiddleClick
Checks whether the mouse event is a middle/wheel-click event. Ctrl/Alt/Shift are allowed.- Parameters:
e- the event- Returns:
- true if a middle/wheel-click event
-
isRightClick
Checks whether the mouse event is a right-click event. Alt+Left-Click is also interpreted as right-click.- Parameters:
e- the event- Returns:
- true if a right-click event
-
isPrintScreenClick
Checks whether the mouse event is a "print screen" event: Alt+Shift+Left-Click.- Parameters:
e- the event- Returns:
- true if a "print screen" event
-
hasNoModifierKey
Checks whether no modified key is pressed.- Parameters:
e- the event- Returns:
- true if no modifier key pressed
-
setWaitCursor
Sets the wait cursor for the specified component.- Parameters:
comp- the component to update
-
setDefaultCursor
Sets the default cursor for the specified component.- Parameters:
comp- the component to update
-