public class RailroadStroke
extends java.lang.Object
implements java.awt.Stroke
Constructor and Description |
---|
RailroadStroke(float railWidth,
float tieWidth,
float tieSpacing)
Create a RailroadStroke.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Shape |
createStrokedShape(java.awt.Shape p)
Returns an outline
Shape which encloses the area that
should be painted when the Shape is stroked according
to the rules defined by the
object implementing the Stroke interface. |
float |
getRailWidth()
Get the rendering width of the rail.
|
float |
getTieSpacing()
Get spacing of rendered ties along the rail.
|
float |
getTieWidth()
Get the rendering length of the railroad ties.
|
public RailroadStroke(float railWidth, float tieWidth, float tieSpacing)
railWidth
- float width of the rail centerline in pixelstieWidth
- float length of the ties sticking out perpendicular to the rail in pixelstieSpacing
- float spacing between ties along a rail in pixelspublic java.awt.Shape createStrokedShape(java.awt.Shape p)
Shape
which encloses the area that
should be painted when the Shape
is stroked according
to the rules defined by the
object implementing the Stroke
interface.createStrokedShape
in interface java.awt.Stroke
p
- a Shape
to be strokedShape
.public float getRailWidth()
public float getTieWidth()
public float getTieSpacing()