|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deken.game.movement.BaseMovement
org.deken.game.movement.MouseDragMovement
public class MouseDragMovement
Title: MouseDragMovement
Description: This class is for creating a game pieces that is moved only directly clicking on the piece and dragging the mouse.
Copyright (c) 2007
Field Summary | |
---|---|
static int |
BUTTON_ACTION
|
static int |
MOTION_ACTION
|
protected int |
xOffSet
|
protected int |
yOffSet
|
Fields inherited from class org.deken.game.movement.BaseMovement |
---|
gameVector, name |
Constructor Summary | |
---|---|
protected |
MouseDragMovement()
|
|
MouseDragMovement(GameLocation gameLocation,
SpriteSize size,
InputMouseAction mouseClick,
InputMouseAction mouseMove)
MouseDragMovement |
Method Summary | |
---|---|
void |
addInputMouseAction(InputMouseAction inputMouseAction,
int action)
addInputAction This method add an InputMouseAction to the MouseMovement, for the action. |
void |
collideHorizontal()
Adjust the horizontal (x axis) movement to a collision. |
void |
collideLayer()
Adjust the layer (z axis) movement to a collision. |
void |
collideVertical()
Adjust the vertical (y axis) movement to a collision. |
MouseDragMovement |
copy(Actor actor)
Copies this movement |
java.awt.geom.Rectangle2D |
getBounds()
|
InputMouseAction[] |
getInputMouseActions()
getInputMouseActions This methods returns the list of InputMouseActions for this MouseMovement. |
java.lang.String |
getName()
|
double |
getSpeed()
|
double |
getXUpdate()
This returns the amount of X movement for a given update. |
double |
getYUpdate()
This returns the amount of Y movement for a given update. |
void |
notifyListener(InputMouseAction inputMouseAction)
notifyListener |
void |
setBounds(int x,
int y,
int width,
int height)
|
void |
setGameLocation(GameLocation gameLocation)
|
void |
setRunning(boolean running)
|
void |
setSpeed(double speed)
|
void |
update(long elapseTime)
This method takes the elapse time, since the last update, and to determine the next movement to set to the GameVector. |
Methods inherited from class org.deken.game.movement.BaseMovement |
---|
baseCopy, getDirection, getGameVector, setName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.deken.game.movement.Movement |
---|
getDirection, getGameVector |
Field Detail |
---|
public static final int BUTTON_ACTION
public static final int MOTION_ACTION
protected int xOffSet
protected int yOffSet
Constructor Detail |
---|
public MouseDragMovement(GameLocation gameLocation, SpriteSize size, InputMouseAction mouseClick, InputMouseAction mouseMove)
gameLocation
- intsize
- intmouseClick
- InputMouseActionmouseMove
- InputMouseActionprotected MouseDragMovement()
Method Detail |
---|
public void addInputMouseAction(InputMouseAction inputMouseAction, int action)
MouseMovement
addInputMouseAction
in interface MouseMovement
inputMouseAction
- InputMouseActionaction
- intpublic void collideHorizontal()
collideHorizontal
in interface Movement
public void collideVertical()
collideVertical
in interface Movement
public void collideLayer()
collideLayer
in interface Movement
public MouseDragMovement copy(Actor actor)
copy
in interface Movement
public java.awt.geom.Rectangle2D getBounds()
public InputMouseAction[] getInputMouseActions()
MouseMovement
getInputMouseActions
in interface MouseMovement
public java.lang.String getName()
getName
in interface Updateable
getName
in class BaseMovement
public double getSpeed()
public double getXUpdate()
Movement
getXUpdate
in interface Movement
public double getYUpdate()
Movement
getYUpdate
in interface Movement
public void notifyListener(InputMouseAction inputMouseAction)
InputMouseListener
This method is called when any Mouse Motion event occurs.
notifyListener
in interface InputMouseListener
inputMouseAction
- InputMouseActionpublic void setBounds(int x, int y, int width, int height)
x
- inty
- intwidth
- intheight
- intpublic void setGameLocation(GameLocation gameLocation)
gameLocation
- GameLocationpublic void setRunning(boolean running)
public void setSpeed(double speed)
public void update(long elapseTime)
Movement
update
in interface Movement
update
in interface Updateable
elapseTime
- long
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |