Enum Class MouseButton

java.lang.Object
java.lang.Enum<MouseButton>
org.fest.swing.core.MouseButton
All Implemented Interfaces:
Serializable, Comparable<MouseButton>, Constable

public enum MouseButton extends Enum<MouseButton>
Understands mouse buttons.
  • Enum Constant Details

    • LEFT_BUTTON

      public static final MouseButton LEFT_BUTTON
    • MIDDLE_BUTTON

      public static final MouseButton MIDDLE_BUTTON
    • RIGHT_BUTTON

      public static final MouseButton RIGHT_BUTTON
  • Field Details

    • mask

      public final int mask
      The mouse button modifier.
      See Also:
  • Constructor Details

    • MouseButton

      private MouseButton(int mask)
  • Method Details

    • values

      public static MouseButton[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MouseButton valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class 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.