Class FormGenerator

  • Direct Known Subclasses:
    ImageFormGenerator

    public abstract class FormGenerator
    extends java.lang.Object
    Abstract helper class for generating PostScript forms.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.awt.geom.Dimension2D dimensions  
      private java.lang.String formName  
      private java.lang.String title  
    • Constructor Summary

      Constructors 
      Constructor Description
      FormGenerator​(java.lang.String formName, java.lang.String title, java.awt.geom.Dimension2D dimensions)
      Main constructor.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      PSResource generate​(PSGenerator gen)
      Generates the PostScript form.
      protected void generateAdditionalDataStream​(PSGenerator gen)
      Generates some PostScript code right after the form definition (used primarily for bitmap data).
      protected abstract void generatePaintProc​(PSGenerator gen)
      Generates the PostScript code for the PaintProc of the form.
      protected java.awt.geom.Rectangle2D getBBox()
      Returns the form's bounding box.
      java.awt.geom.Dimension2D getDimensions()
      returns the form's dimensions.
      java.lang.String getFormName()
      Returns the form's name.
      protected java.awt.geom.AffineTransform getMatrix()
      Returns the matrix for use in the form.
      java.lang.String getTitle()
      Returns the form's title.
      • Methods inherited from class java.lang.Object

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

      • formName

        private java.lang.String formName
      • title

        private java.lang.String title
      • dimensions

        private java.awt.geom.Dimension2D dimensions
    • Constructor Detail

      • FormGenerator

        public FormGenerator​(java.lang.String formName,
                             java.lang.String title,
                             java.awt.geom.Dimension2D dimensions)
        Main constructor.
        Parameters:
        formName - the form's name
        title - the form's title or null
        dimensions - the form's dimensions
    • Method Detail

      • getFormName

        public java.lang.String getFormName()
        Returns the form's name.
        Returns:
        the form's name
      • getTitle

        public java.lang.String getTitle()
        Returns the form's title.
        Returns:
        the form's title or null if there's no title
      • getDimensions

        public java.awt.geom.Dimension2D getDimensions()
        returns the form's dimensions.
        Returns:
        the form's dimensions
      • generatePaintProc

        protected abstract void generatePaintProc​(PSGenerator gen)
                                           throws java.io.IOException
        Generates the PostScript code for the PaintProc of the form.
        Parameters:
        gen - the PostScript generator
        Throws:
        java.io.IOException - if an I/O error occurs
      • generateAdditionalDataStream

        protected void generateAdditionalDataStream​(PSGenerator gen)
                                             throws java.io.IOException
        Generates some PostScript code right after the form definition (used primarily for bitmap data).
        Parameters:
        gen - the PostScript generator
        Throws:
        java.io.IOException - if an I/O error occurs
      • getMatrix

        protected java.awt.geom.AffineTransform getMatrix()
        Returns the matrix for use in the form.
        Returns:
        the matrix
      • getBBox

        protected java.awt.geom.Rectangle2D getBBox()
        Returns the form's bounding box.
        Returns:
        the form's bounding box
      • generate

        public PSResource generate​(PSGenerator gen)
                            throws java.io.IOException
        Generates the PostScript form.
        Parameters:
        gen - the PostScript generator
        Returns:
        a PSResource instance representing the form
        Throws:
        java.io.IOException - if an I/O error occurs