Package VASSAL.build.module.map
Class DeckGlobalKeyCommand
java.lang.Object
VASSAL.search.AbstractImageFinder
VASSAL.build.AbstractBuildable
VASSAL.build.AbstractConfigurable
VASSAL.build.AbstractToolbarItem
VASSAL.build.module.map.MassKeyCommand
VASSAL.build.module.map.DeckGlobalKeyCommand
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,AutoConfigurable
,Buildable
,Configurable
,GameComponent
,PropertyNameSource
,ValidityChecker
,Translatable
,Auditable
,ImageSearchTarget
,SearchTarget
,RecursionLimiter.Loopable
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
NOTE: There is no need to support AuditTrails in a DeckGlobalKeyCommand since there is no matching properties expression.
Individual counters processing the GKC will generate their own internal audit trails.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
Nested classes/interfaces inherited from class VASSAL.build.module.map.MassKeyCommand
MassKeyCommand.DeckPolicyConfig, MassKeyCommand.IconConfig, MassKeyCommand.ParameterListConfig, MassKeyCommand.Prompt, MassKeyCommand.ReportFormatConfig
Nested classes/interfaces inherited from class VASSAL.build.AbstractToolbarItem
AbstractToolbarItem.FormattedStringConfig
Nested classes/interfaces inherited from interface VASSAL.build.AutoConfigurable
AutoConfigurable.Util
-
Field Summary
Fields inherited from class VASSAL.build.module.map.MassKeyCommand
AFFECTED_PIECE_NAMES, BUTTON_TEXT, CHECK_PROPERTY, CHECK_VALUE, checkProperty, checkValue, condition, CONDITION, DECK_COUNT, DEPRECATED_NAME, filter, globalCommand, HOTKEY, ICON, KEY_COMMAND, launch, map, NAME, names, parameters, PARAMETERS, PROPERTIES_FILTER, propertiesFilter, propertySource, REPORT_FORMAT, REPORT_SINGLE, reportFormat, SINGLE_MAP, singleMap, stroke, SUPPRESS_SOUNDS, target, TARGET, TOOLTIP
Fields inherited from class VASSAL.build.AbstractToolbarItem
CAN_DISABLE, canDisable, DISABLED_ICON, disabledIconConfig, HIDE_WHEN_DISABLED, hideWhenDisabled, property, PROPERTY_GATE, propertyGate, showDisabledOptions
Fields inherited from class VASSAL.build.AbstractConfigurable
changeSupport, config, localizedName, myI18nData, name
Fields inherited from class VASSAL.build.AbstractBuildable
buildComponents, validator
Fields inherited from interface VASSAL.build.Configurable
NAME_PROPERTY
-
Constructor Summary
ConstructorDescriptionDeckGlobalKeyCommand
(String code) DeckGlobalKeyCommand
(String code, PropertySource source) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Default behavior adds the button to the parent componentvoid
void
encode()
String[]
This getAttributeDescriptions() will return the items specific to the Toolbar Button - classes extending this should add their own items as well.String[]
This getAttributeNames() will return the items specific to the Toolbar Button - classes extending this should add their own items as well.Class<?>[]
This getAttributeTypes() will return the items specific to the Toolbar Button - classes extending this should add their own items as well.By default, all attributes are visiblestatic String
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.getKeyCommand
(Deck deck) void
removeFrom
(Buildable parent) Remove from our parentMethods inherited from class VASSAL.build.module.map.MassKeyCommand
apply, getAllowableConfigureComponents, getAttributeValueString, getComponentName, getComponentTypeName, getFilter, getHelpFile, getPropertyList, getTarget, setAttribute, setPropertySource
Methods inherited from class VASSAL.build.AbstractToolbarItem
addLocalImageNames, addPropertyGateListener, addPropertyGateListener, checkDisabled, disableIfTrue, getComponent, getLaunchButton, getMenuTextList, getNameKey, getRestoreCommand, isShowDisabledOptions, makeLaunchButton, propertyChange, removePropertyGateListener, setButtonTextKey, setHotKeyKey, setIconKey, setLaunchButton, setNameKey, setNamePrompt, setShowDisabledOptions, setTooltipKey, setup
Methods inherited from class VASSAL.build.AbstractConfigurable
add, addPropertyChangeListener, getConfigureComponents, getConfigureName, getConfigurer, getI18nData, getI18nPrefix, getLocalizedConfigureName, getTypeName, remove, removePropertyChangeListener, setAllAttributesUntranslatable, setAttributeTranslatable, setConfigureName
Methods inherited from class VASSAL.build.AbstractBuildable
addImageNamesRecursively, build, buildString, getAllDescendantComponentsOf, getAncestor, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOf, getNonFolderAncestor, getPropertyNames, setAncestor, validate
Methods inherited from class VASSAL.search.AbstractImageFinder
getAllImageNames, getLocalImageNames
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface VASSAL.script.expression.Auditable
getComponentName, getComponentTypeName
Methods inherited from interface VASSAL.build.Buildable
build, getBuildElement, isMandatory, isMovable, isUnique
-
Constructor Details
-
DeckGlobalKeyCommand
public DeckGlobalKeyCommand() -
DeckGlobalKeyCommand
-
DeckGlobalKeyCommand
-
DeckGlobalKeyCommand
-
-
Method Details
-
getConfigureTypeName
-
getGKCtype
- Overrides:
getGKCtype
in classMassKeyCommand
- 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
Description copied from class:AbstractToolbarItem
Default behavior adds the button to the parent component- Specified by:
addTo
in interfaceBuildable
- Overrides:
addTo
in classMassKeyCommand
- Parameters:
parent
- parent Buildable to add this component to as a subcomponent.
-
removeFrom
Description copied from class:AbstractToolbarItem
Remove from our parent- Specified by:
removeFrom
in interfaceConfigurable
- Overrides:
removeFrom
in classMassKeyCommand
- Parameters:
parent
- parent
-
getKeyCommand
-
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 classMassKeyCommand
-
apply
-
encode
-
decode
-
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 interfaceAutoConfigurable
- Overrides:
getAttributeDescriptions
in classMassKeyCommand
- 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
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 forAbstractConfigurable.getAttributeDescriptions()
andAbstractConfigurable.getAttributeTypes()
.- Specified by:
getAttributeNames
in interfaceAutoConfigurable
- Overrides:
getAttributeNames
in classMassKeyCommand
- Returns:
- an array of all buildFile (XML) attribute names for this component
-
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 interfaceAutoConfigurable
- Overrides:
getAttributeTypes
in classMassKeyCommand
- 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
Description copied from class:AbstractConfigurable
By default, all attributes are visible- Specified by:
getAttributeVisibility
in interfaceAutoConfigurable
- Overrides:
getAttributeVisibility
in classMassKeyCommand
- 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
- Specified by:
getExpressionList
in interfaceSearchTarget
- Overrides:
getExpressionList
in classMassKeyCommand
- Returns:
- a list of the Configurables string/expression fields if any (for search)
-
getFormattedStringList
- Specified by:
getFormattedStringList
in interfaceSearchTarget
- Overrides:
getFormattedStringList
in classMassKeyCommand
- Returns:
- a list of any Message Format strings referenced in the Configurable, if any (for search)
-
getNamedKeyStrokeList
- Specified by:
getNamedKeyStrokeList
in interfaceSearchTarget
- Overrides:
getNamedKeyStrokeList
in classMassKeyCommand
- Returns:
- a list of any Named KeyStrokes referenced in the Configurable, if any (for search)
-