public class BoardFigure extends ImageFigure
fDisplayBox, fImage
Constructor and Description |
---|
BoardFigure() |
BoardFigure(java.awt.Image img,
java.awt.Point origin) |
BoardFigure(java.lang.String image,
boolean isMobile,
Command command) |
BoardFigure(java.lang.String name,
java.awt.Point origin) |
BoardFigure(java.lang.String image,
java.awt.Point origin,
boolean isMobile,
Command command) |
Modifier and Type | Method and Description |
---|---|
void |
changeImage(java.lang.String imageName)
Change the image to use.
|
boolean |
isMobile()
return true if this figure can be moved by the BoardActionTool.
|
boolean |
performAction(int fromX,
int fromY,
int toX,
int toY)
do not invoke yourself, it is invoked by the BoardActionTool once a
BoardFigure has been moved or clicked.
|
basicMoveBy, displayBox, draw, set, set
addFigureChangeListener, changed, invalidate, moveBy, removeFigureChangeListener, willChange
public BoardFigure(java.lang.String image, java.awt.Point origin, boolean isMobile, Command command)
public BoardFigure(java.lang.String image, boolean isMobile, Command command)
public BoardFigure()
public BoardFigure(java.awt.Image img, java.awt.Point origin)
public BoardFigure(java.lang.String name, java.awt.Point origin)
public void changeImage(java.lang.String imageName)
imageName
- name of image loaded by the ImageManagerpublic boolean isMobile()
public boolean performAction(int fromX, int fromY, int toX, int toY)
fromX
- x position the figure is moved from (or clicked)fromY
- y position the figure is moved from (or clicked)toX
- x position the figure is moved totoY
- y position the figure is moved toFrom the book: Flexible, Reliable Software, © CRC Press 2010. Author: Henrik B. Christensen, Aarhus University, Denmark