|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--VASSAL.build.AbstractBuildable
|
+--VASSAL.build.module.map.PieceMover
This is a MouseListener that moves pieces on a Map window
| Field Summary | |
static java.lang.String |
AUTO_REPORT
The Preferences key for autoreporting moves. |
protected boolean |
checkDragContents
|
protected java.awt.Point |
dragBegin
|
protected Map |
map
|
protected java.awt.Rectangle |
outline
|
protected java.awt.Color |
outlineColor
|
protected java.awt.Point |
outlineOffset
|
protected int |
thickness
|
| Fields inherited from class VASSAL.build.AbstractBuildable |
buildComponents |
| Fields inherited from interface VASSAL.counters.PieceFinder |
MOVABLE, PIECE_IN_STACK, STACK_ONLY |
| Constructor Summary | |
PieceMover()
|
|
| Method Summary | |
void |
addTo(Buildable b)
Adds this component to its parent. |
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Implement Comparator to sort the contents of the darg bufeer before completing the drag. |
void |
draw(java.awt.Graphics g,
Map map)
|
java.lang.String[] |
getAttributeNames()
|
java.lang.String |
getAttributeValueString(java.lang.String key)
Return a String representation of the attribute with the given name. |
Command |
getRestoreCommand()
When saving a game, each GameComponent should return a Command that, when executed, restores the GameComponent to its
state when the game was saved
If this component has no persistent state, return null |
boolean |
isClick(java.awt.Point pt)
Return true if this point is "close enough" to the point at which the user pressed the mouse to be considered a mouse click (such that no moves are done) |
protected boolean |
isMultipleSelectionEvent(java.awt.event.MouseEvent e)
|
Command |
markMoved(GamePiece p,
boolean hasMoved)
|
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)
|
protected Command |
movedPiece(GamePiece p,
java.awt.Point loc)
Invoked after a piece has been moved |
Command |
movePieces(Map m,
java.awt.Point p)
|
GamePiece |
select(Map map,
GamePiece piece,
java.awt.Point pt)
Implements PieceFinder to determine which piece to stack with when completing a drag |
void |
setAttribute(java.lang.String key,
java.lang.Object value)
Sets an attribute value for this component. |
protected void |
setOutline(GamePiece p)
|
void |
setup(boolean gameStarting)
Notify the GameComponent that a game has started/ended |
protected boolean |
shouldMarkMoved()
|
| Methods inherited from class VASSAL.build.AbstractBuildable |
add, build, getBuildComponents, getBuildElement, getComponents |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String AUTO_REPORT
protected Map map
protected java.awt.Point dragBegin
protected java.awt.Color outlineColor
protected int thickness
protected java.awt.Rectangle outline
protected java.awt.Point outlineOffset
protected boolean checkDragContents
| Constructor Detail |
public PieceMover()
| Method Detail |
public void addTo(Buildable b)
Buildable
addTo in interface Buildablepublic void setup(boolean gameStarting)
GameComponent
setup in interface GameComponentgameStarting - if true, a game is starting. If false, then a game is endingpublic Command getRestoreCommand()
GameComponentCommand that, when executed, restores the GameComponent to its
state when the game was saved
If this component has no persistent state, return null
getRestoreCommand in interface GameComponentpublic java.lang.String[] getAttributeNames()
getAttributeNames in class AbstractBuildablepublic java.lang.String getAttributeValueString(java.lang.String key)
AbstractBuildableAbstractBuildable.setAttribute(java.lang.String, java.lang.Object).
getAttributeValueString in class AbstractBuildablekey - the name of the attribute. Will be one of those
listed in AbstractBuildable.getAttributeNames()
public void setAttribute(java.lang.String key,
java.lang.Object value)
AbstractBuildablekey
parameter will be one of those listed in AbstractBuildable.getAttributeNames().
If the value parameter is a String, it will be the
value returned by AbstractBuildable.getAttributeValueString(java.lang.String) for the same
key. If the implementing class extends
AbstractConfigurable, then value will be
an instance of the corresponding Class listed in
AbstractConfigurable.getAttributeTypes()
setAttribute in class AbstractBuildablekey - the name of the attribute. Will be one of those
listed in AbstractBuildable.getAttributeNames()protected boolean isMultipleSelectionEvent(java.awt.event.MouseEvent e)
public void draw(java.awt.Graphics g,
Map map)
draw in interface Drawable
protected Command movedPiece(GamePiece p,
java.awt.Point loc)
public Command markMoved(GamePiece p,
boolean hasMoved)
protected boolean shouldMarkMoved()
public Command movePieces(Map m,
java.awt.Point p)
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerprotected void setOutline(GamePiece p)
public boolean isClick(java.awt.Point pt)
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased 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 mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic 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 GamePiece select(Map map,
GamePiece piece,
java.awt.Point pt)
select in interface PieceFinder
public int compare(java.lang.Object o1,
java.lang.Object o2)
compare in interface Sort.Comparator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||