Class PDFPaint

java.lang.Object
org.loboevolution.pdfview.PDFPaint

public class PDFPaint extends Object
PDFPaint is some kind of shader that knows how to fill a path. At the moment, only a solid color is implemented, but gradients and textures should be possible, too.

Author Mike Wessler

  • Constructor Details

    • PDFPaint

      protected PDFPaint(Paint p)
      create a new PDFPaint based on a solid color
      Parameters:
      p - a Paint object.
  • Method Details

    • getColorPaint

      public static PDFPaint getColorPaint(Color c)
      get the PDFPaint representing a solid color
      Parameters:
      c - a Color object.
      Returns:
      a PDFPaint object.
    • getPaint

      public static PDFPaint getPaint(Paint p)
      get the PDFPaint representing a generic paint
      Parameters:
      p - a Paint object.
      Returns:
      a PDFPaint object.
    • fill

      public Rectangle2D fill(PDFRenderer state, Graphics2D g, GeneralPath s)
      fill a path with the paint, and record the dirty area.
      Parameters:
      state - the current graphics state
      g - the graphics into which to draw
      s - the path to fill
      Returns:
      a Rectangle2D object.
    • getPaint

      public Paint getPaint()
      get the primary color associated with this PDFPaint.
      Returns:
      a Paint object.