Class MouseClickInfo

java.lang.Object
org.fest.swing.core.MouseClickInfo

public final class MouseClickInfo extends Object
Understands information about clicking a mouse button.

Examples:

Specify that the right button should be clicked once:

 // import static org.fest.swing.fixture.MouseClickInfo.*;
 MouseClickInfo i = rightButton();
 

Specify that the left button should be clicked two times (similar to double-click):

 // import static org.fest.swing.fixture.MouseClickInfo.*;
 MouseClickInfo i = leftButton().times(2);
 

  • Field Details

    • button

      private final MouseButton button
    • times

      private int times
  • Constructor Details

    • MouseClickInfo

      private MouseClickInfo(MouseButton button, int times)
  • Method Details

    • leftButton

      public static MouseClickInfo leftButton()
      Specifies that the left button should be clicked once.
      Returns:
      the created click info.
    • middleButton

      public static MouseClickInfo middleButton()
      Specifies that the middle button should be clicked once.
      Returns:
      the created click info.
    • rightButton

      public static MouseClickInfo rightButton()
      Specifies that the right button should be clicked once.
      Returns:
      the created click info.
    • button

      public static MouseClickInfo button(MouseButton button)
      Specifies that the given button should be clicked once.
      Parameters:
      button - the mouse button to click.
      Returns:
      the created click info.
      Throws:
      NullPointerException - if button is null.
    • button

      public MouseButton button()
      Returns the button to click.
      Returns:
      the button to click.
    • times

      public int times()
      Returns how many times the mouse button should be clicked.
      Returns:
      how many times the mouse button should be clicked.
    • times

      public MouseClickInfo times(int newTimes)
      Specifies how many times the mouse button should be clicked.
      Parameters:
      newTimes - the specified number of times to click the mouse button.
      Returns:
      this object.
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also: