Class MouseEvent


  • public class MouseEvent
    extends java.lang.Object
    Platform independent Mouse event. Mouse click- and move-events from the application must be passed to the StarpointController as com.starpoints.event.MouseEvent. Touchscreen tips should be handled as mouse click events.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int BUTTON1_MASK
      Modifier constant for Button 1.
      static int BUTTON2_MASK
      Modifier constant for Button 2.
    • Constructor Summary

      Constructors 
      Constructor Description
      MouseEvent​(int x, int y, int modifiers)
      Creates a new MouseEvent.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      MouseEvent copy()
      Creates a copy of this event.
      int getModifier()
      Gets the modifier.
      int getX()
      Gets the x coordinate.
      int getY()
      Gets the y coordinate.
      void translatePoint​(int xp, int yp)
      Modifies this Events coordinates.
      MouseEvent translatePoint​(Rectangle area, double xFactor, double yFactor)
      Returns a new MouseEvent modified by the offset of the area and the given factors
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • BUTTON1_MASK

        public static final int BUTTON1_MASK
        Modifier constant for Button 1.
        See Also:
        Constant Field Values
      • BUTTON2_MASK

        public static final int BUTTON2_MASK
        Modifier constant for Button 2.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MouseEvent

        public MouseEvent​(int x,
                          int y,
                          int modifiers)
        Creates a new MouseEvent.
        Parameters:
        x - The x coordinate.
        y - The y coordinate.
        modifiers - The modifier.
    • Method Detail

      • getModifier

        public int getModifier()
        Gets the modifier.
        Returns:
        Mouse Mask.
      • getX

        public int getX()
        Gets the x coordinate.
        Returns:
        The x coordinate.
      • getY

        public int getY()
        Gets the y coordinate.
        Returns:
        the y
      • translatePoint

        public void translatePoint​(int xp,
                                   int yp)
        Modifies this Events coordinates.
        Parameters:
        xp - x modifier
        yp - y modifier.
      • copy

        public MouseEvent copy()
        Creates a copy of this event.
        Returns:
        A copy.
      • translatePoint

        public MouseEvent translatePoint​(Rectangle area,
                                         double xFactor,
                                         double yFactor)
        Returns a new MouseEvent modified by the offset of the area and the given factors
        Parameters:
        area - The area.
        xFactor - The x scaling factor.
        yFactor - The y scaling factor.
        Returns:
        The modified MouseEvent.