Class BristleStroke

  • All Implemented Interfaces:
    Stroke


    public class BristleStroke
    extends Object
    implements Stroke
    This Stroke that resembles a bristle.

    More specifically: this stroke splatters tiny triangles and dots over a path.

    • Field Detail

      • width

        public final float width
      • thickness

        public final float thickness
    • Constructor Detail

      • BristleStroke

        public BristleStroke(float width,
                             float thickness)
        Creates a new BristleStroke.

        This constructor always uses a random seed of zero.

        Parameters:
        width - the width (in pixels) of this stroke.
        thickness - a float between zero and one indicating how "thick" this stroke should be. (1 = "very thick", and 0 = "very thin")
      • BristleStroke

        public BristleStroke(float width,
                             float thickness,
                             long randomSeed)
        Creates a new BristleStroke.
        Parameters:
        width - the width (in pixels) of this stroke.
        thickness - a float between zero and one indicating how "thick" this stroke should be. (1 = "very thick", and 0 = "very thin")
        randomSeed - the random seed for this stroke.
    • Method Detail

      • getRandomSeed

        public long getRandomSeed()
        Returns:
        the random seed used in this stroke
      • getThickness

        public float getThickness()
        Returns:
        the thickness of this stroke (a float between zero and one).
      • getWidth

        public float getWidth()
        Returns:
        the width (in pixels) of this stroke.
      • createStrokedShape

        public Shape createStrokedShape(Shape p)