Package VASSAL.counters
Class GlobalCommand
java.lang.Object
VASSAL.counters.GlobalCommand
- All Implemented Interfaces:
Auditable
- Direct Known Subclasses:
DeckGlobalKeyCommand.DeckGlobalCommand
The heart of all the different forms of Global Key Command, GlobalCommand handles sending a key command to
multiple pieces, potentially on multiple maps, as long as they match its filtering condition.
The various forms of Global Key Command that use GlobalCommand are:
GlobalKeyCommand
- Global Key Commands from a Module window
StartupGlobalKeyCommand
- Startup Global Key Commands from a Module
MassKeyCommand
- Global Key Commands from a specific Map window
DeckGlobalKeyCommand
- Global Key Commands from a Deck
CounterGlobalKeyCommand
- Global Key Command from a Game Piece
Other important classes:
GlobalCommandTarget
- "Fast Match" parameters
GlobalCommandTargetConfigurer
- configurer for "Fast Match" parameters-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected KeyStroke
protected RecursionLimiter.Loopable
protected FormattedString
protected boolean
protected int
protected String
protected PropertySource
protected GlobalCommandTarget
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionapply
(Map[] maps, PieceFilter filter) (Legacy - applies GKC without Fast Match)apply
(Map[] maps, PieceFilter filter, GlobalCommandTarget fastMatch) Apply the key command to all pieces that pass the given filter invalid input: '&' our Fast MatchGlobalCommandTarget
parameters on all the given mapsapply
(Map[] maps, PieceFilter filter, GlobalCommandTarget fastMatch, AuditTrail audit) Apply the key command to all pieces that pass the given filter invalid input: '&' our Fast MatchGlobalCommandTarget
parameters on all the given mapsapply
(Map map, PieceFilter filter) (Legacy - applies GKC without Fast Match)apply
(Map map, PieceFilter filter, GlobalCommandTarget fastMatch) Apply the key command on ONE SPECIFIC MAP to all pieces that pass the given filter and our Fast Match parameters.apply
(Map map, PieceFilter filter, GlobalCommandTarget fastMatch, AuditTrail audit) boolean
Return the name of the trait or Component an Auditable isReturn a description of the Type of trait or Component an Auditable isint
int
hashCode()
boolean
void
setKeyStroke
(KeyStroke keyStroke) void
setKeyStroke
(NamedKeyStroke keyStroke) void
void
setReportFormat
(String format) void
setReportSingle
(boolean reportSingle) void
setSelectFromDeck
(int selectFromDeck) Set the number of pieces to select from a deck that the command will apply to.void
setSelectFromDeckExpression
(String selectFromDeck) Set the number of pieces to select from a deck that the command will apply to.void
setTarget
(GlobalCommandTarget target)
-
Field Details
-
keyStroke
-
reportSingle
protected boolean reportSingle -
selectFromDeck
protected int selectFromDeck -
selectFromDeckExpression
-
reportFormat
-
owner
-
source
-
target
-
-
Constructor Details
-
GlobalCommand
-
GlobalCommand
-
-
Method Details
-
getComponentTypeName
Description copied from interface:Auditable
Return a description of the Type of trait or Component an Auditable is- Specified by:
getComponentTypeName
in interfaceAuditable
- Returns:
- Component Type
-
getComponentName
Description copied from interface:Auditable
Return the name of the trait or Component an Auditable is- Specified by:
getComponentName
in interfaceAuditable
- Returns:
- Component name
-
setPropertySource
-
setKeyStroke
-
setKeyStroke
-
setReportFormat
-
getKeyStroke
-
getReportFormat
-
isReportSingle
public boolean isReportSingle() -
setReportSingle
public void setReportSingle(boolean reportSingle) -
setTarget
-
getTarget
-
apply
Apply the key command to all pieces that pass the given filter invalid input: '&' our Fast MatchGlobalCommandTarget
parameters on all the given maps- Parameters:
maps
- Array of Mapsfilter
- Filter to apply (created e.g. withPropertyExpression.getFilter(VASSAL.build.module.properties.PropertySource, VASSAL.script.expression.Auditable, java.lang.String)
fastMatch
- Fast matching parameters, or null.GlobalCommandTarget
andGlobalCommandTargetConfigurer
- Returns:
- the corresponding
Command
that would reproduce all the things this GKC just did, on another client.
-
apply
public Command apply(Map[] maps, PieceFilter filter, GlobalCommandTarget fastMatch, AuditTrail audit) Apply the key command to all pieces that pass the given filter invalid input: '&' our Fast MatchGlobalCommandTarget
parameters on all the given maps- Parameters:
maps
- Array of Mapsfilter
- Filter to apply (created e.g. withPropertyExpression.getFilter(VASSAL.build.module.properties.PropertySource, VASSAL.script.expression.Auditable, java.lang.String)
fastMatch
- Fast matching parameters, or null.GlobalCommandTarget
andGlobalCommandTargetConfigurer
audit
- Audit trail of evaluation of the filter so far- Returns:
- the corresponding
Command
that would reproduce all the things this GKC just did, on another client.
-
apply
(Legacy - applies GKC without Fast Match)- Parameters:
map
- a single mapfilter
- filter- Returns:
- command
-
apply
(Legacy - applies GKC without Fast Match)- Parameters:
maps
- list of mapsfilter
- filter- Returns:
- command
-
apply
Apply the key command on ONE SPECIFIC MAP to all pieces that pass the given filter and our Fast Match parameters.- Parameters:
map
- a single mapfilter
- Filter to apply (created e.g. withPropertyExpression.getFilter(VASSAL.build.module.properties.PropertySource, VASSAL.script.expression.Auditable, java.lang.String)
fastMatch
- Fast matching parameters, or null.GlobalCommandTarget
andGlobalCommandTargetConfigurer
- Returns:
- the corresponding
Command
that would reproduce all the things this GKC just did, on another client.
-
apply
-
getSelectFromDeck
public int getSelectFromDeck() -
getSelectFromDeckExpression
-
setSelectFromDeckExpression
Set the number of pieces to select from a deck that the command will apply to. A value invalid input: '<'0 means to apply to all pieces in the deck- Parameters:
selectFromDeck
- Number of pieces to select
-
setSelectFromDeck
public void setSelectFromDeck(int selectFromDeck) Set the number of pieces to select from a deck that the command will apply to. A value invalid input: '<'0 means to apply to all pieces in the deck- Parameters:
selectFromDeck
- Number of pieces to select
-
hashCode
public int hashCode() -
equals
-