Class GUIMasterHex

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public final class GUIMasterHex extends GUIHex<MasterHex>
Class GUIMasterHex holds GUI information for a MasterHex.
Author:
David Ripton, Romain Dolbeau
See Also:
  • Field Details

    • LOGGER

      private static final Logger LOGGER
    • inverted

      private boolean inverted
    • fontMetrics

      private FontMetrics fontMetrics
    • halfFontHeight

      private int halfFontHeight
    • offCenter

      private Point offCenter
    • weakBoardRef

      private WeakReference<MasterBoard> weakBoardRef
    • highlightBorder

      private GeneralPath highlightBorder
    • selectColor

      private Color selectColor
    • invertedPostfix

      private static final String invertedPostfix
      See Also:
  • Constructor Details

    • GUIMasterHex

      GUIMasterHex(MasterHex model)
  • Method Details

    • init

      void init(int cx, int cy, int scale, boolean inverted, MasterBoard board)
    • paint

      public void paint(Graphics g)
      Overrides:
      paint in class JComponent
    • paintHighlightIfNeeded

      public void paintHighlightIfNeeded(Graphics2D g2)
    • stringWidth

      private int stringWidth(String s, Graphics2D g2)
    • paintLabel

      private void paintLabel(Graphics2D g2)
    • paintTerrainName

      private void paintTerrainName(Graphics2D g2)
    • repaint

      public void repaint()
      Overrides:
      repaint in class Component
    • drawGate

      private void drawGate(Graphics2D g2, double vx1, double vy1, double vx2, double vy2, Constants.HexsideGates gateType)
    • getOffCenter

      Point getOffCenter()
      Return a point near the center of the hex, vertically offset a bit toward the fat side.
    • isInverted

      boolean isInverted()
    • setSelectColor

      void setSelectColor(Color color)
    • select

      public void select()
      Overrides:
      select in class GUIHex<MasterHex>
    • unselect

      public void unselect()
      Overrides:
      unselect in class GUIHex<MasterHex>
    • getOverlayImage

      private Image getOverlayImage()
    • paintOverlay

      private boolean paintOverlay(Graphics2D g)
    • cleanup

      public void cleanup()