VASSAL.counters
Class TableInfo

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

public class TableInfo
extends Decorator
implements EditablePiece

A Decorator class that endows a GamePiece with an editable spreadsheet (i.e. JTable)


Field Summary
protected  java.lang.String command
           
protected  javax.swing.JDialog frame
           
static java.lang.String ID
           
protected  KeyCommand launch
           
protected  char launchKey
           
protected  int nCols
           
protected  int nRows
           
protected  java.lang.String oldState
           
protected  javax.swing.JTable table
           
protected  java.lang.String values
           
 
Constructor Summary
TableInfo()
           
TableInfo(java.lang.String type, GamePiece p)
           
 
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)
           
 int getColumnCount()
           
 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
 int getRowCount()
           
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.
 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, keyEvent, 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, keyEvent, setId, setMap, setParent, setPosition, setProperty, setState
 

Field Detail

ID

public static final java.lang.String ID
See Also:
Constant Field Values

values

protected java.lang.String values

oldState

protected java.lang.String oldState

nRows

protected int nRows

nCols

protected int nCols

command

protected java.lang.String command

launchKey

protected char launchKey

launch

protected KeyCommand launch

table

protected javax.swing.JTable table

frame

protected javax.swing.JDialog frame
Constructor Detail

TableInfo

public TableInfo()

TableInfo

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

getRowCount

public int getRowCount()

getColumnCount

public int getColumnCount()

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

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

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

myGetState

public java.lang.String myGetState()
Specified by:
myGetState in class 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

Specified by:
mySetState in class Decorator
See Also:
Decorator.myGetState()

myGetType

public java.lang.String myGetType()
Specified by:
myGetType in class Decorator
Returns:
the type of this trait alone
See Also:
Decorator.getType()

myGetKeyCommands

protected KeyCommand[] myGetKeyCommands()
Specified by:
myGetKeyCommands in class 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

Specified by:
myKeyEvent in class 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

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