Class InternetDiceButton

All Implemented Interfaces:
PropertyChangeListener, EventListener, AutoConfigurable, Buildable, Configurable, GameComponent, PropertyNameSource, CommandEncoder, ValidityChecker, Translatable, Auditable, ImageSearchTarget, SearchTarget

public class InternetDiceButton extends DiceButton implements GameComponent, CommandEncoder
This component places a button into the controls window toolbar. Pressing the button generates random numbers and displays the result in the Chatter
  • Field Details

  • Constructor Details

    • InternetDiceButton

      public InternetDiceButton()
  • Method Details

    • getConfigureTypeName

      public static String getConfigureTypeName()
    • getAttributeTypes

      public Class<?>[] getAttributeTypes()
      Description copied from class: AbstractToolbarItem
      This getAttributeTypes() will return the items specific to the Toolbar Button - classes extending this should add their own items as well. If the "nameKey" is blank, then no "name" configure entry will be generated. Extending classes can use ArrayUtils.addAll(super.getAttributeTypes(), key1, ..., keyN), or supply their own order from scratch.
      Specified by:
      getAttributeTypes in interface AutoConfigurable
      Overrides:
      getAttributeTypes in class DiceButton
      Returns:
      the Class for the buildFile (XML) attributes of this component. Valid classes include: String, Integer, Double, Boolean, Image, Color, and KeyStroke, along with any class for which a Configurer exists in VASSAL.configure. The class determines, among other things, which type of AutoConfigurer will be used to configure the attribute when the object is configured in the Editor.

      The order of classes should be the same as the order of names in AbstractBuildable.getAttributeNames()

    • DR

      protected void DR()
      Ask the die manager to do our roll!
      Overrides:
      DR in class DiceButton
    • addTo

      public void addTo(Buildable parent)
      Expects to be added to the DieManager.
      Specified by:
      addTo in interface Buildable
      Overrides:
      addTo in class DiceButton
      Parameters:
      parent - parent Buildable to add this component to as a subcomponent.
    • initDieManager

      protected void initDieManager()
    • removeFrom

      public void removeFrom(Buildable b)
      Description copied from class: AbstractToolbarItem
      Remove from our parent
      Specified by:
      removeFrom in interface Configurable
      Overrides:
      removeFrom in class AbstractToolbarItem
      Parameters:
      b - parent
    • setup

      public void setup(boolean gameStarting)
      Description copied from interface: GameComponent
      Notify the GameComponent that a game has started/ended
      Specified by:
      setup in interface GameComponent
      Overrides:
      setup in class AbstractToolbarItem
      Parameters:
      gameStarting - if true, a game is starting. If false, then a game is ending
    • getRestoreCommand

      public Command getRestoreCommand()
      Description copied from interface: GameComponent
      When saving a game, each GameComponent should return a Command that, when executed, restores the GameComponent to its state when the game was saved If this component has no persistent state, return null
      Specified by:
      getRestoreCommand in interface GameComponent
      Overrides:
      getRestoreCommand in class AbstractToolbarItem
    • decode

      public Command decode(String command)
      Description copied from interface: CommandEncoder
      Translate a String into a Command
      Specified by:
      decode in interface CommandEncoder
    • encode

      public String encode(Command c)
      Description copied from interface: CommandEncoder
      Translate a Command into a String
      Specified by:
      encode in interface CommandEncoder
    • getHelpFile

      public HelpFile getHelpFile()
      Specified by:
      getHelpFile in interface Configurable
      Overrides:
      getHelpFile in class DiceButton
      Returns:
      a HelpFile describing how to use and configure * this component