Class BoardViewEvent

java.lang.Object
java.util.EventObject
megamek.client.event.BoardViewEvent
All Implemented Interfaces:
Serializable

public class BoardViewEvent extends EventObject
Instances of this class are sent as a result of changes in BoardView
See Also:
  • Field Details

    • BOARD_HEX_CLICKED

      public static final int BOARD_HEX_CLICKED
      This 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_DRAGGED
      This 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

      public BoardViewEvent(BoardView source, Coords coords, int type, int modifiers)
    • BoardViewEvent

      public BoardViewEvent(BoardView source, int type)
    • BoardViewEvent

      public BoardViewEvent(BoardView source, int type, int entityId)
    • BoardViewEvent

      public BoardViewEvent(BoardView source, Coords coords, int type, int modifiers, int mouseButton)
  • 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

      public Coords 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

      public BoardLocation 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

      public BoardView getBoardView()
    • getBoardId

      public int getBoardId()
    • isShiftHeld

      public boolean isShiftHeld()
    • isAltHeld

      public boolean isAltHeld()
    • isCtrlHeld

      public boolean isCtrlHeld()