Package VASSAL.counters
Class PlaceMarker
java.lang.Object
VASSAL.counters.Decorator
VASSAL.counters.PlaceMarker
- All Implemented Interfaces:
PropertyNameSource
,PropertySource
,EditablePiece
,GamePiece
,PropertyExporter
,StateMergeable
,TranslatablePiece
,PersistentPropertyContainer
- Direct Known Subclasses:
Replace
public class PlaceMarker extends Decorator implements TranslatablePiece
This Decorator defines a key command to places another counter on top of this one.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
PlaceMarker.Ed
-
Field Summary
Fields Modifier and Type Field Description protected boolean
above
protected static int
ABOVE
protected NamedKeyStroke
afterBurnerKey
protected static int
BELOW
protected KeyCommand
command
protected KeyCommand[]
commands
protected String
description
protected String
gpId
protected GpIdSupport
gpidSupport
static String
ID
protected NamedKeyStroke
key
protected String
markerSpec
protected String
markerText
protected boolean
matchRotation
protected String
newGpId
protected int
placement
protected static int
STACK_BOTTOM
protected static int
STACK_TOP
protected int
xOffset
protected int
yOffset
Fields inherited from interface VASSAL.counters.PropertyExporter
LOCALIZED_NAME
Fields inherited from interface VASSAL.i18n.TranslatablePiece
PREFIX
-
Constructor Summary
Constructors Constructor Description PlaceMarker()
PlaceMarker(String type, GamePiece inner)
-
Method Summary
Modifier and Type Method Description Rectangle
boundingBox()
The area which this GamePiece occupies when drawn at the point (0,0)GamePiece
createBaseMarker()
The marker, with prototypes unexpandedGamePiece
createMarker()
The marker, with prototypes fully expandedvoid
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 traitString
getGpId()
HelpFile
getHelpFile()
PieceI18nData
getI18nData()
Return I18n data for this pieceString
getName()
The plain English name for this pieceShape
getShape()
The shape of the piece from the user's viewpoint.boolean
isMarkerStandalone()
protected KeyCommand[]
myGetKeyCommands()
String
myGetState()
String
myGetType()
Command
myKeyEvent(KeyStroke stroke)
The response of this trait alone to the given KeyStrokevoid
mySetState(String newState)
Set just the state of this traitvoid
mySetType(String type)
Set the type information for this piece.protected Command
placeMarker()
protected void
selectMarker(GamePiece marker)
void
setGpId(String s)
void
updateGpId()
void
updateGpId(GpIdSupport s)
Methods inherited from class VASSAL.counters.Decorator
getCommandDescription, getDecorator, getI18nData, getI18nData, getId, getInner, getInnermost, getKeyCommands, getLocalizedName, getLocalizedProperty, getMap, getOuter, getOutermost, getParent, getPersistentProperty, getPosition, getProperties, getProperty, getPropertyNames, 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, getProperty, getState, getType, keyEvent, setId, setMap, setParent, setPosition, setProperty, setState
Methods inherited from interface VASSAL.counters.PropertyExporter
getProperties
Methods inherited from interface VASSAL.build.module.properties.PropertySource
getLocalizedProperty
-
Field Details
-
ID
- See Also:
- Constant Field Values
-
command
-
key
-
markerSpec
-
markerText
-
xOffset
protected int xOffset -
yOffset
protected int yOffset -
matchRotation
protected boolean matchRotation -
commands
-
afterBurnerKey
-
description
-
gpId
-
newGpId
-
gpidSupport
-
STACK_TOP
protected static final int STACK_TOP- See Also:
- Constant Field Values
-
STACK_BOTTOM
protected static final int STACK_BOTTOM- See Also:
- Constant Field Values
-
ABOVE
protected static final int ABOVE- See Also:
- Constant Field Values
-
BELOW
protected static final int BELOW- See Also:
- Constant Field Values
-
placement
protected int placement -
above
protected boolean above
-
-
Constructor Details
-
PlaceMarker
public PlaceMarker() -
PlaceMarker
-
-
Method Details
-
boundingBox
Description copied from interface:GamePiece
The area which this GamePiece occupies when drawn at the point (0,0)- Specified by:
boundingBox
in interfaceGamePiece
-
draw
Description copied from interface:GamePiece
Draw this GamePiece -
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()
-
myGetState
- Specified by:
myGetState
in classDecorator
- Returns:
- the state of this trait alone
- See Also:
Decorator.getState()
-
myGetType
- Specified by:
myGetType
in classDecorator
- Returns:
- the type of this trait alone
- See Also:
Decorator.getType()
-
myKeyEvent
Description copied from class:Decorator
The response of this trait alone to the given KeyStroke- Specified by:
myKeyEvent
in classDecorator
- Parameters:
stroke
- Stroke to apply- Returns:
- Generated Command or null if no effect
- See Also:
Decorator.keyEvent(javax.swing.KeyStroke)
-
placeMarker
-
selectMarker
-
createMarker
The marker, with prototypes fully expanded- Returns:
- new Marker
-
createBaseMarker
The marker, with prototypes unexpanded- Returns:
- New Base Marker
-
isMarkerStandalone
public boolean isMarkerStandalone()- Returns:
- true if the marker is defined from scratch. Return false if the marker is defined as a component in the Game Piece Palette
-
mySetState
Description copied from class:Decorator
Set just the state of this trait- Specified by:
mySetState
in classDecorator
- See Also:
Decorator.myGetState()
-
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. -
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
-
mySetType
Description copied from interface:EditablePiece
Set the type information for this piece. SeeDecorator.myGetType()
- Specified by:
mySetType
in interfaceEditablePiece
-
getEditor
Description copied from interface:EditablePiece
Get the configurer for this trait- Specified by:
getEditor
in interfaceEditablePiece
- Overrides:
getEditor
in classDecorator
-
getI18nData
Description copied from class:Decorator
Return I18n data for this piece- Specified by:
getI18nData
in interfaceTranslatablePiece
- Overrides:
getI18nData
in classDecorator
- Returns:
- I18n data
-
getGpId
-
setGpId
-
updateGpId
-
updateGpId
public void updateGpId()
-