Class BrushStroke

  • All Implemented Interfaces:
    Stroke


    public class BrushStroke
    extends Object
    implements Stroke
    This Stroke that resembles a brush.

    It's still a work in progress, but I'm distributing it for public use in hopes I can get some useful feedback; maybe even some improvements?

    • Constructor Detail

      • BrushStroke

        public BrushStroke(float width,
                           float thickness,
                           long randomSeed)
        Creates a new BrushStroke using the default angle (pi/2).
        Parameters:
        width - the width (in pixels) of this stroke
        thickness - a float between zero and one indicating how "thick" this stroke should be.
        randomSeed - the random seed for this stroke.
      • BrushStroke

        public BrushStroke(float width,
                           float thickness)
        Creates a new BrushStroke using the default angle (pi/2) and 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.
      • BrushStroke

        public BrushStroke(float width,
                           float thickness,
                           float theta,
                           long randomSeed)
        Creates a new BrushStroke.
        Parameters:
        width - the width (in pixels) of this stroke
        thickness - a float between zero and one indicating how "thick" this stroke should be.
        theta - the angle stroke is drawn at to the original path. An angle of (pi/2) is considered "normal". A value of 0 or pi is very extreme.
        randomSeed - the random seed for this stroke.
    • Method Detail

      • getRandomSeed

        public long getRandomSeed()
      • getThickness

        public float getThickness()
      • getWidth

        public float getWidth()
      • getTheta

        public float getTheta()
      • createStrokedShape

        public Shape createStrokedShape(Shape p)