|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.kolls.railworld.TrainUIController
net.kolls.railworld.tuic.TrainDirectionFinder
public class TrainDirectionFinder
Determine the direction of a train in both radians and words.
Only the lead car is considered; to indicate that a new train is being tested,
call the reset() method between trains.
| Field Summary | |
|---|---|
java.lang.String |
adesc
When the direction is found, this will describe the direction of the lead car. |
double |
angle
When the direction is found, this will contain the angle of the lead car in radians. |
| Constructor Summary | |
|---|---|
TrainDirectionFinder()
Create a train direction finder |
|
| Method Summary | |
|---|---|
void |
car(Car c,
CLoc begin,
CLoc end)
For each Car, including a beginning and ending position. |
void |
reset()
Prepare for a new train. |
void |
segment(Car c,
java.awt.geom.Line2D l)
For each visible segment (there may be multiple segments per car, or even 0 if the car is hidden). |
| Methods inherited from class net.kolls.railworld.TrainUIController |
|---|
act |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public double angle
public java.lang.String adesc
| Constructor Detail |
|---|
public TrainDirectionFinder()
| Method Detail |
|---|
public void reset()
public void car(Car c,
CLoc begin,
CLoc end)
TrainUIController
car in class TrainUIControllerc - The Car involved.begin - Starting position.end - Final position.
public void segment(Car c,
java.awt.geom.Line2D l)
TrainUIController
segment in class TrainUIControllerc - The Car involved.l - The current segment. There may be multiple calls to segment per Car.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||