|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.Observable
org.jscience.architecture.traffic.Model
org.jscience.architecture.traffic.edit.EditModel
public class EditModel
The model for the editor.
| Field Summary | |
|---|---|
NumberDispenser |
laneNumbers
Number dispenser for temporary drivelane ids |
NumberDispenser |
roadNumbers
Number dispenser for temporary road ids |
| Fields inherited from class org.jscience.architecture.traffic.Model |
|---|
infra, parentName, SAVE_STATS |
| Constructor Summary | |
|---|---|
EditModel()
Creates a new model for the editor |
|
EditModel(Infrastructure i)
Creates a new model for the editor with the specified infrastructure |
|
| Method Summary | |
|---|---|
void |
addLane(Drivelane lane,
Road r,
Node to)
Adds a drivelane to a road. |
void |
addNode(java.awt.Point coords,
int type)
Adds a new node to the infrastructure |
void |
addRoad(Road r,
Node alpha,
int posa,
Node beta,
int posb)
Adds a new road to the infrastructure |
void |
addRoad(Road road,
Node alpha,
int posa,
Node beta,
int posb,
java.util.Vector turnPoints)
Adds a new road to the infrastructure |
void |
load(XMLElement myElement,
XMLLoader loader)
DOCUMENT ME! |
void |
moveNode(Node node,
java.awt.Point point)
Moves a node to a new position on the map. |
void |
remLane(Drivelane lane)
Removes a drivelane from the infrastructure |
void |
remNode(Node node)
Removes a node from the infrastructure |
void |
remObjects(java.util.LinkedList list)
Removes a list objects from the infrastructure |
void |
remRoad(Road road)
Removes a road from the infrastructure |
void |
saveChilds(XMLSaver saver)
DOCUMENT ME! |
XMLElement |
saveSelf()
DOCUMENT ME! |
void |
setLaneTarget(Drivelane lane,
int target,
boolean state)
Sets or clears a target for a drivelane. |
void |
setLaneType(Drivelane lane,
int t)
Sets the type of a drivelane. |
| Methods inherited from class org.jscience.architecture.traffic.Model |
|---|
getInfrastructure, getXMLName, setInfrastructure, setParentName |
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public NumberDispenser laneNumbers
public NumberDispenser roadNumbers
| Constructor Detail |
|---|
public EditModel()
public EditModel(Infrastructure i)
i - DOCUMENT ME!| Method Detail |
|---|
public void remObjects(java.util.LinkedList list)
throws InfraException
list - The list of objects to remove
InfraException - DOCUMENT ME!
public void addNode(java.awt.Point coords,
int type)
throws InfraException
coords - The pixel coordinates of the new nodetype - The type of the new node
InfraException - DOCUMENT ME!
public void addRoad(Road r,
Node alpha,
int posa,
Node beta,
int posb)
throws InfraException
r - The road to addalpha - The alpha node to connect the road toposa - The connection-position to connect the road at the alpha
node atbeta - The beta node to connect the road toposb - The connection-position to connect the road at the beta node
at
InfraException - DOCUMENT ME!
public void addRoad(Road road,
Node alpha,
int posa,
Node beta,
int posb,
java.util.Vector turnPoints)
throws InfraException
road - The road to addalpha - The alpha node to connect the road toposa - The connection-position to connect the road at the alpha
node atbeta - The beta node to connect the road toposb - The connection-position to connect the road at the beta node
atturnPoints - The turn points. Angles are calculated.
InfraException - DOCUMENT ME!
public void addLane(Drivelane lane,
Road r,
Node to)
throws InfraException
lane - The drivelane to add to the road.r - The road to add the drivelane to.to - Roadusers on the drivelane move towards this node.
InfraException - If there are 4 drivelanes on that side of the
road already.
public void setLaneType(Drivelane lane,
int t)
throws InfraException
lane - The drivelane to set the type of.t - The new type.
InfraException - If the type could not be set.
public void setLaneTarget(Drivelane lane,
int target,
boolean state)
throws InfraException
lane - The drivelane to set a target of.target - The target to set or clear.state - True to set the target, false to clear it.
InfraException - If the target could not be set.
public void moveNode(Node node,
java.awt.Point point)
node - The node to move.point - The new coordinates of the node.
public void remNode(Node node)
throws InfraException
node - The node to remove
InfraException - If anything bad happens.
public void remRoad(Road road)
throws InfraException
road - The road to remove from the infrastructure
InfraException - If something bad happens.
public void remLane(Drivelane lane)
throws InfraException
lane - The drivelane to remove
InfraException - If something bad happens.
public void load(XMLElement myElement,
XMLLoader loader)
throws XMLTreeException,
java.io.IOException,
XMLInvalidInputException
load in interface XMLSerializableload in class ModelmyElement - DOCUMENT ME!loader - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLInvalidInputException - DOCUMENT ME!public XMLElement saveSelf()
saveSelf in interface XMLSerializablesaveSelf in class Model
public void saveChilds(XMLSaver saver)
throws XMLTreeException,
java.io.IOException,
XMLCannotSaveException
saveChilds in interface XMLSerializablesaveChilds in class Modelsaver - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||