experimental
Class TrackRenderer

java.lang.Object
  extended by experimental.TrackRenderer

public class TrackRenderer
extends java.lang.Object

Provides methods that render track pieces.

Author:
Luke Lindsay
See Also:
TrackTilesGenerator

Field Summary
(package private)  boolean doubleTrack
           
(package private)  float doubleTrackGap
           
(package private)  float gauge
           
(package private)  java.awt.Image icon
           
private  ImageManager imageManager
           
(package private)  java.awt.BasicStroke rail
           
(package private)  java.awt.Color railsColor
           
(package private)  double sleeperLength
           
(package private)  java.awt.Color sleepersColor
           
(package private)  float sleeperWidth
           
(package private)  float targetSleeperGap
           
(package private)  float tileWidth
           
(package private)  boolean tunnel
           
 
Constructor Summary
TrackRenderer()
           
 
Method Summary
private  java.awt.geom.Point2D.Double controlPoint(java.awt.geom.Point2D.Double from)
           
static java.awt.geom.CubicCurve2D.Double createAdjacentCurve(java.awt.geom.CubicCurve2D.Double c, double shift1, double shift2)
           
static java.awt.geom.Line2D.Double createParallelLine(java.awt.geom.Line2D.Double line, double shift)
           
 java.awt.BasicStroke getStroke4Curve(java.awt.geom.CubicCurve2D.Double curve)
          Generates the Stroke used to draw the sleepers for track section represented by the specified curve.
(package private)  void paintTrack(java.awt.Graphics2D g, java.util.List<java.awt.geom.CubicCurve2D.Double> sections)
           
(package private)  void paintTrackConf(java.awt.Graphics2D g2, TrackConfiguration conf)
           
(package private)  void setIcon(java.lang.String typeName)
           
(package private)  java.awt.geom.CubicCurve2D.Double toCurve(Step a)
           
(package private)  java.awt.geom.CubicCurve2D.Double toCurve(Step a, Step b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

imageManager

private final ImageManager imageManager

sleepersColor

java.awt.Color sleepersColor

railsColor

java.awt.Color railsColor

sleeperLength

double sleeperLength

sleeperWidth

float sleeperWidth

targetSleeperGap

float targetSleeperGap

tileWidth

float tileWidth

gauge

float gauge

rail

java.awt.BasicStroke rail

doubleTrack

boolean doubleTrack

doubleTrackGap

float doubleTrackGap

icon

java.awt.Image icon

tunnel

boolean tunnel
Constructor Detail

TrackRenderer

public TrackRenderer()
Method Detail

paintTrackConf

void paintTrackConf(java.awt.Graphics2D g2,
                    TrackConfiguration conf)

toCurve

java.awt.geom.CubicCurve2D.Double toCurve(Step a)

toCurve

java.awt.geom.CubicCurve2D.Double toCurve(Step a,
                                          Step b)

paintTrack

void paintTrack(java.awt.Graphics2D g,
                java.util.List<java.awt.geom.CubicCurve2D.Double> sections)

getStroke4Curve

public java.awt.BasicStroke getStroke4Curve(java.awt.geom.CubicCurve2D.Double curve)
Generates the Stroke used to draw the sleepers for track section represented by the specified curve.


createParallelLine

public static java.awt.geom.Line2D.Double createParallelLine(java.awt.geom.Line2D.Double line,
                                                             double shift)

createAdjacentCurve

public static java.awt.geom.CubicCurve2D.Double createAdjacentCurve(java.awt.geom.CubicCurve2D.Double c,
                                                                    double shift1,
                                                                    double shift2)

controlPoint

private java.awt.geom.Point2D.Double controlPoint(java.awt.geom.Point2D.Double from)

setIcon

void setIcon(java.lang.String typeName)