|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbb.gui.MouseUtil
public class MouseUtil
This class provides static utility methods that deal with MouseEvents.
Like typical Java GUI code, this class is not multithread safe:
it expects to only be called by EventQueue
's dispatch thread
.
This threading limitation is checked in every public method.
Constructor Summary | |
---|---|
private |
MouseUtil()
This sole private constructor suppresses the default (public) constructor, ensuring non-instantiability outside of this class. |
Method Summary | |
---|---|
static boolean |
isDoubleClick(MouseEvent me)
Determines whether the MouseEvent represents a double click. |
static boolean |
isLeftMouseButtonClick(MouseEvent me)
Determines whether the MouseEvent represents a click of the leftmost mouse button (buttion #1). |
static boolean |
isMiddleMouseButtonClick(MouseEvent me)
Determines whether the MouseEvent represents a click of the middle mouse button (buttion #2). |
static boolean |
isRightMouseButtonClick(MouseEvent me)
Determines whether the MouseEvent represents a click of the rightmost mouse button (buttion #3). |
static boolean |
isSingleClick(MouseEvent me)
Determines whether the MouseEvent represents a single click. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
private MouseUtil()
Method Detail |
---|
public static boolean isLeftMouseButtonClick(MouseEvent me) throws IllegalStateException
MouseEvent
represents a click of the leftmost mouse button (buttion #1).
IllegalStateException
- if calling thread is not EventQueue
's dispatch thread
public static boolean isMiddleMouseButtonClick(MouseEvent me) throws IllegalStateException
MouseEvent
represents a click of the middle mouse button (buttion #2).
IllegalStateException
- if calling thread is not EventQueue
's dispatch thread
public static boolean isRightMouseButtonClick(MouseEvent me) throws IllegalStateException
MouseEvent
represents a click of the rightmost mouse button (buttion #3).
IllegalStateException
- if calling thread is not EventQueue
's dispatch thread
public static boolean isSingleClick(MouseEvent me) throws IllegalStateException
MouseEvent
represents a single click.
IllegalStateException
- if calling thread is not EventQueue
's dispatch thread
public static boolean isDoubleClick(MouseEvent me) throws IllegalStateException
MouseEvent
represents a double click.
IllegalStateException
- if calling thread is not EventQueue
's dispatch thread
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |