Package megamek.client.event
Class BoardViewEvent
java.lang.Object
java.util.EventObject
megamek.client.event.BoardViewEvent
- All Implemented Interfaces:
Serializable
Instances of this class are sent as a result of changes in BoardView
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intThis event type is sent when the mouse button is released (BOARD_HEX_DRAGGED is sent when the button is pressed)static final intstatic final intstatic final intThis event type is sent when the mouse button is pressed (BOARD_HEX_CLICKED is sent when the button is released)static final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionBoardViewEvent(BoardView source, int type) BoardViewEvent(BoardView source, int type, int entityId) BoardViewEvent(BoardView source, Coords coords, int type, int modifiers) BoardViewEvent(BoardView source, Coords coords, int type, int modifiers, int mouseButton) -
Method Summary
Modifier and TypeMethodDescriptionintReturns this event's position as a board location with board ID.intintintReturns the type of event that this isintgetType()Returns the type of event that this isbooleanbooleanbooleanMethods inherited from class java.util.EventObject
getSource, toString
-
Field Details
-
BOARD_HEX_CLICKED
public static final int BOARD_HEX_CLICKEDThis event type is sent when the mouse button is released (BOARD_HEX_DRAGGED is sent when the button is pressed)- See Also:
-
BOARD_HEX_DOUBLE_CLICKED
public static final int BOARD_HEX_DOUBLE_CLICKED- See Also:
-
BOARD_HEX_DRAGGED
public static final int BOARD_HEX_DRAGGEDThis event type is sent when the mouse button is pressed (BOARD_HEX_CLICKED is sent when the button is released)- See Also:
-
BOARD_HEX_CURSOR
public static final int BOARD_HEX_CURSOR- See Also:
-
BOARD_HEX_HIGHLIGHTED
public static final int BOARD_HEX_HIGHLIGHTED- See Also:
-
BOARD_HEX_SELECTED
public static final int BOARD_HEX_SELECTED- See Also:
-
BOARD_FIRST_LOS_HEX
public static final int BOARD_FIRST_LOS_HEX- See Also:
-
BOARD_SECOND_LOS_HEX
public static final int BOARD_SECOND_LOS_HEX- See Also:
-
FINISHED_MOVING_UNITS
public static final int FINISHED_MOVING_UNITS- See Also:
-
SELECT_UNIT
public static final int SELECT_UNIT- See Also:
-
BOARD_HEX_POPUP
public static final int BOARD_HEX_POPUP- See Also:
-
-
Constructor Details
-
BoardViewEvent
-
BoardViewEvent
-
BoardViewEvent
-
BoardViewEvent
-
-
Method Details
-
getType
public int getType()Returns the type of event that this is -
getModifiers
public int getModifiers()Returns the type of event that this is -
getCoords
- Returns:
- the coordinate where this event occurred, if applicable; null otherwise.
-
getEntityId
public int getEntityId()- Returns:
- the entity ID associated with this event, if applicable; 0 otherwise.
-
getButton
public int getButton()- Returns:
- the id of the mouse button associated with this event if any.
- 0 no button
- 1 Button 1
- 2 Button 2
- 3 Button 3
- 4 Button greater than 3
- 5 Button greater than 3
-
getBoardLocation
Returns this event's position as a board location with board ID. If this event has no coords (depending on its type or the coords are null for some other reason, the returned Optional is empty.- Returns:
- This event's location
-
getBoardView
-
getBoardId
public int getBoardId() -
isShiftHeld
public boolean isShiftHeld() -
isAltHeld
public boolean isAltHeld() -
isCtrlHeld
public boolean isCtrlHeld()
-