Package rma.swing.table
Class MultiTablePrintManager
java.lang.Object
rma.swing.table.MultiTablePrintManager
-
Field Summary
FieldsFields inherited from interface java.awt.print.Pageable
UNKNOWN_NUMBER_OF_PAGESFields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected RectanglecomputeTableBounds(JTable table) intComputes the number of pages that will be needed for this print.intReturns the number of visible rows per page to have at a minimum.getPageFormat(int pageIndex) Returns the PageFormat need for a given page.getPrintable(int pageIndex) protected Listprotected PointgetStartPoint(JTable table, PageFormat pageFormat, int xOffset, int yOffset) Computes the starting location (upper, left) for a table.protected voidPrivate method that computes the pageformat for each table.protected voidintprint(Graphics graphics, PageFormat pageFormat, int pageIndex) voidprintFooter(Graphics g, PageFormat pageFormat, int pageIndex) voidprintHeader(Graphics g, PageFormat pageFormat, int pageIndex) voidThis methods starts the printing cycle to generate a print preview.voidThis is the method that starts off the entire print process.voidsetPrintProperties(TablePrintProperties properties) voidprotected booleanprotected booleanshowPropertiesDialog(String type) Shows the print properties dialog for the user to adjust the print properties.
-
Field Details
-
m_tables
-
m_printManagers
-
m_totalTableHeight
protected int m_totalTableHeight -
m_totalTableWidth
protected int m_totalTableWidth
-
-
Constructor Details
-
MultiTablePrintManager
public MultiTablePrintManager() -
MultiTablePrintManager
-
MultiTablePrintManager
-
-
Method Details
-
getPrintProperties
-
setPrintProperties
-
getPrintManagers
-
getNumVisibleRowsPerPage
public int getNumVisibleRowsPerPage()Returns the number of visible rows per page to have at a minimum. This way tables do not get "squished" so small that they are not visible anymore. -
addTables
-
setTables
-
getNumberOfPages
public int getNumberOfPages()Computes the number of pages that will be needed for this print.- Specified by:
getNumberOfPagesin interfacePageable- Returns:
- ;
-
getPageFormat
Returns the PageFormat need for a given page. For tables, all page formats are the same.- Specified by:
getPageFormatin interfacePageable
-
getPrintable
- Specified by:
getPrintablein interfacePageable- Throws:
IndexOutOfBoundsException
-
printHeader
-
getStartPoint
Computes the starting location (upper, left) for a table.- Parameters:
table- the table to find the start location forpageFormat- the page that this table will be placed in.xOffset- the offset in pixels to adjust the x locationyOffset- the offset in pixels to adjust the y location- Returns:
-
print
- Specified by:
printin interfacePrintable- Throws:
PrinterException
-
printTables
public void printTables()This is the method that starts off the entire print process. -
printPreview
public void printPreview()This methods starts the printing cycle to generate a print preview. -
initializeBounds
protected void initializeBounds() -
initialize
protected void initialize()Private method that computes the pageformat for each table. This format will be passed to the printing manager for each table. Each print manager will print a table within each table. -
computeTableBounds
-
showPropertiesDialog
protected boolean showPropertiesDialog() -
showPropertiesDialog
Shows the print properties dialog for the user to adjust the print properties. If the user cancels, thus not wanting to print, false is returned. If the user clicks OK then a true is returned.- Parameters:
type- The text to show in the "Print" button, such as switching between Print and Print Preview
-