Package VASSAL.build.module
Class StartupGlobalKeyCommand
java.lang.Object
VASSAL.build.AbstractBuildable
VASSAL.build.AbstractConfigurable
VASSAL.build.module.map.MassKeyCommand
VASSAL.build.module.GlobalKeyCommand
VASSAL.build.module.StartupGlobalKeyCommand
- All Implemented Interfaces:
AutoConfigurable
,Buildable
,Configurable
,GameComponent
,PropertyNameSource
,ValidityChecker
,Translatable
,RecursionLimiter.Loopable
public class StartupGlobalKeyCommand extends GlobalKeyCommand implements GameComponent
A Global Key Command that is automatically invoked on game start-up,
once the various Key Listeners have been started.
If multiple start-up commands need to be run, they should be combined in a MultiAction Button and then launched from a single instance of StartupGlobalKeyCommand, as the sequence in which multiple instances of StartupGlobalKeyCommand are fired is undetermined.
- Author:
- Pieter Geerkens
-
Nested Class Summary
Nested classes/interfaces inherited from class VASSAL.build.module.map.MassKeyCommand
MassKeyCommand.DeckPolicyConfig, MassKeyCommand.IconConfig, MassKeyCommand.Prompt, MassKeyCommand.ReportFormatConfig
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, PROPERTIES_FILTER, propertiesFilter, propertySource, REPORT_FORMAT, REPORT_SINGLE, reportFormat, SINGLE_MAP, singleMap, stroke, TOOLTIP
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
Constructors Constructor Description StartupGlobalKeyCommand()
-
Method Summary
Modifier and Type Method Description void
addTo(Buildable parent)
Adds this component to its parent.VisibilityCondition
getAttributeVisibility(String key)
By default, all attributes are visiblestatic String
getConfigureTypeName()
HelpFile
getHelpFile()
Command
getRestoreCommand()
When saving a game, each GameComponent should return aCommand
that, when executed, restores the GameComponent to its state when the game was saved If this component has no persistent state, return nullvoid
setup(boolean gameStarting)
Notify the GameComponent that a game has started/endedMethods inherited from class VASSAL.build.module.GlobalKeyCommand
apply
Methods inherited from class VASSAL.build.module.map.MassKeyCommand
getAllowableConfigureComponents, getAttributeDescriptions, getAttributeNames, getAttributeTypes, getAttributeValueString, getComponentName, getComponentTypeName, getFilter, getLaunchButton, removeFrom, setAttribute, setLaunchButton, setPropertySource
Methods inherited from class VASSAL.build.AbstractConfigurable
add, addPropertyChangeListener, getConfigureComponents, getConfigureName, getConfigurer, getI18nData, getI18nPrefix, getLocalizedConfigureName, remove, removePropertyChangeListener, setAllAttributesUntranslatable, setAttributeTranslatable, setConfigureName
Methods inherited from class VASSAL.build.AbstractBuildable
build, getAllDescendantComponents, getAllDescendantComponentsOf, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOf, getPropertyNames, validate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface VASSAL.build.Buildable
build, getBuildElement
-
Constructor Details
-
StartupGlobalKeyCommand
public StartupGlobalKeyCommand()
-
-
Method Details
-
addTo
Description copied from interface:Buildable
Adds this component to its parent. In order to make Buildable objects extensible, the child is reponsible for adding itself to the parent. That way, Buildable subcomponents can be defined in an extension package without needing to modify the containing class.- Specified by:
addTo
in interfaceBuildable
- Overrides:
addTo
in classMassKeyCommand
-
getConfigureTypeName
-
getHelpFile
- Specified by:
getHelpFile
in interfaceConfigurable
- Overrides:
getHelpFile
in classMassKeyCommand
- Returns:
- a HelpFilte describing how to use and configure this component
-
getAttributeVisibility
Description copied from class:AbstractConfigurable
By default, all attributes are visible- Specified by:
getAttributeVisibility
in interfaceAutoConfigurable
- Overrides:
getAttributeVisibility
in classGlobalKeyCommand
- 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.
-
setup
public void setup(boolean gameStarting)Description copied from interface:GameComponent
Notify the GameComponent that a game has started/ended- Specified by:
setup
in interfaceGameComponent
- Parameters:
gameStarting
- if true, a game is starting. If false, then a game is ending
-
getRestoreCommand
Description copied from interface:GameComponent
When saving a game, each GameComponent should return aCommand
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 interfaceGameComponent
-