VASSAL.counters
Class Footprint

java.lang.Object
  |
  +--VASSAL.counters.Decorator
        |
        +--VASSAL.counters.MovementMarkable
              |
              +--VASSAL.counters.Footprint
All Implemented Interfaces:
EditablePiece, GamePiece, StateMergeable

public class Footprint
extends MovementMarkable


Inner Class Summary
protected static class Footprint.Ed
          Key Command Global Visibility Circle Radius Fill Color Line Color Selected Transparency Unselected Transparency Edge Buffer Display Limit Edge Buffer Point Limit
 
Field Summary
protected  int circleRadius
           
protected static int DEFAULT_CIRCLE_RADIUS
           
protected static int DEFAULT_EDGE_DISPLAY_BUFFER
           
protected static int DEFAULT_EDGE_POINT_BUFFER
           
protected static java.awt.Color DEFAULT_FILL_COLOR
           
protected static java.lang.Boolean DEFAULT_GLOBALLY_VISIBLE
           
protected static java.lang.Boolean DEFAULT_INITIALLY_VISIBLE
           
protected static java.awt.Color DEFAULT_LINE_COLOR
           
protected static java.lang.String DEFAULT_MENU_COMMAND
           
protected static int DEFAULT_SELECTED_TRANSPARENCY
           
protected static char DEFAULT_TRAIL_KEY
           
protected static int DEFULT_UNSELECTED_TRANSPARENCY
           
protected  int edgeDisplayBuffer
           
protected  int edgePointBuffer
           
protected  java.awt.Color fillColor
           
protected  java.awt.Font font
           
protected  boolean globallyVisible
           
protected  boolean globalVisibility
           
static java.lang.String ID
           
protected  boolean initiallyVisible
           
protected  double lastZoom
           
protected static float LINE_WIDTH
           
protected  java.awt.Color lineColor
           
protected  double lineWidth
           
protected  boolean localVisibility
           
protected  int maxX
           
protected  int maxY
           
protected  java.lang.String menuCommand
           
protected  int minX
           
protected  int minY
           
protected  java.awt.Rectangle myBoundingBox
           
protected  java.util.Vector pointList
           
protected  int selectedTransparency
           
protected  java.lang.String startMapId
           
protected  javax.swing.KeyStroke trailKey
           
protected  int unSelectedTransparency
           
 
Fields inherited from class VASSAL.counters.Decorator
piece
 
Constructor Summary
Footprint()
           
Footprint(java.lang.String type, GamePiece p)
           
 
Method Summary
protected  void addPoint(java.awt.Point p)
          Add Point to list and adjust the overall boundingBox to encompass the trail.
 java.awt.Rectangle boundingBox()
          Return a bounding box covering the whole trail if it is visible, otherwise just return the standard piece bounding box
protected  void clearTrail()
           
 void draw(java.awt.Graphics g, int x, int y, java.awt.Component obs, double zoom)
          Draw this GamePiece
protected  void drawPoint(java.awt.Graphics g, java.awt.Point p, double zoom, int elementCount)
          Draw a Circle at the given point.
protected  void drawTrack(java.awt.Graphics g, int x1, int y1, int x2, int y2)
          Draw a track from one Point to another.
 java.lang.String getDescription()
          A plain-English description of this type of piece
 PieceEditor getEditor()
          Get the configurer for this trait
 HelpFile getHelpFile()
           
 java.awt.Rectangle getMyBoundingBox()
          Return the boundingBox including the trail
 java.lang.String getName()
          The plain English name for this piece
protected  java.util.Enumeration getPointList()
           
 java.awt.Shape getShape()
          The shape of the piece from the user's viewpoint.
protected  java.awt.Image getTrailImage(int elementCount)
          Override this method to return an Image to display within each trail circle
protected  java.lang.String getTrailText(int elementCount)
          Override this method to return text to display within each trail circle.
