org.fest.swing.core
Enum MouseButton
java.lang.Object
java.lang.Enum<MouseButton>
org.fest.swing.core.MouseButton
- All Implemented Interfaces:
- Serializable, Comparable<MouseButton>
public enum MouseButton
- extends Enum<MouseButton>
Understands mouse buttons.
- Author:
- Alex Ruiz
Field Summary |
int |
mask
The mouse button modifier. |
Method Summary |
static MouseButton |
lookup(int mask)
Returns the mouse button whose mask matches the given mask. |
static MouseButton |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static MouseButton[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared. |
LEFT_BUTTON
public static final MouseButton LEFT_BUTTON
MIDDLE_BUTTON
public static final MouseButton MIDDLE_BUTTON
RIGHT_BUTTON
public static final MouseButton RIGHT_BUTTON
mask
public final int mask
- The mouse button modifier.
- See Also:
InputEvent
values
public static MouseButton[] values()
- Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
for (MouseButton c : MouseButton.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they are declared
valueOf
public static MouseButton valueOf(String name)
- Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)
- Parameters:
name
- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is null
lookup
public static MouseButton lookup(int mask)
- Returns the mouse button whose mask matches the given mask. Valid values are
InputEvent.BUTTON1_MASK
, InputEvent.BUTTON2_MASK
, and
InputEvent.BUTTON3_MASK
- Parameters:
mask
- the mask of the button we are looking for.
- Returns:
- the found button.
- Throws:
IllegalArgumentException
- if the given mask is not a valid one.
Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.