Class Chit

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
GUIBattleChit, Marker, MovementDie, StrikeDie

class Chit extends JPanel
Class Chit implements the GUI for a Titan chit representing either a character or a legion. TODO offer constructors using the Legion instead of strings TODO consider splitting into LegionChit and CreatureChit TODO Important: All creature (and marker) related Chits should get an option argument in order to be able to ask for options like "marker in players original color or now-owning-player's-color and "angel in traditionl blue or in actual players color".
Author:
David Ripton, Romain Dolbeau
  • Field Details

    • LOGGER

      private static final Logger LOGGER
    • bufferedImage

      private final Image bufferedImage
    • bufferedInvertedImage

      private Image bufferedInvertedImage
    • rect

      Rectangle rect
    • client

      final Client client
    • options

      final IOptions options
    • dead

      private boolean dead
      Flag to mark chit as dead and paint it with an "X" through it.
    • border

      private boolean border
      Flag to paint a border around the chit.
    • borderColor

      private Color borderColor
    • playerColoredAngel

      private final boolean playerColoredAngel
    • inverted

      protected final boolean inverted
      Flag to paint the chit upside-down.
    • id

      private final String id
    • oneWide

      static final BasicStroke oneWide
    • threeWide

      private static final BasicStroke threeWide
  • Constructor Details

    • Chit

      Chit(int scale, String id)
      P l a i n C o n s t r u c t o r s
    • Chit

      Chit(int scale, CreatureType creatureType)
    • Chit

      Chit(int scale, String id, String[] overlays)
    • Chit

      Chit(int scale, String id, boolean inverted, Client client)
    • Chit

      Chit(int scale, String id, boolean inverted, boolean dubious)
    • Chit

      Chit(int scale, String id, boolean inverted, boolean dubious, boolean dubiousAsBlank, Client client)
    • Chit

      private Chit(int scale, String idPerhapsWithColor, boolean inverted, boolean dubious, boolean dubiousAsBlank, String[] overlays, Client client, IOptions options)
      Parameters:
      idPerhapsWithColor - CreatureType id, markerId, or filename of some picture denoting some symbol (for HazardEffects). For Markers, Titans and Angels could be of form - and then they will be painted in that color (e.g. captured markers)
      options - TODO
  • Method Details

    • newCreatureChit

      public static Chit newCreatureChit(int scale, String id)
      Factory method for creatures, based on image names TODO try to get rid of the string bases Creature chits
      Parameters:
      scale -
      id -
      Returns:
      The newly created CreatureChit
    • newCreatureChit

      public static Chit newCreatureChit(int scale, CreatureType type)
      Factory method for creatures, based on CreatureType
      Parameters:
      scale -
      type -
      Returns:
      The newly created CreatureChit
    • newDiceChit

      public static Chit newDiceChit(int scale, String markerId)
      Factory method for creatures, based on markerId
      Parameters:
      scale -
      markerId -
      Returns:
      The newly created MarkerChit
    • newSymbolChit

      public static Chit newSymbolChit(int scale, String id)
      Factory method for icons representing e.g. hazard effects
      Parameters:
      scale -
      id -
      Returns:
      the created Chit
    • isMarkerId

      public static boolean isMarkerId(String id)
    • getTitanPower

      public int getTitanPower()
    • getImage

      private static Image getImage(String imageFilename, int scale)
    • getImage

      private static Image getImage(String[] imageFilenames, int scale)
    • getId

      public String getId()
    • toString

      public String toString()
      Overrides:
      toString in class Component
    • rescale

      void rescale(int scale)
    • paintComponent

      public void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • setLocation

      public void setLocation(Point point)
      Overrides:
      setLocation in class Component
    • getBounds

      public Rectangle getBounds()
      Overrides:
      getBounds in class Component
    • getCenter

      public Point getCenter()
    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class JComponent
    • getMinimumSize

      public Dimension getMinimumSize()
      Overrides:
      getMinimumSize in class JComponent
    • getMaximumSize

      public Dimension getMaximumSize()
      Overrides:
      getMaximumSize in class JComponent
    • isDead

      boolean isDead()
    • setDead

      void setDead(boolean dead)
    • toggleDead

      void toggleDead()
    • setBorder

      void setBorder(boolean border)
    • setBorderColor

      void setBorderColor(Color borderColor)