Class PDFPattern

  • Direct Known Subclasses:
    PatternType1

    public abstract class PDFPattern
    extends java.lang.Object
    The abstract superclass of all PDF Pattern types
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int type
      the pattern type (1 or 2)
      private java.awt.geom.AffineTransform xform
      the matrix to transform from pattern space to PDF space
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected PDFPattern​(int type)
      Creates a new instance of PDFPattern
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract PDFPaint getPaint​(PDFPaint basePaint)
      Returns paint that represents the selected pattern
      static PDFPattern getPattern​(PDFObject patternObj, java.util.Map resources)
      Read a pattern from the given pattern stream
      int getPatternType()
      Get the type of this pattern
      java.awt.geom.AffineTransform getTransform()
      Get the transform associated with this pattern
      protected abstract void parse​(PDFObject patternObj, java.util.Map resources)
      Parse the pattern-specific information from the pdf object
      protected void setTransform​(java.awt.geom.AffineTransform xform)
      Set the transform associated with this pattern
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • type

        private int type
        the pattern type (1 or 2)
      • xform

        private java.awt.geom.AffineTransform xform
        the matrix to transform from pattern space to PDF space
    • Constructor Detail

      • PDFPattern

        protected PDFPattern​(int type)
        Creates a new instance of PDFPattern
    • Method Detail

      • getPattern

        public static PDFPattern getPattern​(PDFObject patternObj,
                                            java.util.Map resources)
                                     throws java.io.IOException
        Read a pattern from the given pattern stream
        Throws:
        java.io.IOException
      • getPatternType

        public int getPatternType()
        Get the type of this pattern
      • getTransform

        public java.awt.geom.AffineTransform getTransform()
        Get the transform associated with this pattern
      • setTransform

        protected void setTransform​(java.awt.geom.AffineTransform xform)
        Set the transform associated with this pattern
      • parse

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

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