VASSAL.counters
Class Obscurable

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

public class Obscurable
extends Decorator
implements EditablePiece


Field Summary
protected static char BACKGROUND
           
protected  KeyCommand[] commands
           
protected  char displayStyle
           
protected  java.lang.String hideCommand
           
static java.lang.String ID
           
protected static char IMAGE
           
protected  java.lang.String imageName
           
protected static char INSET
           
protected  java.lang.String obscuredBy
           
protected  GamePiece obscuredToMeView
           
protected  java.lang.String obscuredToOthersImage
           
protected  GamePiece obscuredToOthersView
           
protected  char obscureKey
           
protected static char PEEK
           
protected  boolean peeking
           
protected  char peekKey
           
 
Constructor Summary
Obscurable()
           
Obscurable(java.lang.String type, GamePiece d)
           
 
Method Summary
protected  java.awt.Rectangle bBoxObscuredToMe()
           
protected  java.awt.Rectangle bBoxObscuredToOthers()
           
 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)
           
protected  void drawObscuredToMe(java.awt.Graphics g, int x, int y, java.awt.Component obs, double zoom)
           
protected  void drawObscuredToOthers(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()
           
 KeyCommand[] getKeyCommands()
          The set of key commands that will populate the piece's right-click menu.
 java.lang.String getName()
          The plain English name for this piece
 java.lang.Object getProperty(java.lang.Object key)
           
 boolean isMaskableBy(java.lang.String id)
          Return true if this piece can be masked/un-masked by the player with the given id
 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 in)
          Set just the state of this trait
 void mySetType(java.lang.String in)
          Set the type information for this piece.
 boolean obscuredToMe()
           
 boolean obscuredToOthers()
           
 java.awt.Rectangle selectionBounds()
          The area which is considered part of this GamePiece for purposes of selecting it with the mouse
 void setProperty(java.lang.Object key, java.lang.Object val)
          The GamePiece should store properties for retrieval (e.g in a Hashtable) It is not necessary that properties stored with this method be retained in the piece's Decorator.getState() method.
 
Methods inherited from class VASSAL.counters.Decorator
getDecorator, getId, getInner, getInnermost, 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
See Also:
Constant Field Values

INSET

protected static final char INSET
See Also:
Constant Field Values

BACKGROUND

protected static final char BACKGROUND
See Also:
Constant Field Values

PEEK

protected static final char PEEK
See Also:
Constant Field Values

IMAGE

protected static final char IMAGE
See Also:
Constant Field Values

obscureKey

protected char obscureKey

peekKey

protected char peekKey

imageName

protected java.lang.String imageName

obscuredToOthersImage

protected java.lang.String obscuredToOthersImage

obscuredBy

protected java.lang.String obscuredBy

hideCommand

protected java.lang.String hideCommand

obscuredToMeView

protected GamePiece obscuredToMeView

obscuredToOthersView

protected GamePiece obscuredToOthersView

peeking

protected boolean peeking

displayStyle

protected char displayStyle

commands

protected KeyCommand[] commands
Constructor Detail

Obscurable

public Obscurable()

Obscurable

public Obscurable(java.lang.String type,
                  GamePiece d)
Method Detail

mySetState

public void mySetState(java.lang.String in)
Description copied from class: Decorator
Set just the state of this trait

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

mySetType

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

Specified by:
mySetType in interface EditablePiece

myGetType

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

myGetState

public java.lang.String myGetState()
Specified by:
myGetState in class Decorator
Returns:
the state of this trait alone
See Also:
Decorator.getState()

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

obscuredToMe

public boolean obscuredToMe()

obscuredToOthers

public boolean obscuredToOthers()

setProperty

public void setProperty(java.lang.Object key,
                        java.lang.Object val)
Description copied from interface: GamePiece
The GamePiece should store properties for retrieval (e.g in a Hashtable) It is not necessary that properties stored with this method be retained in the piece's GamePiece.getState() method.

Specified by:
setProperty in interface GamePiece
Overrides:
setProperty in class Decorator

getProperty

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

draw

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

drawObscuredToMe

protected void drawObscuredToMe(java.awt.Graphics g,
                                int x,
                                int y,
                                java.awt.Component obs,
                                double zoom)

drawObscuredToOthers

protected void drawObscuredToOthers(java.awt.Graphics g,
                                    int x,
                                    int y,
                                    java.awt.Component obs,
                                    double zoom)

bBoxObscuredToMe

protected java.awt.Rectangle bBoxObscuredToMe()

bBoxObscuredToOthers

protected java.awt.Rectangle bBoxObscuredToOthers()

getName

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

Specified by:
getName in interface GamePiece

getKeyCommands

public KeyCommand[] getKeyCommands()
Description copied from class: Decorator
The set of key commands that will populate the piece's right-click menu. The key commands are accessible through the Properties.KEY_COMMANDS property. The commands for a Decorator are a composite of Decorator.myGetKeyCommands() and the commands of its inner piece.

Overrides:
getKeyCommands in class Decorator
Returns:
the commands for this piece and its inner piece

myGetKeyCommands

public KeyCommand[] myGetKeyCommands()
Specified by:
myGetKeyCommands in class Decorator
Returns:
the commands for this trait alone
See Also:
Decorator.getKeyCommands()

isMaskableBy

public boolean isMaskableBy(java.lang.String id)
Return true if this piece can be masked/un-masked by the player with the given id


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