unbbayes.controller
Class PrintTable

java.lang.Object
  extended by unbbayes.controller.PrintTable
All Implemented Interfaces:
Pageable, Printable

public class PrintTable
extends Object
implements Printable, Pageable

Table printing class JTable


Field Summary
protected  List owners
           
protected  PageFormat pageFormat
           
protected  List tables
           
protected  String title
           
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Fields inherited from interface java.awt.print.Pageable
UNKNOWN_NUMBER_OF_PAGES
 
Constructor Summary
PrintTable(List tbs, List owners, PageFormat pf)
           
PrintTable(List tables, String title, PageFormat pageFormat)
           
 
Method Summary
 int getNumberOfPages()
          Calculate the number of pages it will take to print the entire table
 PageFormat getPageFormat(int index)
           
 Printable getPrintable(int index)
           
protected  Dimension getPrintSize(JTable table, int positionX, int positionY)
          Calculate how much of the table will fit on a page without causing a row or column to be split across two pages
protected  void paintTable(String title, JTable table, Graphics g, int positionX, int positionY, Dimension size)
          Paint / print a portion of the table
 int print(Graphics g, PageFormat pf, int index)
          Perform the printing here
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tables

protected List tables

owners

protected List owners

pageFormat

protected PageFormat pageFormat

title

protected String title
Constructor Detail

PrintTable

public PrintTable(List tbs,
                  List owners,
                  PageFormat pf)

PrintTable

public PrintTable(List tables,
                  String title,
                  PageFormat pageFormat)
Method Detail

print

public int print(Graphics g,
                 PageFormat pf,
                 int index)
Perform the printing here

Specified by:
print in interface Printable

getPrintSize

protected Dimension getPrintSize(JTable table,
                                 int positionX,
                                 int positionY)
Calculate how much of the table will fit on a page without causing a row or column to be split across two pages


paintTable

protected void paintTable(String title,
                          JTable table,
                          Graphics g,
                          int positionX,
                          int positionY,
                          Dimension size)
Paint / print a portion of the table


getNumberOfPages

public int getNumberOfPages()
Calculate the number of pages it will take to print the entire table

Specified by:
getNumberOfPages in interface Pageable

getPrintable

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

getPageFormat

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


Copyright © 2001-2010 University of Brasilia - UnB. All Rights Reserved.