Class builder.Map
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class builder.Map

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----builder.Map

public class Map
extends Panel
A surface where either components or icons are placed and wires are drawn.

Constructor Index

 o Map()
Main Constructor.
 o Map(File)
Constructor that includes the loading of the file.

Method Index

 o addNode(Node)
addNode Adds Node to the vector.
 o addWire(Wire)
addWire Adds Wire to the vector.
 o createWire(Node)
createWire Tells this map that a Wire is being created...
 o editMode()
editMode
 o editMode(boolean)
editMode A method to set the Edit Mode.
 o lockAll(boolean)
lockAll Locks all components of this Map in place.
 o mouseDrag(Event, int, int)
 o mouseUp(Event, int, int)
Moves the moving object when the Mouse is released.
 o movingThis()
movingThis Tells this map that NO Object is moving.
 o movingThis(Moveable)
movingThis Tells this map which Object is moving.
 o paint(Graphics)
paint Defines the graphical representation of the wires on this map.
 o wireAll(boolean)
wireAll Presets all Icons to be ready to accept wires.

Constructors

 o Map
  public Map()
Main Constructor.
 o Map
  public Map(File file_name)
Constructor that includes the loading of the file.
Parameters:
file_name - a file containing the Node and Wire Vectors.

Methods

 o addNode
  public int addNode(Node node)
addNode Adds Node to the vector.
Parameters:
node - the node to add to the vector.
Returns:
the index of the node added.
 o addWire
  public int addWire(Wire wire)
addWire Adds Wire to the vector.
Parameters:
wire - the wire to add to the vector.
Returns:
the index of the wire added.
 o editMode
  public void editMode(boolean mode)
editMode A method to set the Edit Mode.
Parameters:
mode - true for Edit Mode, false for Run Mode.
 o editMode
  public boolean editMode()
editMode
Returns:
the Edit Mode of this Map. true for Edit Mode, false for Run Mode.
 o lockAll
  public void lockAll(boolean status)
lockAll Locks all components of this Map in place.
Parameters:
status - true for Locked, false for Unlocked.
 o wireAll
  public void wireAll(boolean status)
wireAll Presets all Icons to be ready to accept wires.
Parameters:
status - true for wiring enabled, false for disabled.
 o movingThis
  public boolean movingThis(Moveable target)
movingThis Tells this map which Object is moving.
Parameters:
target - the Moveable Object that is being moved at the time.
Returns:
true.
 o movingThis
  public boolean movingThis()
movingThis Tells this map that NO Object is moving.
Returns:
true.
 o createWire
  public void createWire(Node target)
createWire Tells this map that a Wire is being created... This method is called twice, with two different nodes. The first time it is called it sets the starting Node for the wire, the second time, it sets the ending Node for the wire and creates the Wire.
Parameters:
target - the Node that the Wire is anchored to.
 o paint
  public void paint(Graphics g)
paint Defines the graphical representation of the wires on this map.
Parameters:
g - the graphics context.
Overrides:
paint in class Component
 o mouseUp
  public boolean mouseUp(Event evt,
                         int x,
                         int y)
Moves the moving object when the Mouse is released.
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