VASSAL.counters
Class Marker

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

public class Marker
extends Decorator
implements EditablePiece

A generic Decorator that retains in its state the value of a property. That is, if setProperty() is invoked with a key that's one of getKeys(), the String value of that property will be reflected in the myGetState() method.


Field Summary
static java.lang.String ID
           
protected  java.lang.String[] keys
           
protected  java.lang.String[] values
           
 
Fields inherited from class VASSAL.counters.Decorator
piece
 
Constructor Summary
Marker()
           
Marker(java.lang.String type, GamePiece p)
           
 
Method Summary
 java.awt.Rectangle boundingBox()
          The area which this GamePiece occupies when drawn at the point (0,0)
 void draw(java.awt.Graphics g, int x, int y, java.awt.Component obs, double zoom)
          Draw this GamePiece
 java.lang.String getDescription()
          A plain-English description of this type of piece
 HelpFile getHelpFile()
           
 java.lang.String[] getKeys()
           
 java.lang.String getName()
          The plain English name for this piece
 java.lang.Object getProperty(java.lang.Object key)
           
 java.awt.Shape getShape()
          The shape of the piece from the user's viewpoint.
protected  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 state)
          Set just the state of this trait
 void mySetType(java.lang.String s)
          Set the type information for this piece.
 void setProperty(java.lang.Object key, java.lang.Object value)
          Other properties, possibly game-specific, can be associated with a piece.
 
Methods inherited from class VASSAL.counters.Decorator
getDecorator, getEditor, 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.EditablePiece
getEditor
 
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

keys

protected java.lang.String[] keys

values

protected java.lang.String[] values
Constructor Detail

Marker

public Marker()

Marker

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

getKeys

public java.lang.String[] getKeys()

mySetType

public void mySetType(java.lang.String s)
Description copied from interface: EditablePiece
Set the type information for this piece. See Decorator.myGetType()
Specified by:
mySetType in interface EditablePiece

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
Specified by:
draw in interface GamePiece
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.

getName

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

boundingBox

public java.awt.Rectangle boundingBox()
Description copied from interface: GamePiece
The area which this GamePiece occupies when drawn at the point (0,0)
Specified by:
boundingBox in interface GamePiece

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.
Specified by:
getShape in interface GamePiece

getProperty

public java.lang.Object getProperty(java.lang.Object key)
Specified by:
getProperty in interface GamePiece
Overrides:
getProperty in class Decorator

setProperty

public void setProperty(java.lang.Object key,
                        java.lang.Object value)
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.
Specified by:
setProperty in interface GamePiece
Overrides:
setProperty in class Decorator

myGetState

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

mySetState

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

myGetType

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

myGetKeyCommands

protected KeyCommand[] myGetKeyCommands()
Overrides:
myGetKeyCommands in class Decorator
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 Decorator
Following copied from class: VASSAL.counters.Decorator
Parameters:
stroke -  
Returns:
null if no effect
See Also:
Decorator.keyEvent(javax.swing.KeyStroke)

getDescription

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

getHelpFile

public HelpFile getHelpFile()
Specified by:
getHelpFile in interface EditablePiece