Class NativeMouseEvent

    • Field Detail

      • NATIVE_MOUSE_FIRST

        public static final int NATIVE_MOUSE_FIRST
        The first number in the range of id's used for native mouse events.
        See Also:
        Constant Field Values
      • NATIVE_MOUSE_LAST

        public static final int NATIVE_MOUSE_LAST
        The last number in the range of id's used for native mouse events.
        See Also:
        Constant Field Values
      • NATIVE_MOUSE_CLICKED

        public static final int NATIVE_MOUSE_CLICKED
        The native mouse pressed event. This NativeMouseEvent occurs when a mouse button is pressed and released.
        See Also:
        Constant Field Values
      • NATIVE_MOUSE_PRESSED

        public static final int NATIVE_MOUSE_PRESSED
        The native mouse pressed event. This NativeMouseEvent occurs when a mouse button is depressed.
        See Also:
        Constant Field Values
      • NATIVE_MOUSE_RELEASED

        public static final int NATIVE_MOUSE_RELEASED
        The native mouse released event. This NativeMouseEvent occurs when a mouse button is released.
        See Also:
        Constant Field Values
      • NATIVE_MOUSE_MOVED

        public static final int NATIVE_MOUSE_MOVED
        The native mouse moved event. This NativeMouseEvent occurs when the mouse pointer changes position.
        See Also:
        Constant Field Values
      • NATIVE_MOUSE_DRAGGED

        public static final int NATIVE_MOUSE_DRAGGED
        The native mouse dragged event. This NativeMouseEvent occurs when the mouse pointer changes position while a mouse button is pressed.
        See Also:
        Constant Field Values
      • NATIVE_MOUSE_WHEEL

        public static final int NATIVE_MOUSE_WHEEL
        The native mouse dragged event. This NativeMouseEvent occurs when the mouse wheel is rotated.
        See Also:
        Constant Field Values
      • NOBUTTON

        public static final int NOBUTTON
        Indicates no mouse buttons; used by getButton().
        See Also:
        Constant Field Values
      • BUTTON1

        public static final int BUTTON1
        Indicates mouse button #1; used by getButton().
        See Also:
        Constant Field Values
      • BUTTON2

        public static final int BUTTON2
        Indicates mouse button #2; used by getButton().
        See Also:
        Constant Field Values
      • BUTTON3

        public static final int BUTTON3
        Indicates mouse button #3; used by getButton().
        See Also:
        Constant Field Values
      • BUTTON4

        public static final int BUTTON4
        Indicates mouse button #4; used by getButton().
        See Also:
        Constant Field Values
      • BUTTON5

        public static final int BUTTON5
        Indicates mouse button #5; used by getButton().
        See Also:
        Constant Field Values
    • Constructor Detail

      • NativeMouseEvent

        public NativeMouseEvent​(int id,
                                int modifiers,
                                int x,
                                int y,
                                int clickCount)
        Instantiates a new NativeMouseEvent object.
        Parameters:
        id - an integer that identifies the native event type.
        modifiers - a modifier mask describing the modifier keys and mouse buttons active for the event. NativeInputEvent _MASK modifiers should be used as they are not compatible with the extended _DOWN_MASK or the old _MASK InputEvent modifiers.
        x - the x coordinate of the native pointer.
        y - the y coordinate of the native pointer.
        clickCount - the number of button clicks associated with this event.
        Since:
        1.1
      • NativeMouseEvent

        public NativeMouseEvent​(int id,
                                int modifiers,
                                int x,
                                int y,
                                int clickCount,
                                int button)
        Instantiates a new NativeMouseEvent object.
        Parameters:
        id - an integer that identifies the native event type.
        modifiers - a modifier mask describing the modifier keys and mouse buttons active for the event. NativeInputEvent _MASK modifiers should be used as they are not compatible with the extended _DOWN_MASK or the old _MASK InputEvent modifiers.
        x - the x coordinate of the native pointer.
        y - the y coordinate of the native pointer.
        clickCount - the number of button clicks associated with this event.
        button - The mouse buttons that have changed state. NOBUTTON, BUTTON1, BUTTON2, BUTTON3, BUTTON5 or BUTTON5.
        Since:
        1.1
    • Method Detail

      • getButton

        public int getButton()
        Returns which, if any, of the mouse buttons has changed state.
        Returns:
        one of the following constants: NOBUTTON, BUTTON1, BUTTON2, BUTTON3, BUTTON4 or BUTTON5
      • getClickCount

        public int getClickCount()
        Returns the number of button clicks associated with this event.
        Returns:
        An integer indicating the number of button clicks
        Since:
        1.1
      • getPoint

        public Point getPoint()
        Returns the x,y position of the native event.
        Returns:
        a Point object containing the x and y coordinates of the native pointer
        Since:
        1.1
      • getX

        public int getX()
        Returns the x coordinate of the native event.
        Returns:
        x an integer indicating horizontal position of the native pointer
      • getY

        public int getY()
        Returns the y coordinate of the native event.
        Returns:
        y an integer indicating horizontal position of the native pointer
      • paramString

        public String paramString()
        Returns a parameter string identifying the native event. This method is useful for event-logging and debugging.
        Overrides:
        paramString in class NativeInputEvent
        Returns:
        a string identifying the native event and its attributes.