|
jET |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jet.tracks.TrackFactory
Tracks factory can build tracks and switches with specified properties.
Field Summary | |
static int |
HANDLER_LEFT
Handler at left. |
static int |
HANDLER_RIGHT
Handler at right. |
static int |
HANDLER_SIDE
Handler at side track of the switch. |
Method Summary | |
Track |
createArc(double len,
double rad)
Creates new arc track. |
Track |
createStraight(double len)
Creates straight track. |
Switch |
createSwitch(int handler,
double len1,
double rad1,
double len2,
double rad2)
Creates switch. |
static TrackFactory |
getInstance()
Gets instance of the track factory. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int HANDLER_LEFT
public static final int HANDLER_RIGHT
public static final int HANDLER_SIDE
Method Detail |
public static TrackFactory getInstance()
public Track createStraight(double len)
It fills in only geometry fields of the track. Programmer must fill in rest attributes on his own.
len
- Length of this track.public Track createArc(double len, double rad)
len
- Length of the track.rad
- Radius of the track.
Positive means right arc. Negative means left arc.public Switch createSwitch(int handler, double len1, double rad1, double len2, double rad2)
handler
- Handler. One of the predefined values.len1
- Length of the straight track.rad1
- Radius of the straight track. When it equals 0, it means that
track is straight. Positive values mean right arc of the main track of this switch.
Negative - left arc.len2
- Length of the side track of the switch.rad2
- Radius of the side track of the switch. When it is positive track is right
arc and also it means that switch is right. Negative means left arc and left switch.
HANDLER_LEFT
,
HANDLER_RIGHT
,
HANDLER_SIDE
|
jET |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |