CoffeeTable.Grid.Printable
Class GridPrintable
java.lang.Object
|
+--CoffeeTable.Grid.GridPrinterBase
|
+--CoffeeTable.Grid.Printable.GridPrintable
- public class GridPrintable
- extends GridPrinterBase
- implements java.awt.print.Printable
GridPrintable is a sub-class of the GridPrinterBase to provide printing support
for the GridPanel under JDK 1.2 by implementing JDK 1.2's Printable interface. You must use the GridPrinter class if
you're using JDK 1.1.
To use the GridPrintable class all you need to do in instantiate it, associate
it with the PrinterJob and call PrinterJob'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:
GridPrintable gridPrintable = new GridPrintable("Sample Report", grid);
gridPrintable.setPrintRowHeaders(false);
gridPrintable.setPrintColHeaders(true);
printerJob.setPrintable(gridPrintable, pageFormat);
if (printerJob.printDialog()) {
try {
printerJob.print();
} catch (Exception ex) {
}
}
- 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 |
| Fields inherited from interface java.awt.print.Printable |
NO_SUCH_PAGE,
PAGE_EXISTS |
|
Constructor Summary |
GridPrintable(java.lang.String title)
Constructs a new empty GridPrintable Object. |
GridPrintable(java.lang.String title,
GridPanel grid)
Constructs a new empty GridPrintable Object for the specified Grid. |
|
Method Summary |
int |
print(java.awt.Graphics graphics,
java.awt.print.PageFormat pageFormat,
int pageIndex)
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 |
GridPrintable
public GridPrintable(java.lang.String title)
- Constructs a new empty GridPrintable Object.
- Parameters:
title - a String specifying the report title
GridPrintable
public GridPrintable(java.lang.String title,
GridPanel grid)
- Constructs a new empty GridPrintable Object for the specified Grid.
- Parameters:
title - a String specifying the report titlegrid - the Grid being printed
print
public int print(java.awt.Graphics graphics,
java.awt.print.PageFormat pageFormat,
int pageIndex)
throws java.awt.print.PrinterException
- Prints the report. This method calculates the number of pages require to
print the report and then prints it using the specified settings.
- Specified by:
- print in interface java.awt.print.Printable