Class builder.Moveable
All Packages Class Hierarchy This Package Previous Next Index
Class builder.Moveable
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----builder.Moveable
- public class Moveable
- extends Panel
An Abstraction. This is an Object that has the ability to be dragged on
a Map.
-
DEFAULT_COLOR
-
-
IGNORE_MOUSE
-
-
MOVING_MOUSE
-
-
NORMAL_MOUSE
-
-
OPTION_MOUSE
-
-
WIRING_MOUSE
-
-
Moveable()
-
-
getDelta()
- getDelta
-
getLocMap()
- getLocMap
-
getLocMapX()
- getLocMapX
-
getLocMapY()
- getLocMapY
-
getMap()
- getMap
-
getMouseStatus()
- getMouseStatus
-
getZero()
- getZero
-
ignoreMouse(boolean)
- ignoreMouse
Sets wether or not Mouse actions are ignored by this Moveable Object.
-
initialize(Color, Dimension)
- initialize
Initializes and places this Moveable Object on the Map.
-
initialize(Dimension)
- initialize
Initializes and places this Moveable Object on the Map.
-
initialize(int, int)
- initialize
Initializes and places this Moveable Object on the Map.
-
isMoving()
- isMoving
-
lock(boolean)
- lock
Locks this Moveable in place.
-
mouseDown(Event, int, int)
-
-
mouseDrag(Event, int, int)
-
-
mouseUp(Event, int, int)
-
-
move(Point)
- move
Moves this Moveable Object.
-
setLocMap(int, int)
- setLocMap
Sets the location of this Moveable Object in the Map.
-
setLocMap(Point)
- setLocMap
Sets the location of this Moveable Object in the Map.
-
setMap(Map)
- setMap
Sets the map to which this Moveable Object belongs to.
-
setMoving(boolean)
- This is a piece of code that I am not proud of.
-
setZero(Point)
- setZero
Sets the Location where this Moveable Object was before moving.
-
wireMouse(boolean)
- wireMouse
Sets wether or not Mouse actions are ignored by this Moveable Object.
DEFAULT_COLOR
public final static Color DEFAULT_COLOR
NORMAL_MOUSE
public final static int NORMAL_MOUSE
OPTION_MOUSE
public final static int OPTION_MOUSE
IGNORE_MOUSE
public final static int IGNORE_MOUSE
MOVING_MOUSE
public final static int MOVING_MOUSE
WIRING_MOUSE
public final static int WIRING_MOUSE
Moveable
public Moveable()
setMap
public void setMap(Map m)
- setMap
Sets the map to which this Moveable Object belongs to.
- Parameters:
- m - the Map.
getMap
public Map getMap()
- getMap
- Returns:
- the Map that this Moveable Object belongs to.
setLocMap
public void setLocMap(int x,
int y)
- setLocMap
Sets the location of this Moveable Object in the Map.
- Parameters:
- x - coordinate in the Map coordinates.
- y - coordinate in the Map coordinates.
setLocMap
public void setLocMap(Point p)
- setLocMap
Sets the location of this Moveable Object in the Map.
- Parameters:
- p - the location in the Map coordinates.
getLocMap
public Point getLocMap()
- getLocMap
- Returns:
- the location of this Moveable Object in the Map.
getLocMapX
public int getLocMapX()
- getLocMapX
- Returns:
- the x coordinate of this Moveable Object in the Map.
getLocMapY
public int getLocMapY()
- getLocMapY
- Returns:
- the y coordinate of this Moveable Object in the Map.
initialize
public void initialize(Color backgroundColor,
Dimension size)
- initialize
Initializes and places this Moveable Object on the Map.
- Parameters:
- backgroundColor - the Background color of this Moveable Object.
- size - the initial Dimension of this Moveable Object.
initialize
public void initialize(Dimension size)
- initialize
Initializes and places this Moveable Object on the Map.
- Parameters:
- size - the initial Dimension of this Moveable Object.
initialize
public void initialize(int width,
int height)
- initialize
Initializes and places this Moveable Object on the Map.
- Parameters:
- width - the initial Width of this Moveable Object.
- height - the initial Height of this Moveable Object.
getDelta
public Point getDelta()
- getDelta
- Returns:
- the distance and direction that this Moveable Object has
moved.
getZero
public Point getZero()
- getZero
- Returns:
- the Location where this Moveable Object was before moving.
setZero
public void setZero(Point set)
- setZero
Sets the Location where this Moveable Object was before moving.
lock
public void lock(boolean status)
- lock
Locks this Moveable in place.
move
public void move(Point delta)
- move
Moves this Moveable Object.
isMoving
public boolean isMoving()
- isMoving
- Returns:
- true if this Moveable Object is moving, false when not.
setMoving
public void setMoving(boolean state)
- This is a piece of code that I am not proud of. The purpose of the
method is to set the moving variable for when objects are dragged along
or moved but I am also using it to update the whole screen at the end of
a move so that wires are repainted in the flow map.
wireMouse
public void wireMouse(boolean state)
- wireMouse
Sets wether or not Mouse actions are ignored by this Moveable Object.
ignoreMouse
public void ignoreMouse(boolean state)
- ignoreMouse
Sets wether or not Mouse actions are ignored by this Moveable Object.
getMouseStatus
public int getMouseStatus()
- getMouseStatus
- Returns:
- the mouseStatus of this Moveable Object.
mouseDown
public boolean mouseDown(Event evt,
int x,
int y)
- Overrides:
- mouseDown in class Component
mouseUp
public boolean mouseUp(Event evt,
int x,
int y)
- Overrides:
- mouseUp in class Component
mouseDrag
public boolean mouseDrag(Event evt,
int x,
int y)
- Overrides:
- mouseDrag in class Component
All Packages Class Hierarchy This Package Previous Next Index