Package VASSAL.counters
Class TriggerAction
java.lang.Object
VASSAL.counters.Decorator
VASSAL.counters.TriggerAction
- All Implemented Interfaces:
PropertyNameSource,PropertySource,EditablePiece,GamePiece,PropertyExporter,StateMergeable,TranslatablePiece,PersistentPropertyContainer,RecursionLimiter.Loopable
public class TriggerAction extends Decorator implements TranslatablePiece, RecursionLimiter.Loopable
Macro Execute a series of Keystrokes against this same piece - Triggered by
own KeyCommand or list of keystrokes - Match against an optional Property
Filter
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTriggerAction.Ed -
Field Summary
Fields Modifier and Type Field Description protected NamedKeyStroke[]actionKeysprotected Stringcommandstatic StringIDprotected booleanindexprotected StringindexPropertyprotected FormattedStringindexStartprotected FormattedStringindexStepprotected intindexValueprotected NamedKeyStrokekeyprotected booleanloopprotected FormattedStringloopCountprotected StringloopTypeprotected Stringnameprotected GamePieceouterprotected NamedKeyStrokepostLoopKeyprotected NamedKeyStrokepreLoopKeyprotected PropertyExpressionpropertyMatchprotected PropertyExpressionuntilExpressionprotected NamedKeyStroke[]watchKeysprotected PropertyExpressionwhileExpressionFields inherited from interface VASSAL.counters.PropertyExporter
LOCALIZED_NAMEFields inherited from interface VASSAL.i18n.TranslatablePiece
PREFIX -
Constructor Summary
Constructors Constructor Description TriggerAction()TriggerAction(String type, GamePiece inner) -
Method Summary
Modifier and Type Method Description RectangleboundingBox()The area which this GamePiece occupies when drawn at the point (0,0)protected CommanddoLoopOnce()voiddraw(Graphics g, int x, int y, Component obs, double zoom)Draw this GamePieceprotected CommandexecuteKey(NamedKeyStroke key)StringgetComponentName()StringgetComponentTypeName()StringgetDescription()A plain-English description of this type of piecePieceEditorgetEditor()Get the configurer for this traitHelpFilegetHelpFile()PieceI18nDatagetI18nData()Return I18n data for this pieceObjectgetLocalizedProperty(Object key)StringgetName()The plain English name for this pieceObjectgetProperty(Object key)List<String>getPropertyNames()Return Property names exposed by this traitShapegetShape()The shape of the piece from the user's viewpoint.protected booleanisIndex()CommandkeyEvent(KeyStroke stroke)Apply key commands to inner pieces firstprotected booleanmatchesFilter()protected KeyCommand[]myGetKeyCommands()StringmyGetState()StringmyGetType()CommandmyKeyEvent(KeyStroke stroke)The response of this trait alone to the given KeyStrokevoidmySetState(String newState)Set just the state of this traitvoidmySetType(String type)Set the type information for this piece.voidsetCommandName(String s)voidsetKey(NamedKeyStroke k)voidsetPropertyMatch(String s)Methods inherited from class VASSAL.counters.Decorator
getCommandDescription, getDecorator, getI18nData, getI18nData, getId, getInner, getInnermost, getKeyCommands, getLocalizedName, getMap, getOuter, getOutermost, getParent, getPersistentProperty, getPosition, getProperties, getState, getTranslation, getType, isSelected, mergeState, putOldProperties, repack, reportDataError, reportDataError, reportDataError, setId, setInner, setMap, setOldProperties, setOldProperties, setParent, setPersistentProperty, setPosition, setProperty, setSelected, setState, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface VASSAL.counters.GamePiece
getId, getLocalizedName, getMap, getParent, getPosition, getState, getType, setId, setMap, setParent, setPosition, setProperty, setStateMethods inherited from interface VASSAL.counters.PropertyExporter
getProperties
-
Field Details
-
ID
- See Also:
- Constant Field Values
-
name
-
command
-
key
-
propertyMatch
-
watchKeys
-
actionKeys
-
loop
protected boolean loop -
preLoopKey
-
postLoopKey
-
loopType
-
whileExpression
-
untilExpression
-
loopCount
-
index
protected boolean index -
indexProperty
-
indexStart
-
indexStep
-
indexValue
protected int indexValue -
outer
-
-
Constructor Details
-
TriggerAction
public TriggerAction() -
TriggerAction
-
-
Method Details
-
boundingBox
Description copied from interface:GamePieceThe area which this GamePiece occupies when drawn at the point (0,0)- Specified by:
boundingBoxin interfaceGamePiece
-
draw
Description copied from interface:GamePieceDraw this GamePiece -
getName
Description copied from interface:GamePieceThe plain English name for this piece -
myGetKeyCommands
- Specified by:
myGetKeyCommandsin classDecorator- Returns:
- the commands for this trait alone
- See Also:
Decorator.getKeyCommands()
-
myGetState
- Specified by:
myGetStatein classDecorator- Returns:
- the state of this trait alone
- See Also:
Decorator.getState()
-
myGetType
- Specified by:
myGetTypein classDecorator- Returns:
- the type of this trait alone
- See Also:
Decorator.getType()
-
keyEvent
Apply key commands to inner pieces first- Specified by:
keyEventin interfaceGamePiece- Overrides:
keyEventin classDecorator- Parameters:
stroke-- Returns:
- See Also:
ForwardToKeyBuffer
-
myKeyEvent
Description copied from class:DecoratorThe response of this trait alone to the given KeyStroke- Specified by:
myKeyEventin classDecorator- Parameters:
stroke- Stroke to apply- Returns:
- Generated Command or null if no effect
- See Also:
Decorator.keyEvent(javax.swing.KeyStroke)
-
isIndex
protected boolean isIndex() -
getProperty
- Specified by:
getPropertyin interfaceGamePiece- Specified by:
getPropertyin interfacePropertySource- Overrides:
getPropertyin classDecorator
-
getLocalizedProperty
- Specified by:
getLocalizedPropertyin interfacePropertySource- Overrides:
getLocalizedPropertyin classDecorator
-
doLoopOnce
- Throws:
RecursionLimitException
-
executeKey
-
matchesFilter
protected boolean matchesFilter() -
mySetState
Description copied from class:DecoratorSet just the state of this trait- Specified by:
mySetStatein classDecorator- See Also:
Decorator.myGetState()
-
getShape
Description copied from interface:GamePieceThe shape of the piece from the user's viewpoint. This defines the area in which the user must click to select or move the piece, for example. LikeGamePiece.boundingBox(), it assumes the position is (0,0) and must be translated to the actual location where the piece is being drawn. -
getDescription
Description copied from interface:EditablePieceA plain-English description of this type of piece- Specified by:
getDescriptionin interfaceEditablePiece
-
getHelpFile
- Specified by:
getHelpFilein interfaceEditablePiece
-
mySetType
Description copied from interface:EditablePieceSet the type information for this piece. SeeDecorator.myGetType()- Specified by:
mySetTypein interfaceEditablePiece
-
getPropertyNames
Return Property names exposed by this trait- Specified by:
getPropertyNamesin interfacePropertyNameSource- Overrides:
getPropertyNamesin classDecorator
-
setPropertyMatch
-
setCommandName
-
setKey
-
getEditor
Description copied from interface:EditablePieceGet the configurer for this trait- Specified by:
getEditorin interfaceEditablePiece- Overrides:
getEditorin classDecorator
-
getI18nData
Description copied from class:DecoratorReturn I18n data for this piece- Specified by:
getI18nDatain interfaceTranslatablePiece- Overrides:
getI18nDatain classDecorator- Returns:
- I18n data
-
getComponentName
- Specified by:
getComponentNamein interfaceRecursionLimiter.Loopable
-
getComponentTypeName
- Specified by:
getComponentTypeNamein interfaceRecursionLimiter.Loopable
-