Class PDFPattern

java.lang.Object
org.loboevolution.pdfview.pattern.PDFPattern
Direct Known Subclasses:
PatternType1, PatternType2

public abstract class PDFPattern extends Object
The abstract superclass of all PDF Pattern types
  • Constructor Details

    • PDFPattern

      protected PDFPattern(int type)
      Creates a new instance of PDFPattern
      Parameters:
      type - a Integer object.
  • Method Details

    • getPattern

      public static PDFPattern getPattern(PDFObject patternObj, Map resources) throws IOException
      Read a pattern from the given pattern stream
      Parameters:
      patternObj - a PDFObject object.
      resources - a Map object.
      Returns:
      a PDFPattern object.
      Throws:
      IOException - if any.
    • getPatternType

      public int getPatternType()
      Get the type of this pattern
      Returns:
      a Integer object.
    • getTransform

      public AffineTransform getTransform()
      Get the transform associated with this pattern
      Returns:
      a AffineTransform object.
    • setTransform

      protected void setTransform(AffineTransform xform)
      Set the transform associated with this pattern
      Parameters:
      xform - a AffineTransform object.
    • parse

      protected abstract void parse(PDFObject patternObj, Map resources) throws IOException
      Parse the pattern-specific information from the pdf object
      Parameters:
      patternObj - the pdfobject with data for this pattern
      resources - a Map object.
      Throws:
      IOException - if any.
    • getPaint

      public abstract PDFPaint getPaint(PDFPaint basePaint)
      Returns paint that represents the selected pattern
      Parameters:
      basePaint - the background paint color, or null for none
      Returns:
      a PDFPaint object.