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.

Variable Index

 o DEFAULT_COLOR
 o IGNORE_MOUSE
 o MOVING_MOUSE
 o NORMAL_MOUSE
 o OPTION_MOUSE
 o WIRING_MOUSE

Constructor Index

 o Moveable()

Method Index

 o getDelta()
getDelta
 o getLocMap()
getLocMap
 o getLocMapX()
getLocMapX
 o getLocMapY()
getLocMapY
 o getMap()
getMap
 o getMouseStatus()
getMouseStatus
 o getZero()
getZero
 o ignoreMouse(boolean)
ignoreMouse Sets wether or not Mouse actions are ignored by this Moveable Object.
 o initialize(Color, Dimension)
initialize Initializes and places this Moveable Object on the Map.
 o initialize(Dimension)
initialize Initializes and places this Moveable Object on the Map.
 o initialize(int, int)
initialize Initializes and places this Moveable Object on the Map.
 o isMoving()
isMoving
 o lock(boolean)
lock Locks this Moveable in place.
 o mouseDown(Event, int, int)
 o mouseDrag(Event, int, int)
 o mouseUp(Event, int, int)
 o move(Point)
move Moves this Moveable Object.
 o setLocMap(int, int)
setLocMap Sets the location of this Moveable Object in the Map.
 o setLocMap(Point)
setLocMap Sets the location of this Moveable Object in the Map.
 o setMap(Map)
setMap Sets the map to which this Moveable Object belongs to.
 o setMoving(boolean)
This is a piece of code that I am not proud of.
 o setZero(Point)
setZero Sets the Location where this Moveable Object was before moving.
 o wireMouse(boolean)
wireMouse Sets wether or not Mouse actions are ignored by this Moveable Object.

Variables

 o DEFAULT_COLOR
  public final static Color DEFAULT_COLOR
 o NORMAL_MOUSE
  public final static int NORMAL_MOUSE
 o OPTION_MOUSE
  public final static int OPTION_MOUSE
 o IGNORE_MOUSE
  public final static int IGNORE_MOUSE
 o MOVING_MOUSE
  public final static int MOVING_MOUSE
 o WIRING_MOUSE
  public final static int WIRING_MOUSE

Constructors

 o Moveable
  public Moveable()

Methods

 o setMap
  public void setMap(Map m)
setMap Sets the map to which this Moveable Object belongs to.
Parameters:
m - the Map.
 o getMap
  public Map getMap()
getMap
Returns:
the Map that this Moveable Object belongs to.
 o 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.
 o 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.
 o getLocMap
  public Point getLocMap()
getLocMap
Returns:
the location of this Moveable Object in the Map.
 o getLocMapX
  public int getLocMapX()
getLocMapX
Returns:
the x coordinate of this Moveable Object in the Map.
 o getLocMapY
  public int getLocMapY()
getLocMapY
Returns:
the y coordinate of this Moveable Object in the Map.
 o 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.
 o 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.
 o 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.
 o getDelta
  public Point getDelta()
getDelta
Returns:
the distance and direction that this Moveable Object has moved.
 o getZero
  public Point getZero()
getZero
Returns:
the Location where this Moveable Object was before moving.
 o setZero
  public void setZero(Point set)
setZero Sets the Location where this Moveable Object was before moving.
 o lock
  public void lock(boolean status)
lock Locks this Moveable in place.
 o move
  public void move(Point delta)
move Moves this Moveable Object.
 o isMoving
  public boolean isMoving()
isMoving
Returns:
true if this Moveable Object is moving, false when not.
 o 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.
 o wireMouse
  public void wireMouse(boolean state)
wireMouse Sets wether or not Mouse actions are ignored by this Moveable Object.
 o ignoreMouse
  public void ignoreMouse(boolean state)
ignoreMouse Sets wether or not Mouse actions are ignored by this Moveable Object.
 o getMouseStatus
  public int getMouseStatus()
getMouseStatus
Returns:
the mouseStatus of this Moveable Object.
 o mouseDown
  public boolean mouseDown(Event evt,
                           int x,
                           int y)
Overrides:
mouseDown in class Component
 o mouseUp
  public boolean mouseUp(Event evt,
                         int x,
                         int y)
Overrides:
mouseUp in class Component
 o mouseDrag
  public boolean mouseDrag(Event evt,
                           int x,
                           int y)
Overrides:
mouseDrag in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index