Package VASSAL.counters
Class Footprint
java.lang.Object
VASSAL.counters.Decorator
VASSAL.counters.MovementMarkable
VASSAL.counters.Footprint
- All Implemented Interfaces:
PropertyNameSource,PropertySource,EditablePiece,GamePiece,PropertyExporter,StateMergeable,TranslatablePiece,PersistentPropertyContainer
public class Footprint extends MovementMarkable
Displays a movement trail indicating where a piece has been moved
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classFootprint.EdKey Command Global Visibility Circle Radius Fill Color Line Color Selected Transparency Unselected Transparency Edge Buffer Display Limit Edge Buffer Point Limit -
Field Summary
Fields inherited from interface VASSAL.counters.PropertyExporter
LOCALIZED_NAMEFields inherited from interface VASSAL.i18n.TranslatablePiece
PREFIX -
Constructor Summary
-
Method Summary
Modifier and Type Method Description protected voidaddPoint(Point p)Add Point to list and adjust the overall boundingBox to encompass the trail.RectangleboundingBox()Return a bounding box covering the whole trail if it is visible, otherwise just return the standard piece bounding boxprotected voidclearTrail()voiddraw(Graphics g, int x, int y, Component obs, double zoom)Draw this GamePieceprotected voiddrawPoint(Graphics g, Point p, double zoom, int elementCount)Draw a Circle at the given point.protected voiddrawTrack(Graphics g, int x1, int y1, int x2, int y2, double zoom)Draw a track from one Point to another.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)RectanglegetMyBoundingBox()Return the boundingBox including the trailStringgetName()The plain English name for this pieceprotected Enumeration<Point>getPointList()Deprecated, for removal: This API element is subject to removal in a future version.ObjectgetProperty(Object key)ShapegetShape()The shape of the piece from the user's viewpoint.protected ImagegetTrailImage(int elementCount)Override this method to return an Image to display within each trail circleprotected StringgetTrailText(int elementCount)Override this method to return text to display within each trail circle.protected booleanisTrailVisible()Global Visibility means all players see the same trail Local Visibility means each player controls their own trail visibilityKeyCommand[]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)Type is the character command that toggles footprint visiblityprotected voidrecordCurrentPosition()voidredraw()voidsetMoved(boolean justMoved)setMoved is called with an argument of true each time the piece is moved.voidsetProperty(Object key, Object val)Other properties, possibly game-specific, can be associated with a piece.Methods inherited from class VASSAL.counters.MovementMarkable
getPropertyNames, isMovedMethods 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, keyEvent, mergeState, putOldProperties, repack, reportDataError, reportDataError, reportDataError, setId, setInner, setMap, setOldProperties, setOldProperties, setParent, setPersistentProperty, setPosition, 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, setStateMethods inherited from interface VASSAL.counters.PropertyExporter
getProperties
-
Field Details
-
ID
- See Also:
- Constant Field Values
-
globalVisibility
protected boolean globalVisibility -
startMapId
-
pointList
-
trailKey
-
trailKeyOn
-
trailKeyOff
-
trailKeyClear
-
initiallyVisible
protected boolean initiallyVisible -
globallyVisible
protected boolean globallyVisible -
circleRadius
protected int circleRadius -
selectedTransparency
protected int selectedTransparency -
unSelectedTransparency
protected int unSelectedTransparency -
lineColor
-
fillColor
-
edgePointBuffer
protected int edgePointBuffer -
edgeDisplayBuffer
protected int edgeDisplayBuffer -
DEFAULT_TRAIL_KEY
protected static final char DEFAULT_TRAIL_KEY- See Also:
- Constant Field Values
-
DEFAULT_MENU_COMMAND
- See Also:
- Constant Field Values
-
DEFAULT_INITIALLY_VISIBLE
-
DEFAULT_GLOBALLY_VISIBLE
-
DEFAULT_CIRCLE_RADIUS
protected static final int DEFAULT_CIRCLE_RADIUS- See Also:
- Constant Field Values
-
DEFAULT_FILL_COLOR
-
DEFAULT_LINE_COLOR
-
DEFAULT_SELECTED_TRANSPARENCY
protected static final int DEFAULT_SELECTED_TRANSPARENCY- See Also:
- Constant Field Values
-
DEFULT_UNSELECTED_TRANSPARENCY
protected static final int DEFULT_UNSELECTED_TRANSPARENCY- See Also:
- Constant Field Values
-
DEFAULT_EDGE_POINT_BUFFER
protected static final int DEFAULT_EDGE_POINT_BUFFER- See Also:
- Constant Field Values
-
DEFAULT_EDGE_DISPLAY_BUFFER
protected static final int DEFAULT_EDGE_DISPLAY_BUFFER- See Also:
- Constant Field Values
-
LINE_WIDTH
protected static final float LINE_WIDTH- See Also:
- Constant Field Values
-
myBoundingBox
-
font
-
lastZoom
protected double lastZoom -
localVisibility
protected boolean localVisibility -
initialized
protected boolean initialized -
lineWidth
protected double lineWidth
-
-
Constructor Details
-
Footprint
public Footprint() -
Footprint
-
-
Method Details
-
getPointList
Deprecated, for removal: This API element is subject to removal in a future version.UsepointListdirectly. -
mySetState
Description copied from class:DecoratorSet just the state of this trait- Overrides:
mySetStatein classMovementMarkable- See Also:
Decorator.myGetState()
-
myGetState
- Overrides:
myGetStatein classMovementMarkable- Returns:
- the state of this trait alone
- See Also:
Decorator.getState()
-
mySetType
Type is the character command that toggles footprint visiblity- Specified by:
mySetTypein interfaceEditablePiece- Overrides:
mySetTypein classMovementMarkable
-
myGetType
- Overrides:
myGetTypein classMovementMarkable- Returns:
- the type of this trait alone
- See Also:
Decorator.getType()
-
setProperty
Description copied from interface:GamePieceOther properties, possibly game-specific, can be associated with a piece. The properties may or may not need to be encoded in the piece'sGamePiece.getState()method.- Specified by:
setPropertyin interfaceGamePiece- Overrides:
setPropertyin classMovementMarkable
-
getLocalizedProperty
- Specified by:
getLocalizedPropertyin interfacePropertySource- Overrides:
getLocalizedPropertyin classMovementMarkable
-
getProperty
- Specified by:
getPropertyin interfaceGamePiece- Specified by:
getPropertyin interfacePropertySource- Overrides:
getPropertyin classMovementMarkable
-
setMoved
public void setMoved(boolean justMoved)setMoved is called with an argument of true each time the piece is moved. The argument is false when the unit is marked as not moved.- Overrides:
setMovedin classMovementMarkable
-
recordCurrentPosition
protected void recordCurrentPosition() -
clearTrail
protected void clearTrail() -
getHelpFile
- Specified by:
getHelpFilein interfaceEditablePiece- Overrides:
getHelpFilein classMovementMarkable
-
addPoint
Add Point to list and adjust the overall boundingBox to encompass the trail. -
redraw
public void redraw() -
getDescription
Description copied from interface:EditablePieceA plain-English description of this type of piece- Specified by:
getDescriptionin interfaceEditablePiece- Overrides:
getDescriptionin classMovementMarkable
-
draw
Description copied from interface:GamePieceDraw this GamePiece- Specified by:
drawin interfaceGamePiece- Overrides:
drawin classMovementMarkablex- x-location of the center of the piecey- y-location of the center of the pieceobs- the Component on which this piece is being drawnzoom- the scaling factor.
-
drawPoint
Draw a Circle at the given point. Override this method to do something different (eg. display an Icon) -
drawTrack
Draw a track from one Point to another. Don't draw under the circle as it shows through with transparency turned on. -
getTrailImage
Override this method to return an Image to display within each trail circle -
getTrailText
Override this method to return text to display within each trail circle. Note, there will normally be only room for 1 character. -
isTrailVisible
protected boolean isTrailVisible()Global Visibility means all players see the same trail Local Visibility means each player controls their own trail visibility -
boundingBox
Return a bounding box covering the whole trail if it is visible, otherwise just return the standard piece bounding box- Specified by:
boundingBoxin interfaceGamePiece- Overrides:
boundingBoxin classMovementMarkable
-
getMyBoundingBox
Return the boundingBox including the trail -
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.- Specified by:
getShapein interfaceGamePiece- Overrides:
getShapein classMovementMarkable
-
getName
Description copied from interface:GamePieceThe plain English name for this piece- Specified by:
getNamein interfaceGamePiece- Overrides:
getNamein classMovementMarkable
-
myGetKeyCommands
- Overrides:
myGetKeyCommandsin classMovementMarkable- 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- Overrides:
myKeyEventin classMovementMarkable- Parameters:
stroke- Stroke to apply- Returns:
- Generated Command or null if no effect
- See Also:
Decorator.keyEvent(javax.swing.KeyStroke)
-
getEditor
Description copied from interface:EditablePieceGet the configurer for this trait- Specified by:
getEditorin interfaceEditablePiece- Overrides:
getEditorin classMovementMarkable
-
getI18nData
Description copied from class:DecoratorReturn I18n data for this piece- Specified by:
getI18nDatain interfaceTranslatablePiece- Overrides:
getI18nDatain classMovementMarkable- Returns:
- I18n data
-
pointListdirectly.