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.
-
Map()
- Main Constructor.
-
Map(File)
- Constructor that includes the loading of the file.
-
addNode(Node)
- addNode
Adds Node to the vector.
-
addWire(Wire)
- addWire
Adds Wire to the vector.
-
createWire(Node)
- createWire
Tells this map that a Wire is being created...
-
editMode()
- editMode
-
editMode(boolean)
- editMode
A method to set the Edit Mode.
-
lockAll(boolean)
- lockAll
Locks all components of this Map in place.
-
mouseDrag(Event, int, int)
-
-
mouseUp(Event, int, int)
- Moves the moving object when the Mouse is released.
-
movingThis()
- movingThis
Tells this map that NO Object is moving.
-
movingThis(Moveable)
- movingThis
Tells this map which Object is moving.
-
paint(Graphics)
- paint
Defines the graphical representation of the wires on this map.
-
wireAll(boolean)
- wireAll
Presets all Icons to be ready to accept wires.
Map
public Map()
- Main Constructor.
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.
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.
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.
editMode
public void editMode(boolean mode)
- editMode
A method to set the Edit Mode.
- Parameters:
- mode - true for Edit Mode, false for Run Mode.
editMode
public boolean editMode()
- editMode
- Returns:
- the Edit Mode of this Map.
true for Edit Mode, false for Run Mode.
lockAll
public void lockAll(boolean status)
- lockAll
Locks all components of this Map in place.
- Parameters:
- status - true for Locked, false for Unlocked.
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.
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.
movingThis
public boolean movingThis()
- movingThis
Tells this map that NO Object is moving.
- Returns:
- true.
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.
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
mouseUp
public boolean mouseUp(Event evt,
int x,
int y)
- Moves the moving object when the Mouse is released.
- 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