jfreerails.client.renderer
Class StationBoxRenderer
java.lang.Object
jfreerails.client.renderer.StationBoxRenderer
- All Implemented Interfaces:
- Painter
public class StationBoxRenderer
- extends java.lang.Object
- implements Painter
Renders box showing the cargo waiting at a station.
- Author:
- Luke
Method Summary |
private int[] |
calculateCarLoads(ImmutableCargoBundle cb,
int category)
The length of the returned array is the number of complete carloads of
the specified cargo category in the specified bundle. |
void |
paint(java.awt.Graphics2D g)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WAGON_IMAGE_HEIGHT
private static final int WAGON_IMAGE_HEIGHT
- See Also:
- Constant Field Values
SPACING
private static final int SPACING
- See Also:
- Constant Field Values
MAX_WIDTH
private static final int MAX_WIDTH
- See Also:
- Constant Field Values
w
private final ReadOnlyWorld w
bgColor
private final java.awt.Color bgColor
vl
private final RenderersRoot vl
wagonImageWidth
private final int wagonImageWidth
modelRoot
private final ModelRoot modelRoot
StationBoxRenderer
public StationBoxRenderer(ReadOnlyWorld world,
RenderersRoot vl,
ModelRoot modelRoot)
paint
public void paint(java.awt.Graphics2D g)
- Specified by:
paint
in interface Painter
calculateCarLoads
private int[] calculateCarLoads(ImmutableCargoBundle cb,
int category)
- The length of the returned array is the number of complete carloads of
the specified cargo category in the specified bundle. The values in the
array are the type of the cargo. E.g. if the bundle contained 2 carloads
of cargo type 3 and 1 of type 7, {3, 3, 7} would be returned.