|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--VASSAL.counters.Decorator
|
+--VASSAL.counters.FreeRotator
A Decorator that rotates a GamePiece to an arbitrary angle
| Field Summary | |
static java.lang.String |
ID
|
| Fields inherited from class VASSAL.counters.Decorator |
piece |
| Constructor Summary | |
FreeRotator()
|
|
FreeRotator(java.lang.String type,
GamePiece inner)
|
|
| Method Summary | |
void |
beginInteractiveRotate()
|
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 |
void |
draw(java.awt.Graphics g,
Map map)
|
double |
getAngle()
|
double |
getAngleInRadians()
|
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 |
java.awt.Rectangle |
getRotatedBounds()
|
java.awt.Image |
getRotatedImage(double angle,
java.awt.Component obs)
|
java.awt.Shape |
getShape()
The shape of the piece from the user's viewpoint. |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
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 type)
Set the type information for this piece. |
void |
setAngle(double angle)
|
void |
setInner(GamePiece p)
Set the inner GamePiece |
void |
setPivot(int x,
int y)
The point around which the piece will pivot while rotating interactively |
void |
setProperty(java.lang.Object key,
java.lang.Object val)
Other properties, possibly game-specific, can be associated with a piece. |
| Methods inherited from class VASSAL.counters.Decorator |
getDecorator, getId, getInner, getInnermost, getKeyCommands, getMap, getOutermost, getParent, getPosition, getProperty, getState, getType, keyEvent, mergeState, setId, 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, getProperty, getState, getType, keyEvent, setId, setMap, setParent, setPosition, setState |
| Field Detail |
public static final java.lang.String ID
| Constructor Detail |
public FreeRotator()
public FreeRotator(java.lang.String type,
GamePiece inner)
| Method Detail |
public java.lang.String getName()
GamePiecegetName in interface GamePiecepublic void setInner(GamePiece p)
DecoratorsetInner in class Decoratorpublic java.awt.Rectangle boundingBox()
GamePieceboundingBox in interface GamePiecepublic double getAngle()
public void setAngle(double angle)
public java.awt.Rectangle getRotatedBounds()
public java.awt.Shape getShape()
GamePieceGamePiece.boundingBox(), it assumes the position is (0,0) and must be translated
to the actual location where the piece is being drawn.getShape in interface GamePiecepublic double getAngleInRadians()
public void mySetType(java.lang.String type)
EditablePieceDecorator.myGetType()mySetType in interface EditablePiece
public void draw(java.awt.Graphics g,
int x,
int y,
java.awt.Component obs,
double zoom)
GamePiecedraw in interface GamePieceVASSAL.counters.GamePieceg - 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.
public void draw(java.awt.Graphics g,
Map map)
draw in interface Drawablepublic java.lang.String myGetType()
myGetType in class DecoratorVASSAL.counters.DecoratorDecorator.getType()public java.lang.String myGetState()
myGetState in class DecoratorVASSAL.counters.DecoratorDecorator.getState()public void mySetState(java.lang.String state)
DecoratormySetState in class DecoratorVASSAL.counters.DecoratorDecorator.myGetState()public KeyCommand[] myGetKeyCommands()
myGetKeyCommands in class DecoratorVASSAL.counters.DecoratorDecorator.getKeyCommands()public Command myKeyEvent(javax.swing.KeyStroke stroke)
DecoratormyKeyEvent in class DecoratorVASSAL.counters.Decoratorstroke - Decorator.keyEvent(javax.swing.KeyStroke)public void beginInteractiveRotate()
public void setPivot(int x,
int y)
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListener
public void setProperty(java.lang.Object key,
java.lang.Object val)
GamePieceGamePiece.getState() method.setProperty in interface GamePiecesetProperty in class Decoratorpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListener
public java.awt.Image getRotatedImage(double angle,
java.awt.Component obs)
public java.lang.String getDescription()
EditablePiecegetDescription in interface EditablePiecepublic HelpFile getHelpFile()
getHelpFile in interface EditablePiecepublic PieceEditor getEditor()
EditablePiecegetEditor in interface EditablePiecegetEditor in class Decorator
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||