Class MouseClickInput

java.lang.Object
com.globalmentor.model.AbstractHashObject
All Implemented Interfaces:
GestureInput, Input, MouseInput

public class MouseClickInput extends AbstractMouseInput
An encapsulation of mouse click input.
Author:
Garret Wilson
  • Constructor Details

    • MouseClickInput

      public MouseClickInput(MouseButton button, int count, Key... keys)
      Button and keys constructor.
      Parameters:
      button - The button that was clicked.
      count - The number of clicks that were input (e.g. 1 for a single click, 2 for a double click, etc.).
      keys - The keys that were pressed when this input occurred.
      Throws:
      NullPointerException - if the given button and/or keys is null.
      IllegalArgumentException - if the given count is zero or less.
  • Method Details

    • getButton

      public MouseButton getButton()
      Returns:
      The button that was clicked.
    • getCount

      public int getCount()
      Returns:
      The number of clicks that were input (e.g. 1 for a single click, 2 for a double click, etc.).
    • hashCode

      public int hashCode()

      This version extends the hash code of the underlying objects with the the button and count.

      Overrides:
      hashCode in class com.globalmentor.model.AbstractHashObject
    • equals

      public boolean equals(Object object)

      Besides the default checks, this version ensures that the buttons are equal.

      Overrides:
      equals in class com.globalmentor.model.AbstractHashObject
    • toString

      public String toString()
      Overrides:
      toString in class com.globalmentor.model.AbstractHashObject