LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingTable._TablePrinter

java.lang.Object
  extended by leon.view.win.swing.LySwingTable._TablePrinter
All Implemented Interfaces:
java.awt.print.Printable
Enclosing class:
LySwingTable

public class LySwingTable._TablePrinter
extends java.lang.Object
implements java.awt.print.Printable

This class manages the print processus of the table.


Field Summary
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Constructor Summary
LySwingTable._TablePrinter()
          Creates a new printer job for this table and invokes its print dialog.
 
Method Summary
 void getPageInfo(java.awt.Graphics g, java.awt.print.PageFormat pageFormat)
          Computes all the parameters of the printing job.
 double getRatio()
          Gets the rescaling ratio value.
 int print(java.awt.Graphics g, java.awt.print.PageFormat pageFormat, int pageIndex)
           
 java.awt.Dimension printFooterCell(java.awt.Graphics g, int column, int x, int y)
          Prints a footer cell depending on its dimensions.
 java.awt.Dimension printHeaderCell(java.awt.Graphics g, int column, int x, int y)
          Prints a header cell depending on its dimensions.
 java.awt.Dimension printTableCell(java.awt.Graphics g, int row, int column, int x, int y)
          Prints a table cell depending on its dimensions.
 void printTablePart(java.awt.Graphics2D g, java.awt.print.PageFormat pageFormat, int hPageNum, int vPageNum)
          Prints a page.
 void setRatio(double ratio)
          Sets the ratio of the rescaling.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LySwingTable._TablePrinter

public LySwingTable._TablePrinter()
Creates a new printer job for this table and invokes its print dialog.

Method Detail

setRatio

public void setRatio(double ratio)
Sets the ratio of the rescaling. The new ratio value must be comprised between 0.1 and 5.

Parameters:
ratio - the value of the ratio
See Also:
getRatio()

getRatio

public double getRatio()
Gets the rescaling ratio value.

Returns:
the ratio
See Also:
setRatio(double)

printHeaderCell

public java.awt.Dimension printHeaderCell(java.awt.Graphics g,
                                          int column,
                                          int x,
                                          int y)
Prints a header cell depending on its dimensions. The text of the cell is truncated if it is too long for the printing job.

Parameters:
g - the target graphics
column - the index of the cell
x - the x coordinate of the left border of the cell
y - the x coordinate of the top border of the cell
Returns:
the dimension of the cell

printFooterCell

public java.awt.Dimension printFooterCell(java.awt.Graphics g,
                                          int column,
                                          int x,
                                          int y)
Prints a footer cell depending on its dimensions. The text of the cell is truncated if it is too long for the printing job.

Parameters:
g - the target graphics
column - the index of the cell
x - the x coordinates of the left border of the cell
y - the y coordinates of the top border of the cell
Returns:
the dimension of the cell

printTableCell

public java.awt.Dimension printTableCell(java.awt.Graphics g,
                                         int row,
                                         int column,
                                         int x,
                                         int y)
Prints a table cell depending on its dimensions. The text of the cell is truncated if it is too long for the printing job.

Parameters:
g - the target graphics
row - the row index of the cell
column - the column index of the cell
x - the x coordinates of the left border of the cell
y - the y coordinates of the top border of the cell
Returns:
the dimension of the cell

printTablePart

public void printTablePart(java.awt.Graphics2D g,
                           java.awt.print.PageFormat pageFormat,
                           int hPageNum,
                           int vPageNum)
Prints a page. It comprises the page header message and the page's table cells sourrounded by the header and footer cells.

Parameters:
g - the target graphics
pageFormat - the format of this page, this attribute is not used here
hPageNum - the horizontal index of page
vPageNum - the vertical index of page

print

public int print(java.awt.Graphics g,
                 java.awt.print.PageFormat pageFormat,
                 int pageIndex)
          throws java.awt.print.PrinterException
Specified by:
print in interface java.awt.print.Printable
Throws:
java.awt.print.PrinterException

getPageInfo

public void getPageInfo(java.awt.Graphics g,
                        java.awt.print.PageFormat pageFormat)
Computes all the parameters of the printing job.

Parameters:
g - the target graphics
pageFormat - the format of the page

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com