Class DrawParameters

java.lang.Object
org.jpedal.manipulator.DrawParameters

public final class DrawParameters extends Object
Holds drawing rules.
  • Field Details

    • NONE

      public static final int NONE
      End path without filling or stroking ("no op").
      See Also:
    • STROKE

      public static final int STROKE
      Stroke path.
      See Also:
    • STROKE_FILL_EVEN_ODD

      public static final int STROKE_FILL_EVEN_ODD
      Stroke and fill path using the even-odd winding rule.
      See Also:
    • STROKE_FILL_NON_ZERO

      public static final int STROKE_FILL_NON_ZERO
      Stroke and fill path using the non-zero winding rule.
      See Also:
    • FILL_EVEN_ODD

      public static final int FILL_EVEN_ODD
      Fill path using even-odd winding rule.
      See Also:
    • FILL_NON_ZERO

      public static final int FILL_NON_ZERO
      Fill path using non-zero winding rule.
      See Also:
    • BUTT_CAP

      public static final int BUTT_CAP
      Butt line cap style
      See Also:
    • ROUND_CAP

      public static final int ROUND_CAP
      Round line cap style
      See Also:
    • PROJECTING_SQUARE_CAP

      public static final int PROJECTING_SQUARE_CAP
      Projecting square line cap style
      See Also:
    • MITER_JOIN

      public static final int MITER_JOIN
      Miter line join style
      See Also:
    • ROUND_JOIN

      public static final int ROUND_JOIN
      Round line join style
      See Also:
    • BEVEL_JOIN

      public static final int BEVEL_JOIN
      Bevel line join style
      See Also:
  • Constructor Details

    • DrawParameters

      public DrawParameters()
      Create a new set of drawing rules
  • Method Details

    • getFillRule

      public int getFillRule()
      Returns the fill rule used for filling paths.
      Returns:
      the fill rule as an integer
    • setFillRule

      public DrawParameters setFillRule(int fillRule)
      Sets the fill rule used for filling paths.
      Parameters:
      fillRule - the fill rule to set
      Returns:
      a reference to this DrawParameters
    • getFillColor

      public float[] getFillColor()
      Returns the color used for filling shapes.
      Returns:
      an array of floats representing the fill color in RGB
    • setFillColor

      public DrawParameters setFillColor(float[] fillColor)
      Sets the color used for filling shapes.
      Parameters:
      fillColor - an array of floats representing the fill color in RGB
      Returns:
      a reference to this DrawParameters
    • getStrokeColor

      public float[] getStrokeColor()
      Returns the color used for stroking shapes.
      Returns:
      an array of floats representing the stroke color in RGB
    • setStrokeColor

      public DrawParameters setStrokeColor(float[] strokeColor)
      Sets the color used for stroking shapes.
      Parameters:
      strokeColor - an array of floats representing the stroke color in RGB
      Returns:
      a reference to this DrawParameters
    • getLineWidth

      public float getLineWidth()
      Returns the width of the stroke line.
      Returns:
      the line width as a float
    • setLineWidth

      public DrawParameters setLineWidth(float lineWidth)
      Sets the width of the stroke line.
      Parameters:
      lineWidth - the line width to set
      Returns:
      a reference to this DrawParameters
    • getLineCap

      public int getLineCap()
      Returns the style of the line cap used when stroking paths.
      Returns:
      the line cap style as an integer
    • setLineCap

      public DrawParameters setLineCap(int lineCap)
      Sets the style of the line cap used when stroking paths.

      See constants above.

      Parameters:
      lineCap - the line cap style to set
      Returns:
      a reference to this DrawParameters
    • getLineJoin

      public int getLineJoin()
      Returns the style of the line join used when stroking paths.
      Returns:
      the line join style as an integer
    • setLineJoin

      public DrawParameters setLineJoin(int lineJoin)
      Sets the style of the line join used when stroking paths.

      See constants above.

      Parameters:
      lineJoin - the line join style to set
      Returns:
      a reference to this DrawParameters
    • getMiterLimit

      public float getMiterLimit()
      Returns the miter limit used when stroking with a miter join.
      Returns:
      the miter limit as a float
    • setMiterLimit

      public DrawParameters setMiterLimit(float miterLimit)
      Sets the miter limit used when stroking with a miter join.
      Parameters:
      miterLimit - the miter limit to set
      Returns:
      a reference to this DrawParameters
    • getDashArray

      public float[] getDashArray()
      Returns the dash array used for stroking dashed lines.
      Returns:
      an array of floats representing the dash pattern
    • setDashArray

      public DrawParameters setDashArray(float[] dashArray)
      Sets the dash array used for stroking dashed lines.

      See setDashPhase(float)

      Parameters:
      dashArray - an array of floats representing the dash pattern
      Returns:
      a reference to this DrawParameters
    • getDashPhase

      public float getDashPhase()
      Returns the dash phase used for stroking dashed lines.
      Returns:
      the dash phase as a float
    • setDashPhase

      public DrawParameters setDashPhase(float dashPhase)
      Sets the dash phase used for stroking dashed lines.

      See setDashArray(float[])

      Parameters:
      dashPhase - the dash phase to set
      Returns:
      a reference to this DrawParameters
    • getFillAlpha

      public float getFillAlpha()
      Returns the fill transparency.
      Returns:
      the alpha as a float
    • setFillAlpha

      public DrawParameters setFillAlpha(float fillAlpha)
      Sets the fill transparency.
      Parameters:
      fillAlpha - the alpha to set
      Returns:
      a reference to this DrawParameters
    • getStrokeAlpha

      public float getStrokeAlpha()
      Returns the stroke transparency
      Returns:
      the alpha as a float
    • setStrokeAlpha

      public DrawParameters setStrokeAlpha(float strokeAlpha)
      Sets the stroke transparency.
      Parameters:
      strokeAlpha - the alpha to set
      Returns:
      a reference to this DrawParameters
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object