Class RailroadStroke

java.lang.Object
org.ka2ddo.yaac.gui.RailroadStroke
All Implemented Interfaces:
Stroke

public class RailroadStroke extends Object implements Stroke
This class defines a solid Stroke which alternates widths of the line between a narrow width (the "rail") and a wide width (the "tie"). The rail width, tie width, and tie spacing are all configurable parameters.
  • Constructor Details

    • RailroadStroke

      public RailroadStroke(float railWidth, float tieWidth, float tieSpacing)
  • Method Details

    • createStrokedShape

      public Shape createStrokedShape(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.
      Specified by:
      createStrokedShape in interface Stroke
      Parameters:
      p - a Shape to be stroked
      Returns:
      the stroked outline Shape.