FreeHEP API
Version current

org.freehep.swing.print.table
Class TablePrinter

java.lang.Object
  extended byorg.freehep.swing.print.table.TablePrinter
All Implemented Interfaces:
Pageable, Printable

public class TablePrinter
extends Object
implements Pageable, Printable

Utility for printing tables.

Source Code:
TablePrinter.java

Field Summary
 
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
TablePrinter(PrintableTableModel model, PageFormat pf, Font headerFont, Font cellFont, FontRenderContext frc)
          Create a TablePrinter from a PrintableTableModel
TablePrinter(TableModel model, String title, PageFormat pf, Font headerFont, Font cellFont, FontRenderContext frc)
          Create a TablePrinter from a TableModel
 
Method Summary
 int getNumberOfPages()
           
 PageFormat getPageFormat(int p1)
           
 Printable getPrintable(int p1)
           
 int print(Graphics g, PageFormat pf, int page)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TablePrinter

public TablePrinter(PrintableTableModel model,
                    PageFormat pf,
                    Font headerFont,
                    Font cellFont,
                    FontRenderContext frc)
Create a TablePrinter from a PrintableTableModel

Parameters:
model - The table model to print
pf - The page format to use for printing
headerFont - The font to be used for the table header
cellFont - The font to be used for the cells in the body of the table.
frc - The font render context for the printing device

TablePrinter

public TablePrinter(TableModel model,
                    String title,
                    PageFormat pf,
                    Font headerFont,
                    Font cellFont,
                    FontRenderContext frc)
Create a TablePrinter from a TableModel

Parameters:
model - The table model to print
title - The title to use for the print job
pf - The page format to use for printing
headerFont - The font to be used for the table header
cellFont - The font to be used for the cells in the body of the table.
frc - The font render context for the printing device
Method Detail

getNumberOfPages

public int getNumberOfPages()
Specified by:
getNumberOfPages in interface Pageable

getPageFormat

public PageFormat getPageFormat(int p1)
Specified by:
getPageFormat in interface Pageable

getPrintable

public Printable getPrintable(int p1)
Specified by:
getPrintable in interface Pageable

print

public int print(Graphics g,
                 PageFormat pf,
                 int page)
Specified by:
print in interface Printable

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.