Class PhysicalDisplay

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, BoardViewListener, KeyBindReceiver, GameListener, IPreferenceChangeListener, Distractable

public class PhysicalDisplay extends AttackPhaseDisplay
See Also:
  • Field Details

    • showTargetChoice

      protected boolean showTargetChoice
    • twisting

      protected boolean twisting
    • visibleTargets

      protected Entity[] visibleTargets
    • lastTargetID

      protected int lastTargetID
    • isStrafing

      protected boolean isStrafing
    • buttons

  • Constructor Details

    • PhysicalDisplay

      public PhysicalDisplay(ClientGUI clientgui)
      Creates and lays out a new movement phase display for the specified clientGUI.getClient().
  • Method Details

    • shouldPerformClearKeyCommand

      protected boolean shouldPerformClearKeyCommand()
    • getDoneButtonLabel

      protected String getDoneButtonLabel()
      Description copied from class: AttackPhaseDisplay
      called by updateDonePanel to populate the label text of the Done button. Usually wraps a call to Messages.getString(...Fire) but can be extended to add more details.
      Specified by:
      getDoneButtonLabel in class AttackPhaseDisplay
      Returns:
      text for label
    • getSkipTurnButtonLabel

      protected String getSkipTurnButtonLabel()
      Description copied from class: AttackPhaseDisplay
      called by updateDonePanel to populate the label text of the NoAction button. Usually wraps a call to Messages.getString(...Skip) but can be extended to add more details.
      Specified by:
      getSkipTurnButtonLabel in class AttackPhaseDisplay
      Returns:
      text for label
    • setButtons

      protected void setButtons()
      Description copied from class: StatusBarPhaseDisplay
      set button that should be displayed.
      Specified by:
      setButtons in class StatusBarPhaseDisplay
    • setButtonsTooltips

      protected void setButtonsTooltips()
      Description copied from class: StatusBarPhaseDisplay
      set button tool tips that should be displayed.
      Specified by:
      setButtonsTooltips in class StatusBarPhaseDisplay
    • getButtonList

      protected ArrayList<MegaMekButton> getButtonList()
      Description copied from class: StatusBarPhaseDisplay
      Returns the list of buttons that should be displayed.
      Specified by:
      getButtonList in class StatusBarPhaseDisplay
    • selectEntity

      public void selectEntity(int en)
      Selects an entity, by number, for movement.
    • ready

      public void ready()
      Description copied from class: AbstractPhaseDisplay
      Tells the display to finish the current player turn and send all planned actions to the server. Planned actions are e.g. movement, attacks or deployment. Usually, the planned actions are all actions that, together, make up a single unit's turn, e.g. all weapon attacks of one unit.
      Specified by:
      ready in class AbstractPhaseDisplay
    • clear

      public void clear()
      Clears all current actions
      Specified by:
      clear in class StatusBarPhaseDisplay
    • punch

      public void punch()
      Punch the target!
    • kick

      public void kick()
      Kick the target!
    • push

      public void push()
      Push that target!
    • trip

      public void trip()
      Trip that target!
    • doGrapple

      public void doGrapple()
      Grapple that target!
    • vibroclawAttack

      public void vibroclawAttack()
      slice 'em up with your vibroclaws
    • pheromoneAttack

      public void pheromoneAttack()
      Release pheromone gas to impair enemy conventional infantry (IO pg 79).
    • toxinAttack

      public void toxinAttack()
      Release toxin gas to damage enemy conventional infantry (IO pg 79).
    • jumpJetAttack

      public void jumpJetAttack()
    • club

      public void club(MiscMounted club)
      Club that target!
    • doBrush

      public void doBrush(Targetable brushTarget)
    • thrash

      public void thrash()
      Thrash at the target, unless the player cancels the action.
    • dodge

      public void dodge()
    • target

      public void target(Targetable t)
      Targets something
    • hexMoused

      public void hexMoused(BoardViewEvent event)
      Description copied from interface: BoardViewListener
      Sent when user clicks, double clicks or drags hex.
      Specified by:
      hexMoused in interface BoardViewListener
      Overrides:
      hexMoused in class AbstractPhaseDisplay
      Parameters:
      event - an event
    • hexSelected

      public void hexSelected(BoardViewEvent event)
      Description copied from interface: BoardViewListener
      Sent when Hex is selected through a call to the select method (this is not a mouse click event, although many mouse clicks lead to the hex being selected).
      Specified by:
      hexSelected in interface BoardViewListener
      Overrides:
      hexSelected in class AbstractPhaseDisplay
      Parameters:
      event - The select event
      See Also:
    • gameTurnChange

      public void gameTurnChange(GameTurnChangeEvent e)
      Specified by:
      gameTurnChange in interface GameListener
      Overrides:
      gameTurnChange in class AbstractPhaseDisplay
    • gamePhaseChange

      public void gamePhaseChange(GamePhaseChangeEvent e)
      Specified by:
      gamePhaseChange in interface GameListener
      Overrides:
      gamePhaseChange in class AbstractPhaseDisplay
    • actionPerformed

      public void actionPerformed(ActionEvent ev)
    • finishedMovingUnits

      public void finishedMovingUnits(BoardViewEvent b)
      Description copied from interface: BoardViewListener
      Sent when moving units is finished.
      Specified by:
      finishedMovingUnits in interface BoardViewListener
      Overrides:
      finishedMovingUnits in class AbstractPhaseDisplay
      Parameters:
      b - an event
    • unitSelected

      public void unitSelected(BoardViewEvent b)
      Description copied from interface: BoardViewListener
      Sent when Unit is selected.
      Specified by:
      unitSelected in interface BoardViewListener
      Overrides:
      unitSelected in class AbstractPhaseDisplay
      Parameters:
      b - an event
    • setThrashEnabled

      public void setThrashEnabled(boolean enabled)
    • setPunchEnabled

      public void setPunchEnabled(boolean enabled)
    • setKickEnabled

      public void setKickEnabled(boolean enabled)
    • setPushEnabled

      public void setPushEnabled(boolean enabled)
    • setTripEnabled

      public void setTripEnabled(boolean enabled)
    • setGrappleEnabled

      public void setGrappleEnabled(boolean enabled)
    • setJumpJetEnabled

      public void setJumpJetEnabled(boolean enabled)
    • setClubEnabled

      public void setClubEnabled(boolean enabled)
    • setBrushOffEnabled

      public void setBrushOffEnabled(boolean enabled)
    • setDodgeEnabled

      public void setDodgeEnabled(boolean enabled)
    • setProtoEnabled

      public void setProtoEnabled(boolean enabled)
    • setVibroEnabled

      public void setVibroEnabled(boolean enabled)
    • setPheromoneEnabled

      public void setPheromoneEnabled(boolean enabled)
    • setToxinEnabled

      public void setToxinEnabled(boolean enabled)
    • setExplosivesEnabled

      public void setExplosivesEnabled(boolean enabled)
    • setClearWoodsEnabled

      public void setClearWoodsEnabled(boolean enabled)
    • setNextEnabled

      public void setNextEnabled(boolean enabled)
    • setTwistEnabled

      protected void setTwistEnabled(boolean enabled)
    • getINarcPods

      public static List<Targetable> getINarcPods(Entity attacker, Coords pos)
      Helper method that allows us to get the list of iNarc pods in a given attacker's Coords, used by PhysicalDisplay and the MapMenu right-click menu.
      Parameters:
      attacker - Should be the current entity for whom we're building attack data.
      pos - Coords of the hex to check; may not be the same as attacker.getPosition()
      Returns:
      List of Targetables containing co-located iNarc pods