Package com.starpoints.event
Class MouseEvent
- java.lang.Object
-
- com.starpoints.event.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
-
-
-
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
-
-
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 modifieryp
- 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.
-
-