Package VASSAL.counters
Class Immobilized
java.lang.Object
VASSAL.counters.Decorator
VASSAL.counters.Immobilized
- All Implemented Interfaces:
PropertyNameSource,PropertySource,EditablePiece,GamePiece,PropertyExporter,StateMergeable,PersistentPropertyContainer
public class Immobilized extends Decorator implements EditablePiece
Decorator that filters events to prevent a GamePiece from
being selected and/or moved.
Note: The Alt selection filter was originally implemented
as a ctl-shift filter, but this conflicts with the standard counter
selection interface and has not worked since v3.0.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classImmobilized.MoveIfSelectedclassImmobilized.UseAltclassImmobilized.UseShift -
Field Summary
Fields Modifier and Type Field Description protected static charALT_BAND_SELECTprotected static charALT_SELECTprotected booleanaltToBandSelectprotected booleanaltToSelectprotected EventFilterbandselectFilterstatic StringIDprotected static charIGNORE_GRIDprotected booleanignoreGridprotected static charMOVE_NORMALprotected static charMOVE_SELECTEDprotected EventFiltermoveFilterprotected booleanmoveIfSelectedprotected static EventFilterNEVERprotected static charNEVER_BAND_SELECTprotected static charNEVER_MOVEprotected static charNEVER_SELECTprotected booleanneverBandSelectprotected booleanneverMoveprotected booleanneverSelectprotected EventFilterselectFilterprotected static charSHIFT_SELECTprotected booleanshiftToSelectFields inherited from interface VASSAL.counters.PropertyExporter
LOCALIZED_NAME -
Constructor Summary
Constructors Constructor Description Immobilized()Immobilized(String type, GamePiece p)Immobilized(GamePiece p, String type)Deprecated. -
Method Summary
Modifier and Type Method Description RectangleboundingBox()The area which this GamePiece occupies when drawn at the point (0,0)voiddraw(Graphics g, int x, int y, Component obs, double zoom)Draw this GamePieceStringgetDescription()A plain-English description of this type of piecePieceEditorgetEditor()Get the configurer for this traitHelpFilegetHelpFile()ObjectgetLocalizedProperty(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.KeyCommand[]myGetKeyCommands()StringmyGetState()StringmyGetType()CommandmyKeyEvent(KeyStroke e)The response of this trait alone to the given KeyStrokevoidmySetState(String s)Set just the state of this traitvoidmySetType(String type)Set the type information for this piece.Methods inherited from class VASSAL.counters.Decorator
getCommandDescription, getDecorator, getI18nData, getI18nData, getI18nData, getId, getInner, getInnermost, getKeyCommands, getLocalizedName, getMap, getOuter, getOutermost, getParent, getPersistentProperty, getPosition, getProperties, getState, getTranslation, getType, isSelected, keyEvent, 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, keyEvent, setId, setMap, setParent, setPosition, setProperty, setStateMethods inherited from interface VASSAL.counters.PropertyExporter
getProperties
-
Field Details
-
ID
- See Also:
- Constant Field Values
-
shiftToSelect
protected boolean shiftToSelect -
altToSelect
protected boolean altToSelect -
ignoreGrid
protected boolean ignoreGrid -
neverSelect
protected boolean neverSelect -
neverMove
protected boolean neverMove -
moveIfSelected
protected boolean moveIfSelected -
neverBandSelect
protected boolean neverBandSelect -
altToBandSelect
protected boolean altToBandSelect -
selectFilter
-
moveFilter
-
bandselectFilter
-
MOVE_SELECTED
protected static final char MOVE_SELECTED- See Also:
- Constant Field Values
-
MOVE_NORMAL
protected static final char MOVE_NORMAL- See Also:
- Constant Field Values
-
NEVER_MOVE
protected static final char NEVER_MOVE- See Also:
- Constant Field Values
-
IGNORE_GRID
protected static final char IGNORE_GRID- See Also:
- Constant Field Values
-
SHIFT_SELECT
protected static final char SHIFT_SELECT- See Also:
- Constant Field Values
-
ALT_SELECT
protected static final char ALT_SELECT- See Also:
- Constant Field Values
-
NEVER_SELECT
protected static final char NEVER_SELECT- See Also:
- Constant Field Values
-
NEVER_BAND_SELECT
protected static final char NEVER_BAND_SELECT- See Also:
- Constant Field Values
-
ALT_BAND_SELECT
protected static final char ALT_BAND_SELECT- See Also:
- Constant Field Values
-
NEVER
-
-
Constructor Details
-
Immobilized
public Immobilized() -
Immobilized
Deprecated.UseImmobilized(String, GamePiece)instead. -
Immobilized
-
-
Method Details
-
mySetType
Description copied from interface:EditablePieceSet the type information for this piece. SeeDecorator.myGetType()- Specified by:
mySetTypein interfaceEditablePiece
-
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()
-
myKeyEvent
Description copied from class:DecoratorThe response of this trait alone to the given KeyStroke- Specified by:
myKeyEventin classDecorator- Parameters:
e- Stroke to apply- Returns:
- Generated Command or null if no effect
- See Also:
Decorator.keyEvent(javax.swing.KeyStroke)
-
getLocalizedProperty
- Specified by:
getLocalizedPropertyin interfacePropertySource- Overrides:
getLocalizedPropertyin classDecorator
-
getProperty
- Specified by:
getPropertyin interfaceGamePiece- Specified by:
getPropertyin interfacePropertySource- Overrides:
getPropertyin classDecorator
-
draw
Description copied from interface:GamePieceDraw this GamePiece -
boundingBox
Description copied from interface:GamePieceThe area which this GamePiece occupies when drawn at the point (0,0)- Specified by:
boundingBoxin interfaceGamePiece
-
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. -
myGetType
- Specified by:
myGetTypein classDecorator- Returns:
- the type of this trait alone
- See Also:
Decorator.getType()
-
myGetState
- Specified by:
myGetStatein classDecorator- Returns:
- the state of this trait alone
- See Also:
Decorator.getState()
-
mySetState
Description copied from class:DecoratorSet just the state of this trait- Specified by:
mySetStatein classDecorator- See Also:
Decorator.myGetState()
-
getDescription
Description copied from interface:EditablePieceA plain-English description of this type of piece- Specified by:
getDescriptionin interfaceEditablePiece
-
getHelpFile
- Specified by:
getHelpFilein interfaceEditablePiece
-
getEditor
Description copied from interface:EditablePieceGet the configurer for this trait- Specified by:
getEditorin interfaceEditablePiece- Overrides:
getEditorin classDecorator
-
getPropertyNames
Return Property names exposed by this trait- Specified by:
getPropertyNamesin interfacePropertyNameSource- Overrides:
getPropertyNamesin classDecorator
-
Immobilized(String, GamePiece)instead.