net.kolls.railworld.tuic
Class TrainMiniPainter

java.lang.Object
  extended by net.kolls.railworld.TrainUIController
      extended by net.kolls.railworld.tuic.TrainMiniPainter

public class TrainMiniPainter
extends TrainUIController

Paints a mini version of the train on the mini viewer.

Author:
Steve Kollmansberger

Constructor Summary
TrainMiniPainter(java.awt.Graphics2D mg, double xs, double ys)
           
 
Method Summary
 void car(Car c, CLoc b, CLoc pos)
          For each Car, including a beginning and ending position.
 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
 

Constructor Detail

TrainMiniPainter

public TrainMiniPainter(java.awt.Graphics2D mg,
                        double xs,
                        double ys)
Parameters:
mg - The graphics context to draw on
xs - The X scale of the miniviewer
ys - The Y scale of the miniviewer
Method Detail

segment

public void segment(Car c,
                    java.awt.geom.Line2D l)
Description copied from class: TrainUIController
For each visible segment (there may be multiple segments per car, or even 0 if the car is hidden).

Specified by:
segment in class TrainUIController
Parameters:
c - The Car involved.
l - The current segment. There may be multiple calls to segment per Car.

car

public void car(Car c,
                CLoc b,
                CLoc pos)
Description copied from class: TrainUIController
For each Car, including a beginning and ending position. These are given regardless of whether or not the Car is all or partially hidden.

Specified by:
car in class TrainUIController
Parameters:
c - The Car involved.
b - Starting position.
pos - Final position.