Class DeckGlobalKeyCommand

All Implemented Interfaces:
AutoConfigurable, Buildable, Configurable, PropertyNameSource, ValidityChecker, Translatable, ImageSearchTarget, SearchTarget, RecursionLimiter.Loopable

public class DeckGlobalKeyCommand extends MassKeyCommand
This version of MassKeyCommand is added to a DrawPile (which holds a Deck) and applies to pieces/cards currently in the deck. The "Global Key Command" functionality, as the term is used in Vassal Modules, is spread out over several classes internally: GlobalCommand - primary functionality for sending commands to multiple pieces based on matching parameters GlobalKeyCommand - Global Key Commands from a Module window StartupGlobalKeyCommand - Global Key Commands from a Module "At Startup" MassKeyCommand - Global Key Commands from a specific Map window DeckGlobalKeyCommand - Global Key Commands from a Deck CounterGlobalKeyCommand - Global Key Commands from a Game Piece Other important classes: GlobalCommandTarget - "Fast Match" parameters GlobalCommandTargetConfigurer - configurer for "Fast Match" parameters
  • Constructor Details

    • DeckGlobalKeyCommand

      public DeckGlobalKeyCommand()
    • DeckGlobalKeyCommand

      public DeckGlobalKeyCommand(String code)
    • DeckGlobalKeyCommand

      public DeckGlobalKeyCommand(String code, PropertySource source)
  • Method Details

    • getConfigureTypeName

      public static String getConfigureTypeName()
    • getGKCtype

      public GlobalCommandTarget.GKCtype getGKCtype()
      Overrides:
      getGKCtype in class MassKeyCommand
      Returns:
      Our type of Global Key Command (overrides the one from Mass Key Command). Affects what configurer options are shown. In particular no "Fast Match" parameters are shown for Deck GKCs.
    • addTo

      public void addTo(Buildable parent)
      Description copied from class: AbstractToolbarItem
      Default behavior adds the button to the module toolbar.
      Specified by:
      addTo in interface Buildable
      Overrides:
      addTo in class MassKeyCommand
      Parameters:
      parent - parent Buildable to add this component to as a subcomponent.
    • removeFrom

      public void removeFrom(Buildable parent)
      Description copied from class: AbstractToolbarItem
      Default behavior assumes we are removing this from the module toolbar
      Specified by:
      removeFrom in interface Configurable
      Overrides:
      removeFrom in class MassKeyCommand
      Parameters:
      parent - parent
    • getKeyCommand

      public KeyCommand getKeyCommand(Deck deck)
    • getFilter

      public PieceFilter getFilter()
      Since we also limit application of a Deck Global Key command to a specified number of pieces in the Deck, a null match expression should match all pieces, not reject them all.
      Overrides:
      getFilter in class MassKeyCommand
    • apply

      public void apply(Deck deck)
    • encode

      public String encode()
    • decode

      public void decode(String s)
    • getAttributeDescriptions

      public String[] getAttributeDescriptions()
      Description copied from class: AbstractToolbarItem
      This getAttributeDescriptions() 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.getAttributeDescriptions(), key1, ..., keyN), or supply their own order from scratch.
      Specified by:
      getAttributeDescriptions in interface AutoConfigurable
      Overrides:
      getAttributeDescriptions in class MassKeyCommand
      Returns:
      an array of Strings describing the buildFile (XML) attributes of this component. These strings are used as prompts in the Properties window for this object, when the component is configured in the Editor. The order of descriptions should be the same as the order of names in AbstractBuildable.getAttributeNames()
    • getAttributeNames

      public String[] getAttributeNames()
      Description copied from class: AbstractToolbarItem
      This getAttributeNames() 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.getAttributeNames(), key1, ..., keyN), or supply their own order from scratch.

      Lists all the buildFile (XML) attribute names for this component. If this component is ALSO an AbstractConfigurable, then this list of attributes determines the appropriate attribute order for AbstractConfigurable.getAttributeDescriptions() and AbstractConfigurable.getAttributeTypes().

      Specified by:
      getAttributeNames in interface AutoConfigurable
      Overrides:
      getAttributeNames in class MassKeyCommand
      Returns:
      a list of all buildFile (XML) attribute names for this component
    • 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 MassKeyCommand
      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()

    • getAttributeVisibility

      public VisibilityCondition getAttributeVisibility(String key)
      Description copied from class: AbstractConfigurable
      By default, all attributes are visible
      Specified by:
      getAttributeVisibility in interface AutoConfigurable
      Overrides:
      getAttributeVisibility in class MassKeyCommand
      Parameters:
      key - Name (key) of one of this component's attributes
      Returns:
      a VisibilityCondition for this attribute, or null if attribute should always be visible.
    • getExpressionList

      public List<String> getExpressionList()
      Specified by:
      getExpressionList in interface SearchTarget
      Overrides:
      getExpressionList in class MassKeyCommand
      Returns:
      a list of the Configurables string/expression fields if any (for search)
    • getFormattedStringList

      public List<String> getFormattedStringList()
      Specified by:
      getFormattedStringList in interface SearchTarget
      Overrides:
      getFormattedStringList in class MassKeyCommand
      Returns:
      a list of any Message Format strings referenced in the Configurable, if any (for search)
    • getNamedKeyStrokeList

      public List<NamedKeyStroke> getNamedKeyStrokeList()
      Specified by:
      getNamedKeyStrokeList in interface SearchTarget
      Overrides:
      getNamedKeyStrokeList in class MassKeyCommand
      Returns:
      a list of any Named KeyStrokes referenced in the Configurable, if any (for search)