VASSAL.counters
Class Embellishment
java.lang.Object
|
+--VASSAL.counters.Decorator
|
+--VASSAL.counters.Embellishment
- All Implemented Interfaces:
- EditablePiece, GamePiece, StateMergeable
- public class Embellishment
- extends Decorator
- implements EditablePiece
The "Layer" trait. Contains a list of images that the user may cycle through.
The current image is superimposed over the inner piece. The entire layer may
be activated or deactivated.
| 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 |
OLD_ID
public static final java.lang.String OLD_ID
ID
public static final java.lang.String ID
activateKey
protected java.lang.String activateKey
upKey
protected java.lang.String upKey
downKey
protected java.lang.String downKey
activateModifiers
protected int activateModifiers
upModifiers
protected int upModifiers
downModifiers
protected int downModifiers
upCommand
protected java.lang.String upCommand
downCommand
protected java.lang.String downCommand
activateCommand
protected java.lang.String activateCommand
resetCommand
protected java.lang.String resetCommand
resetLevel
protected int resetLevel
loopLevels
protected boolean loopLevels
resetKey
protected javax.swing.KeyStroke resetKey
value
protected int value
activationStatus
protected java.lang.String activationStatus
nValues
protected int nValues
xOff
protected int xOff
yOff
protected int yOff
imageName
protected java.lang.String[] imageName
commonName
protected java.lang.String[] commonName
size
protected java.awt.Rectangle[] size
drawUnderneathWhenSelected
protected boolean drawUnderneathWhenSelected
commands
protected KeyCommand[] commands
Embellishment
public Embellishment()
Embellishment
public Embellishment(java.lang.String type,
GamePiece d)
isActive
public boolean isActive()
setActive
public void setActive(boolean val)
getValue
public int getValue()
setValue
public void setValue(int val)
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
getName
public java.lang.String getName()
- Description copied from interface:
GamePiece
- The plain English name for this piece
- Specified by:
getName in interface GamePiece
mySetState
public void mySetState(java.lang.String s)
- 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()
oldGetType
public java.lang.String oldGetType()
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()
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 piecey - y-location of the center of the pieceobs - the Component on which this piece is being drawnzoom - the scaling factor.
myGetKeyCommands
public 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)
getCurrentImage
protected java.awt.Image getCurrentImage()
throws java.io.IOException
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
getCurrentImageBounds
public java.awt.Rectangle getCurrentImageBounds()
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
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
getLayerWithMatchingActivateCommand
public static Embellishment getLayerWithMatchingActivateCommand(GamePiece piece,
javax.swing.KeyStroke stroke,
boolean active)
- If the argument GamePiece contains a Layer whose "activate" command matches the given keystroke,
and whose active status matches the boolean argument, return that Layer