public class Route extends Container<java.lang.Long>
| Modifier and Type | Field and Description |
|---|---|
static int |
LINE_Size_Big |
static int |
LINE_Size_Normal |
static int |
LINE_Size_Small |
static int |
SHOW_DIRECTION |
static int |
SHOW_LENGTH |
static int |
SHOW_LINE |
static int |
SHOW_NAME |
static int |
SHOW_NOTHING |
| Constructor and Description |
|---|
Route(Model model,
java.lang.String id,
java.lang.String sourceId,
java.lang.String sinkId,
double length)
Route from sourceId to sinkId with length
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addToContainer(java.lang.String entityId,
long time)
add entityId at sourceId on route
|
Grafic |
createGrafic(java.awt.Point[] points)
create RouteGrafic as polyline with innerpoints points.
|
java.awt.Color |
getColor()
get color of route line
|
Grafic |
getGrafic()
get stationGrafic, which was ceated before
|
double |
getLength() |
int |
getLineSize()
get size of route line
|
java.lang.String |
getName()
name of route, can be null
|
java.lang.Object[][] |
getRelPosition(long time)
Compute the relative position of every entity in this route (container).
|
int |
getShow()
Show is the sum of Route.SHOW_ Flags
|
java.lang.String |
getSinkId() |
java.lang.String |
getSourceId() |
boolean |
removeFromContainer(java.lang.String entityId,
long time)
remove entityId from route
entityId
time time of operation
|
void |
setColor(java.awt.Color color)
set color of route line and description
|
void |
setLineSize(int size)
set the line size, for values look at Route.LINE_Size flags
|
void |
setName(java.lang.String name) |
void |
setShow(int show)
Show is the sum of Route.SHOW_ Flags
|
addToContainer, containsInContainer, getAllContentFromContainer, getFromContainer, getId, getModel, sizeOfContainerpublic static final int SHOW_NOTHING
public static final int SHOW_NAME
public static final int SHOW_LENGTH
public static final int SHOW_DIRECTION
public static final int SHOW_LINE
public static final int LINE_Size_Normal
public static final int LINE_Size_Small
public static final int LINE_Size_Big
public Route(Model model, java.lang.String id, java.lang.String sourceId, java.lang.String sinkId, double length)
model - used animation.model.Modelid - routeIdsourceId - station with sourceIdsinkId - station with sinkIdlength - length of routepublic java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String getSourceId()
public java.lang.String getSinkId()
public double getLength()
public int getShow()
public void setShow(int show)
show - public java.awt.Color getColor()
public void setColor(java.awt.Color color)
color - public int getLineSize()
public void setLineSize(int size)
size - public Grafic createGrafic(java.awt.Point[] points)
points - public Grafic getGrafic()
public boolean addToContainer(java.lang.String entityId,
long time)
throws ModelException
entityId - time - time of operationModelExceptionpublic boolean removeFromContainer(java.lang.String entityId,
long time)
throws ModelException
removeFromContainer in class Container<java.lang.Long>time - not usedModelExceptionpublic java.lang.Object[][] getRelPosition(long time)
time - actual simulation time