protected  boolean isTrailVisible()
          Global Visibility means all players see the same trail Local Visibility means each player controls their own trail visibility
 KeyCommand[] myGetKeyCommands()
           
 java.lang.String myGetState()
           
 java.lang.String myGetType()
           
 Command myKeyEvent(javax.swing.KeyStroke stroke)
          The response of this trait alone to the given KeyStroke
 void mySetState(java.lang.String newState)
          Set just the state of this trait
 void mySetType(java.lang.String type)
          Type is the character command that toggles footprint visiblity
 void redraw()
           
 void setMoved(boolean justMoved)
          setMoved is called with an argument of true each time the piece is moved.
 void setProperty(java.lang.Object key, java.lang.Object val)
          Other properties, possibly game-specific, can be associated with a piece.
 
Methods inherited from class VASSAL.counters.MovementMarkable
getProperty, isMoved
 
Methods inherited from class VASSAL.counters.Decorator
getDecorator, getId, getInner, getInnermost, getKeyCommands, getMap, getOutermost, getParent, getPosition, getState, getType, keyEvent, mergeState, setId, setInner, setMap, setParent, setPosition, setState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface VASSAL.counters.GamePiece
getId, getMap, getParent, getPosition, getState, getType, keyEvent, setId, setMap, setParent, setPosition, setState
 

Field Detail

ID

public static final java.lang.String ID

globalVisibility

protected boolean globalVisibility

startMapId

protected java.lang.String startMapId

pointList

protected java.util.Vector pointList

trailKey

protected javax.swing.KeyStroke trailKey

menuCommand

protected java.lang.String menuCommand

initiallyVisible

protected boolean initiallyVisible

globallyVisible

protected boolean globallyVisible

circleRadius

protected int circleRadius

selectedTransparency

protected int selectedTransparency

unSelectedTransparency

protected int unSelectedTransparency

lineColor

protected java.awt.Color lineColor

fillColor

protected java.awt.Color fillColor

edgePointBuffer

protected int edgePointBuffer

edgeDisplayBuffer

protected int edgeDisplayBuffer

DEFAULT_TRAIL_KEY

protected static final char DEFAULT_TRAIL_KEY

DEFAULT_MENU_COMMAND

protected static final java.lang.String DEFAULT_MENU_COMMAND

DEFAULT_INITIALLY_VISIBLE

protected static final java.lang.Boolean DEFAULT_INITIALLY_VISIBLE

DEFAULT_GLOBALLY_VISIBLE

protected static final java.lang.Boolean DEFAULT_GLOBALLY_VISIBLE

DEFAULT_CIRCLE_RADIUS

protected static final int DEFAULT_CIRCLE_RADIUS

DEFAULT_FILL_COLOR

protected static final java.awt.Color DEFAULT_FILL_COLOR

DEFAULT_LINE_COLOR

protected static final java.awt.Color DEFAULT_LINE_COLOR

DEFAULT_SELECTED_TRANSPARENCY

protected static final int DEFAULT_SELECTED_TRANSPARENCY

DEFULT_UNSELECTED_TRANSPARENCY

protected static final int DEFULT_UNSELECTED_TRANSPARENCY

DEFAULT_EDGE_POINT_BUFFER

protected static final int DEFAULT_EDGE_POINT_BUFFER

DEFAULT_EDGE_DISPLAY_BUFFER

protected static final int DEFAULT_EDGE_DISPLAY_BUFFER

LINE_WIDTH

protected static final float LINE_WIDTH

minX

protected int minX

minY

protected int minY

maxX

protected int maxX

maxY

protected int maxY

myBoundingBox

protected java.awt.Rectangle myBoundingBox

font

protected java.awt.Font font

lastZoom

protected double lastZoom

localVisibility

protected boolean localVisibility

lineWidth

protected double lineWidth
Constructor Detail

Footprint

public Footprint()

Footprint

public Footprint(java.lang.String type,
                 GamePiece p)
Method Detail

getPointList

protected java.util.Enumeration getPointList()

mySetState

public void mySetState(java.lang.String newState)
Description copied from class: Decorator
Set just the state of this trait
Overrides:
mySetState in class MovementMarkable
Following copied from class: VASSAL.counters.Decorator
See Also:
Decorator.myGetState()

myGetState

