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 class
Immobilized.MoveIfSelected
class
Immobilized.UseAlt
class
Immobilized.UseShift
-
Field Summary
Fields Modifier and Type Field Description protected static char
ALT_BAND_SELECT
protected static char
ALT_SELECT
protected boolean
altToBandSelect
protected boolean
altToSelect
protected EventFilter
bandselectFilter
static String
ID
protected static char
IGNORE_GRID
protected boolean
ignoreGrid
protected static char
MOVE_NORMAL
protected static char
MOVE_SELECTED
protected EventFilter
moveFilter
protected boolean
moveIfSelected
protected static EventFilter
NEVER
protected static char
NEVER_BAND_SELECT
protected static char
NEVER_MOVE
protected static char
NEVER_SELECT
protected boolean
neverBandSelect
protected boolean
neverMove
protected boolean
neverSelect
protected EventFilter
selectFilter
protected static char
SHIFT_SELECT
protected boolean
shiftToSelect
Fields 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 Rectangle
boundingBox()
The area which this GamePiece occupies when drawn at the point (0,0)void
draw(Graphics g, int x, int y, Component obs, double zoom)
Draw this GamePieceString
getDescription()
A plain-English description of this type of piecePieceEditor
getEditor()
Get the configurer for this traitHelpFile
getHelpFile()
Object
getLocalizedProperty(Object key)
String
getName()
The plain English name for this pieceObject
getProperty(Object key)
List<String>
getPropertyNames()
Return Property names exposed by this traitShape
getShape()
The shape of the piece from the user's viewpoint.KeyCommand[]
myGetKeyCommands()
String
myGetState()
String
myGetType()
Command
myKeyEvent(KeyStroke e)
The response of this trait alone to the given KeyStrokevoid
mySetState(String s)
Set just the state of this traitvoid
mySetType(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, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface VASSAL.counters.GamePiece
getId, getLocalizedName, getMap, getParent, getPosition, getState, getType, keyEvent, setId, setMap, setParent, setPosition, setProperty, setState
Methods 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:EditablePiece
Set the type information for this piece. SeeDecorator.myGetType()
- Specified by:
mySetType
in interfaceEditablePiece
-
getName
Description copied from interface:GamePiece
The plain English name for this piece -
myGetKeyCommands
- Specified by:
myGetKeyCommands
in classDecorator
- Returns:
- the commands for this trait alone
- See Also:
Decorator.getKeyCommands()
-
myKeyEvent
Description copied from class:Decorator
The response of this trait alone to the given KeyStroke- Specified by:
myKeyEvent
in classDecorator
- Parameters:
e
- Stroke to apply- Returns:
- Generated Command or null if no effect
- See Also:
Decorator.keyEvent(javax.swing.KeyStroke)
-
getLocalizedProperty
- Specified by:
getLocalizedProperty
in interfacePropertySource
- Overrides:
getLocalizedProperty
in classDecorator
-
getProperty
- Specified by:
getProperty
in interfaceGamePiece
- Specified by:
getProperty
in interfacePropertySource
- Overrides:
getProperty
in classDecorator
-
draw
Description copied from interface:GamePiece
Draw this GamePiece -
boundingBox
Description copied from interface:GamePiece
The area which this GamePiece occupies when drawn at the point (0,0)- Specified by:
boundingBox
in interfaceGamePiece
-
getShape
Description copied from interface:GamePiece
The 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:
myGetType
in classDecorator
- Returns:
- the type of this trait alone
- See Also:
Decorator.getType()
-
myGetState
- Specified by:
myGetState
in classDecorator
- Returns:
- the state of this trait alone
- See Also:
Decorator.getState()
-
mySetState
Description copied from class:Decorator
Set just the state of this trait- Specified by:
mySetState
in classDecorator
- See Also:
Decorator.myGetState()
-
getDescription
Description copied from interface:EditablePiece
A plain-English description of this type of piece- Specified by:
getDescription
in interfaceEditablePiece
-
getHelpFile
- Specified by:
getHelpFile
in interfaceEditablePiece
-
getEditor
Description copied from interface:EditablePiece
Get the configurer for this trait- Specified by:
getEditor
in interfaceEditablePiece
- Overrides:
getEditor
in classDecorator
-
getPropertyNames
Return Property names exposed by this trait- Specified by:
getPropertyNames
in interfacePropertyNameSource
- Overrides:
getPropertyNames
in classDecorator
-
Immobilized(String, GamePiece)
instead.