Class FacingPickerPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class FacingPickerPanel extends JPanel
Six facing choices laid out around a unit's picture the way the hex sides sit on the map: north on top, south at the bottom, the other four on the sides. The turret dialogs and the building facing dialog share it, so a building is turned the way a turret is.
See Also:
  • Constructor Details

    • FacingPickerPanel

      public FacingPickerPanel(List<JRadioButton> facings, Image centreImage)
      Parameters:
      facings - the six radio buttons, in facing order 0 to 5, already grouped, selected and enabled by the caller
      centreImage - the picture shown in the middle, normally previewOnHex(ClientGUI, Entity, int)
  • Method Details

    • previewOnHex

      public static Image previewOnHex(ClientGUI clientgui, Entity unit, int facing)
      The unit's preview picture drawn on a map hex, turned to the given facing so the six choices line up with what the player sees on the board.
      Parameters:
      clientgui - the client GUI that supplies the unit and hex images
      unit - the unit to draw
      facing - the facing to turn the picture to; 0 leaves it pointing north
      Returns:
      the composed picture