VASSAL.counters
Class ReportState

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

public class ReportState
extends Decorator
implements EditablePiece

A GamePiece with this trait will echo the piece's current name when any of a given key commands are pressed (and after they take effect)


Inner Class Summary
static class ReportState.Ed
           
 
Field Summary
static java.lang.String ID
           
 
Constructor Summary
ReportState()
           
ReportState(java.lang.String type, GamePiece inner)
           
 
Method Summary
 java.awt.Rectangle boundingBox()
          The area which this GamePiece occupies when drawn at the point given by getPosition().
 void draw(java.awt.Graphics g, int x, int y, java.awt.Component obs, double zoom)
           
 java.lang.String getDescription()
          A plain-English description of this type of piece
 PieceEditor getEditor()
          Get the configurer for this trait
 HelpFile getHelpFile()
           
 java.lang.String getName()
          The plain English name for this piece
 Command keyEvent(javax.swing.KeyStroke stroke)
          Keyboard events are forward to this method when a piece is selected The GamePiece can respond in any way it likes
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 newState)
          Set just the state of this trait
 void mySetType(java.lang.String type)
          Set the type information for this piece.
 java.awt.Rectangle selectionBounds()
          The area which is considered part of this GamePiece for purposes of selecting it with the mouse
 
Methods inherited from class VASSAL.counters.Decorator
getDecorator, getId, getInner, getInnermost, getKeyCommands, getMap, getOutermost, getParent, getPosition, getProperty, getState, getType, mergeState, setId, setInner, setMap, setParent, setPosition, setProperty, 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, getProperty, getState, getType, setId, setMap, setParent, setPosition, setProperty, setState
 

Field Detail

ID

public static final java.lang.String ID
Constructor Detail

ReportState

public ReportState()

ReportState

public ReportState(java.lang.String type,
                   GamePiece inner)
Method Detail

boundingBox

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

draw

public void draw(java.awt.Graphics g,
                 int x,
                 int y,
                 java.awt.Component obs,
                 double zoom)
Specified by:
draw in interface GamePiece

getName

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

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()

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()

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()

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)

keyEvent

public Command keyEvent(javax.swing.KeyStroke stroke)
Description copied from interface: GamePiece
Keyboard events are forward to this method when a piece is selected The GamePiece can respond in any way it likes
Specified by:
keyEvent in interface GamePiece
Overrides:
keyEvent in class Decorator
Following copied from interface: VASSAL.counters.GamePiece
Returns:
a Command that, when executed, will invoke the same response. Usually a ChangePiece command.
See Also:
ForwardToKeyBuffer

mySetState

public void mySetState(java.lang.String newState)
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()

selectionBounds

public java.awt.Rectangle selectionBounds()
Description copied from interface: GamePiece
The area which is considered part of this GamePiece for purposes of selecting it with the mouse
Specified by:
selectionBounds in interface GamePiece

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

mySetType

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

getEditor

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