CoffeeTable.Grid
Class GridPrinter

java.lang.Object
  |
  +--CoffeeTable.Grid.GridPrinterBase
        |
        +--CoffeeTable.Grid.GridPrinter

public class GridPrinter
extends GridPrinterBase

GridPrinter is a sub-class of the GridPrinterBase to provide printing support for the GridPanel under JDK 1.1. You must use the GridPrintable class if you're using JDK 1.2.

To use the GridPrinter class all you need to do in instantiate it, associate a GridPanel with it and call it's print() method. You can customize some of it's features before printing by overriding some of the drawing methods or changing some of the settings.

Here is some sample code that demonstrates how to use this class:


 GridPrinter aPrinter = new GridPrinter(pjob, "Sample Report", grid);
 aPrinter.setPrintRowHeaders(false);
 aPrinter.setPrintColHeaders(true);
 aPrinter.print();
 

Version:
2.1.3 of October 1, 1999 Copyright © 1996-1999 3Magic

Fields inherited from class CoffeeTable.Grid.GridPrinterBase
CENTER, CENTER_LEFT, fAutoResizeColumns, fAutoResizeRows, fColRatios, fEndCell, fEndPage, fFooterHeight, fGrid, fGridHeights, fGridWidths, fHeaderHeight, fPageArea, fPages, fPageSize, fPrintAlignment, fPrintArea, fPrintBorder, fPrintColHeaders, fPrintColLines, fPrintRowHeaders, fPrintRowLines, fScreenRes, fStartCell, fStartPage, fTitle, TOP_CENTER, TOP_LEFT
 
Constructor Summary
GridPrinter(java.awt.PrintJob job, java.lang.String title)
          Constructs a new empty GridPrinter Object.
GridPrinter(java.awt.PrintJob job, java.lang.String title, GridPanelInterface grid)
          Constructs a new empty GridPrinter Object for the specified Grid.
 
Method Summary
 void print()
          Prints the report.
 
Methods inherited from class CoffeeTable.Grid.GridPrinterBase
calcColRange, calcColWidths, calcPageAreas, calcPages, calcRowHeight, calcRowHeights, calcRowRange, drawCell, drawHeaderCol, drawHeaderRow, drawIntersection, getColWidth, getColWidths, getGrid, getNumPages, getPageArea, getPageFooterHeight, getPageHeaderHeight, getPrintableArea, getPrintAlignment, getPrintBorder, getPrintColHeaders, getPrintColLines, getPrintRowHeaders, getPrintRowLines, getRowHeight, getRowHeights, getTitle, isAutoResizeColumns, isAutoResizeRows, printFooter, printHeader, printPage, setAutoResizeColumns, setAutoResizeRows, setColWidths, setGrid, setPageFooterHeight, setPageHeaderHeight, setPageRange, setPrintableArea, setPrintAlignment, setPrintBorder, setPrintColHeaders, setPrintColLines, setPrintRowHeaders, setPrintRowLines, setTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridPrinter

public GridPrinter(java.awt.PrintJob job,
                   java.lang.String title)
Constructs a new empty GridPrinter Object.
Parameters:
job - the PrintJob for this print session
title - a String specifying the report title

GridPrinter

public GridPrinter(java.awt.PrintJob job,
                   java.lang.String title,
                   GridPanelInterface grid)
Constructs a new empty GridPrinter Object for the specified Grid.
Parameters:
job - the PrintJob for this print session
title - a String specifying the report title
grid - the Grid being printed
Method Detail

print

public void print()
Prints the report. This method calculates the number of pages require to print the report and then prints it using the specified settings.