Class ShowCreatureDetails

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public final class ShowCreatureDetails extends KDialog
A dialog frame that displays lots of (almost static) information about one specific creature type. i.e the power/skill, the musterings and the abilities in the different hazards. Non-static information that might be shown is the number of creatures left in the caretaker's stack. The dialog is thought to be popped up and closed if needed, displaying information about one selected creature type. The info in the dialog is updated if needed. Implementation details: The dialog mainly contains one JTextEdit control which itself display HTML text! It is thinkable, that the HTML text comes from an URL (easy to implement). Currently the whole HTML is built line by line like a servlet would do it. To figure out some of the more difficult properties of the creature I "simulate" a tiny battlefield, where the creature in question engages other creatures in different hazard terrains. This is of course highly dependent on the battle implementation. It can easily break. I tried to be very generic -- things that might break, should break on compilation time, and not display wrong information. TODO this dialog should have a SaveWindow attached to it. TODO hexside Hazards Clemens: I started adding the hexside hazards, but that is not completed; for one, the simulatedXXX setup cannot easily be extended calculate that right, and there it is dependent on "atop XXX" or "below XXX" . So, I leave the extended table creation there, but do not add the hexside hazards into the hazards Collection so that it just shows same as before. There is a lot of things that need improvement, see 2136671 Show creature detail window...
Author:
Towi, copied from ShowRecruitTree
See Also:
  • Field Details

    • ivariant

      private final IVariant ivariant
    • hazards

      private final Collection<Hazards> hazards
    • battleStrikeSS

      private final BattleStrikeServerSide battleStrikeSS
    • HEXSIDES

      private static final char[] HEXSIDES
      easy access to hex side identifiers.
    • HEXSIDE_NAMES

      private static final String[] HEXSIDE_NAMES
      define hex side names for table column headers.
  • Constructor Details

    • ShowCreatureDetails

      public ShowCreatureDetails(JFrame parentFrame, CreatureType creature, Point point, JScrollPane pane, Variant variant, ClientGUI clientGui)
      pops up the non-modal dialog. info can be updated if needed.
      Parameters:
      parentFrame - parent frame, i.e. the master board
      creature - creature to show detailed info for.
      point - coordinate on screen to display windows, or null.
      pane - if 'point' is not null it is relative to this.
      variant - the current Variant
      clientGui - for now, the Client acting as deputy to answer Variant questions variant cannot answer yet, and we get iVariant from clientGui
  • Method Details

    • showCreatureDetails

      public void showCreatureDetails(Container cnt, CreatureType creature, Variant variant)
      Parameters:
      cnt - the awt container where the info wil be shown in. it will be emptied.
      creature - the creature that details you want to show
    • _head

      private static void _head(StringBuilder s, CreatureType cr)
      html header and start of page.
    • _section

      private void _section(StringBuilder s, String name)
      start of a named section.
      Parameters:
      s - in/out
    • _trSpan

      private void _trSpan(StringBuilder s, String name, String value)
      a headered table row, the data column spans.
      Parameters:
      s - in/out
    • _low

      private static String _low(String s)
      wrap HTML code around s to make it dark, or gray.