Package jexer.event

Class TMouseEvent


  • public class TMouseEvent
    extends TInputEvent
    This class encapsulates several kinds of mouse input events. Note that the relative (x,y) ARE MUTABLE: TWidget's onMouse() handlers perform that update during event dispatching.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  TMouseEvent.Type
      The type of event generated.
    • Constructor Summary

      Constructors 
      Constructor Description
      TMouseEvent​(Backend backend, TMouseEvent.Type type, int x, int y, int absoluteX, int absoluteY, boolean mouse1, boolean mouse2, boolean mouse3, boolean mouseWheelUp, boolean mouseWheelDown, boolean alt, boolean ctrl, boolean shift)
      Public contructor.
    • Constructor Detail

      • TMouseEvent

        public TMouseEvent​(Backend backend,
                           TMouseEvent.Type type,
                           int x,
                           int y,
                           int absoluteX,
                           int absoluteY,
                           boolean mouse1,
                           boolean mouse2,
                           boolean mouse3,
                           boolean mouseWheelUp,
                           boolean mouseWheelDown,
                           boolean alt,
                           boolean ctrl,
                           boolean shift)
        Public contructor.
        Parameters:
        backend - the backend that generated this event
        type - the type of event, MOUSE_MOTION, MOUSE_DOWN, or MOUSE_UP
        x - relative column
        y - relative row
        absoluteX - absolute column
        absoluteY - absolute row
        mouse1 - if true, left button is down
        mouse2 - if true, right button is down
        mouse3 - if true, middle button is down
        mouseWheelUp - if true, mouse wheel (button 4) is down
        mouseWheelDown - if true, mouse wheel (button 5) is down
        alt - if true, ALT was pressed with this mouse event
        ctrl - if true, CTRL was pressed with this mouse event
        shift - if true, SHIFT was pressed with this mouse event
    • Method Detail

      • getX

        public int getX()
        Get x.
        Returns:
        x
      • getY

        public int getY()
        Get y.
        Returns:
        y
      • getAbsoluteX

        public int getAbsoluteX()
        Get absoluteX.
        Returns:
        absoluteX
      • setAbsoluteX

        public void setAbsoluteX​(int absoluteX)
        Set absoluteX.
        Parameters:
        absoluteX - the new value
      • getAbsoluteY

        public int getAbsoluteY()
        Get absoluteY.
        Returns:
        absoluteY
      • setAbsoluteY

        public void setAbsoluteY​(int absoluteY)
        Set absoluteY.
        Parameters:
        absoluteY - the new value
      • isMouse1

        public boolean isMouse1()
        Get mouse1.
        Returns:
        mouse1
      • isMouse2

        public boolean isMouse2()
        Get mouse2.
        Returns:
        mouse2
      • isMouse3

        public boolean isMouse3()
        Get mouse3.
        Returns:
        mouse3
      • isMouseWheelUp

        public boolean isMouseWheelUp()
        Get mouseWheelUp.
        Returns:
        mouseWheelUp
      • isMouseWheelDown

        public boolean isMouseWheelDown()
        Get mouseWheelDown.
        Returns:
        mouseWheelDown
      • isAlt

        public boolean isAlt()
        Getter for ALT.
        Returns:
        alt value
      • isCtrl

        public boolean isCtrl()
        Getter for CTRL.
        Returns:
        ctrl value
      • isShift

        public boolean isShift()
        Getter for SHIFT.
        Returns:
        shift value
      • dup

        public TMouseEvent dup()
        Create a duplicate instance.
        Returns:
        duplicate intance
      • toString

        public java.lang.String toString()
        Make human-readable description of this TMouseEvent.
        Overrides:
        toString in class java.lang.Object
        Returns:
        displayable String