Class MouseEvent<T extends AbstractMouseDestination>

  • All Implemented Interfaces:
    java.lang.Runnable

    public class MouseEvent<T extends AbstractMouseDestination>
    extends AbstractMouseEvent
    Mouse event that handles the full movement and click process based on the fields you pass in. You can use whatever implementation of AbstractMouseDestination that you need. These examples use PointDestination Examples: To just move the mouse with no clicks, you would use
    
     MouseEvent<PointDestination> event = new MouseEvent<>(new PointDestination(100, 300), MouseMode.NONE, MouseButton.NULL);
     event.run();
     
    In order to drag with the left mouse button you'd use:
    
     MouseEvent<PointDestination> event = new MouseEvent<>(new PointDestination(100, 300), MouseMode.DRAG, MouseButton.LEFT_CLICK);
     event.run();
     
    The middle mouse button is the same but with MouseButton.MIDDLE_CLICK In order to click at your current position you can either use new PointDestination(Mouse.getPosition()) or you can pass in a null destination. This example will call MouseAlgorithm.handleClick(MouseButton) with the supplied mouse button (left click in this case)
    
     MouseEvent<PointDestination> event = new MouseEvent<>(null, MouseMode.FULL_CLICK, MouseButton.LEFT_CLICK);
     event.run();
     
    • Method Detail

      • isCompleted

        public boolean isCompleted()
      • isFailed

        public boolean isFailed()
      • getDestination

        public T getDestination()
      • getMouseMode

        public MouseMode getMouseMode()
      • getWheelMode

        public WheelMode getWheelMode()
      • getWheelCondition

        public Condition getWheelCondition()
      • getTimeout

        public long getTimeout()
      • setCompleted

        public void setCompleted​(boolean completed)
      • setFailed

        public void setFailed​(boolean failed)
      • setDestination

        public void setDestination​(T destination)
      • setMouseMode

        public void setMouseMode​(MouseMode mouseMode)
      • setMouseButton

        public void setMouseButton​(MouseButton mouseButton)
      • setWheelMode

        public void setWheelMode​(WheelMode wheelMode)
      • setWheelCondition

        public void setWheelCondition​(Condition wheelCondition)
      • setTimeout

        public void setTimeout​(long timeout)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object