public java.lang.String myGetState()
Overrides:
myGetState in class MovementMarkable
Following copied from class: VASSAL.counters.Decorator
Returns:
the state of this trait alone
See Also:
Decorator.getState()

mySetType

public void mySetType(java.lang.String type)
Type is the character command that toggles footprint visiblity
Overrides:
mySetType in class MovementMarkable

myGetType

public java.lang.String myGetType()
Overrides:
myGetType in class MovementMarkable
Following copied from class: VASSAL.counters.Decorator
Returns:
the type of this trait alone
See Also:
Decorator.getType()

setProperty

public void setProperty(java.lang.Object key,
                        java.lang.Object val)
Description copied from interface: GamePiece
Other properties, possibly game-specific, can be associated with a piece. The properties may or may not need to be encoded in the piece's GamePiece.getState() method.
Overrides:
setProperty in class MovementMarkable

setMoved

public void setMoved(boolean justMoved)
setMoved is called with an argument of true each time the piece is moved. The argiment is false when the unit is marked as not moved.
Overrides:
setMoved in class MovementMarkable

clearTrail

protected void clearTrail()

getHelpFile

public HelpFile getHelpFile()
Overrides:
getHelpFile in class MovementMarkable

addPoint

protected void addPoint(java.awt.Point p)
Add Point to list and adjust the overall boundingBox to encompass the trail.

redraw

public void redraw()

getDescription

public java.lang.String getDescription()
Description copied from interface: EditablePiece
A plain-English description of this type of piece
Overrides:
getDescription in class MovementMarkable

draw

public void draw(java.awt.Graphics g,
                 int x,
                 int y,
                 java.awt.Component obs,
                 double zoom)
Description copied from interface: GamePiece
Draw this GamePiece
Overrides:
draw in class MovementMarkable
Following copied from interface: VASSAL.counters.GamePiece
Parameters:
g -  
x - x-location of the center of the piece
y - y-location of the center of the piece
obs - the Component on which this piece is being drawn
zoom - the scaling factor.

drawPoint

protected void drawPoint(java.awt.Graphics g,
                         java.awt.Point p,
                         double zoom,
                         int elementCount)
Draw a Circle at the given point. Override this method to do something different (eg. display an Icon)

drawTrack

protected void drawTrack(java.awt.Graphics g,
                         int x1,
                         int y1,
                         int x2,
                         int y2)
Draw a track from one Point to another. Don't draw under the circle as it shows through with transparency turned on.

getTrailImage

protected java.awt.Image getTrailImage(int elementCount)
Override this method to return an Image to display within each trail circle

getTrailText

protected java.lang.String getTrailText(int elementCount)
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

public java.awt.Rectangle boundingBox()
Return a bounding box covering the whole trail if it is visible, otherwise just return the standard piece bounding box
Overrides:
boundingBox in class MovementMarkable

getMyBoundingBox

public java.awt.Rectangle getMyBoundingBox()
Return the boundingBox including the trail

getShape

public java.awt.Shape 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. Like GamePiece.boundingBox(), it assumes the position is (0,0) and must be translated to the actual location where the piece is being drawn.
Overrides:
getShape in class MovementMarkable

getName

public java.lang.String getName()
Description copied from interface: GamePiece
The plain English name for this piece
Overrides:
getName in class MovementMarkable

myGetKeyCommands

public KeyCommand[] myGetKeyCommands()
Overrides:
myGetKeyCommands in class MovementMarkable
Following copied from class: VASSAL.counters.Decorator
Returns:
the commands for this trait alone
See Also:
Decorator.getKeyCommands()

myKeyEvent

public Command myKeyEvent(javax.swing.KeyStroke stroke)
Description copied from class: Decorator
The response of this trait alone to the given KeyStroke
Overrides:
myKeyEvent in class MovementMarkable
Following copied from class: VASSAL.counters.Decorator
Parameters:
stroke -  
Returns:
null if no effect
See Also:
Decorator.keyEvent(javax.swing.KeyStroke)

getEditor

public PieceEditor getEditor()
Description copied from interface: EditablePiece
Get the configurer for this trait
Overrides:
getEditor in class MovementMarkable