net.kolls.railworld
Class TrainUIController

java.lang.Object
  extended by net.kolls.railworld.TrainUIController
Direct Known Subclasses:
TrainClickTest, TrainDirectionFinder, TrainEndPointFinder, TrainMiniPainter, TrainPainter

public abstract class TrainUIController
extends java.lang.Object

Deals with issues regarding a train as it appears on the map. Once instantiated, the programmer calls the act method, which in turns calls segment and car methods repeatadly.

Author:
Steve Kollmansberger

Constructor Summary
TrainUIController()
           
 
Method Summary
 void act(Train t)
          "Walk" the train and the segments it is on and call segment and car appropriately.
abstract  void car(Car c, CLoc begin, CLoc end)
          For each Car, including a beginning and ending position.
abstract  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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrainUIController

public TrainUIController()
Method Detail

segment

public abstract 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).

Parameters:
c - The Car involved.
l - The current segment. There may be multiple calls to segment per Car.

car

public abstract void car(Car c,
                         CLoc begin,
                         CLoc end)
For each Car, including a beginning and ending position. These are given regardless of whether or not the Car is all or partially hidden.

Parameters:
c - The Car involved.
begin - Starting position.
end - Final position.

act

public final void act(Train t)
"Walk" the train and the segments it is on and call segment and car appropriately.

Parameters:
t - Train to act on.