com.ibm.tivoli.maximo.report.applet.quickprint

Class TextRenderer

  • java.lang.Object
    • com.ibm.tivoli.maximo.report.applet.quickprint.TextRenderer
  • All Implemented Interfaces:
    java.awt.print.Pageable, java.awt.print.Printable


    public class TextRenderer
    extends java.lang.Object
    implements java.awt.print.Pageable, java.awt.print.Printable
    This class is to handle text and csv files printing
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String FONTFAMILY 
      static int FONTSIZE 
      static int FONTSTYLE 
      static float LINESPACEFACTOR 
      • Fields inherited from interface java.awt.print.Pageable

        UNKNOWN_NUMBER_OF_PAGES
      • Fields inherited from interface java.awt.print.Printable

        NO_SUCH_PAGE, PAGE_EXISTS
    • Constructor Summary

      Constructors 
      Constructor and Description
      TextRenderer(java.io.Reader stream, java.awt.print.PageFormat format)
      Create a PageableText object for a stream of text
      TextRenderer(java.lang.String text, java.awt.print.PageFormat format)
      Create a PageableText object for a string of text
      TextRenderer(java.net.URL fileURL, java.awt.print.PageFormat format)
      Create a PageableText object for a file of text
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int getNumberOfPages() 
      java.awt.print.PageFormat getPageFormat(int pagenum) 
      java.awt.print.Printable getPrintable(int pagenum) 
      int print(java.awt.Graphics g, java.awt.print.PageFormat format, int pagenum)
      This is the print() method of the Printable interface.
      • Methods inherited from class java.lang.Object

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

      • FONTFAMILY

        public static java.lang.String FONTFAMILY
      • FONTSIZE

        public static int FONTSIZE
      • FONTSTYLE

        public static int FONTSTYLE
      • LINESPACEFACTOR

        public static float LINESPACEFACTOR
    • Constructor Detail

      • TextRenderer

        public TextRenderer(java.lang.String text,
                            java.awt.print.PageFormat format)
                     throws java.io.IOException
        Create a PageableText object for a string of text
        Throws:
        java.io.IOException
      • TextRenderer

        public TextRenderer(java.net.URL fileURL,
                            java.awt.print.PageFormat format)
                     throws java.io.IOException
        Create a PageableText object for a file of text
        Throws:
        java.io.IOException
      • TextRenderer

        public TextRenderer(java.io.Reader stream,
                            java.awt.print.PageFormat format)
                     throws java.io.IOException
        Create a PageableText object for a stream of text
        Throws:
        java.io.IOException
    • Method Detail

      • getNumberOfPages

        public int getNumberOfPages()
        Specified by:
        getNumberOfPages in interface java.awt.print.Pageable
      • getPageFormat

        public java.awt.print.PageFormat getPageFormat(int pagenum)
        Specified by:
        getPageFormat in interface java.awt.print.Pageable
      • getPrintable

        public java.awt.print.Printable getPrintable(int pagenum)
        Specified by:
        getPrintable in interface java.awt.print.Pageable
      • print

        public int print(java.awt.Graphics g,
                         java.awt.print.PageFormat format,
                         int pagenum)
        This is the print() method of the Printable interface. It does most of the printing work.
        Specified by:
        print in interface java.awt.print.Printable