JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.higrid
Class PrintGrid12

java.lang.Object
  |
  +--com.klg.jclass.higrid.PrintGrid
        |
        +--com.klg.jclass.higrid.PrintGrid12
All Implemented Interfaces:
Pageable, Printable, Serializable

public class PrintGrid12
extends PrintGrid
implements Printable, Pageable, Serializable

Controls printing of pages with header and footer. Margin insets are for the grid area only. Header and footer are part of the margin area.

See Also:
Serialized Form

Field Summary
protected  int columnPageIndex
           
protected  int columnPages
           
protected  int currentPage
           
protected  PageFormat currentPageFormat
           
static int DEFAULT_PAGE_MARGIN_IN_72TH_INCHES
           
protected  Insets defaultMargin
           
protected  com.klg.jclass.higrid.HiGrid grid
           
protected  Insets margin
           
protected static int MARGIN_ADJUSTMENT_IN_72TH_INCHES
           
protected  int printFormat
           
protected  com.klg.jclass.higrid.RowTree printRowTree
           
protected  Vector rowNodeList
           
protected  int rowPageIndex
           
protected  int rowPages
           
protected  int totalNumPages
           
 
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
PrintGrid12(com.klg.jclass.higrid.HiGrid grid)
          Constructor.
 
Method Summary
protected  void disposePrintTimeRowTree()
          Cleanup the print time row tree.
protected  void doPrintEnd(Graphics graphicContext, PageFormat pageFormat, int top)
          Notifies print listeners that the end of the last page is being printed.
protected  void doPrintPageFooter(Graphics graphicContext, PageFormat pageFormat)
          Notifies print listeners that the page footer is being printed.
protected  void doPrintPageHeader(Graphics graphicContext, PageFormat pageFormat)
          Notifies print listeners that the page header is being printed.
 int getColumnPageIndex()
          Gets the column page index value.
 int getCurrentPageIndex()
          Gets the current page index.
 Insets getDefaultMargin()
          Gets the default margin.
 Insets getMargin()
          Gets the margin insets.
 int getNumberOfPages()
          Gets the number of pages in the set.
 PageFormat getPageFormat()
          Gets the current pageFormat.
 PageFormat getPageFormat(int pageIndex)
          Always returns the PageFormat of the page specified by pageIndex.
 int getPageHeight()
          Gets the height of a page.
 int getPageWidth()
          Gets the width of a page.
 Printable getPrintable(int pageIndex)
          Gets the Printable instance responsible for rendering the page specified by pageIndex.
 int getPrintableHeight()
          Gets the printable height of a page.
 int getPrintableWidth()
          Gets the printable width of a page.
protected  Point getPrintOffset(PageFormat pageFormat)
          Gets the top/left corner of the printable area on the page.
protected  com.klg.jclass.higrid.RowTree getPrintTimeRowTree()
          Setup the print time row tree.
 int getRowPageIndex()
          Gets the row page index value.
 int getTotalNumPages()
          Gets the total number of pages to print.
 void initialize(PageFormat pageFormat)
          Computes the total number of pages for this job.
 int print(Graphics gc, PageFormat pageFormat, int pageIndex)
          Print/Paint the indicated page.
 void printPageFooter(com.klg.jclass.higrid.HiGridPrintEvent event)
          Prints default footer.
 void setMargin(Insets margin)
          Sets the page margins.
 void setPageFormat(PageFormat format)
          Sets the current pageFormat.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PAGE_MARGIN_IN_72TH_INCHES

public static final int DEFAULT_PAGE_MARGIN_IN_72TH_INCHES
See Also:
Constant Field Values

MARGIN_ADJUSTMENT_IN_72TH_INCHES

protected static final int MARGIN_ADJUSTMENT_IN_72TH_INCHES
See Also:
Constant Field Values

grid

protected transient com.klg.jclass.higrid.HiGrid grid

currentPageFormat

protected transient PageFormat currentPageFormat

defaultMargin

protected transient Insets defaultMargin

margin

protected transient Insets margin

totalNumPages

protected transient int totalNumPages

currentPage

protected transient int currentPage

rowPageIndex

protected transient int rowPageIndex

columnPageIndex

protected transient int columnPageIndex

printFormat

protected transient int printFormat

printRowTree

protected transient com.klg.jclass.higrid.RowTree printRowTree

rowNodeList

protected transient Vector rowNodeList

rowPages

protected transient int rowPages

columnPages

protected transient int columnPages
Constructor Detail

PrintGrid12

public PrintGrid12(com.klg.jclass.higrid.HiGrid grid)
Constructor. grid the parent HiGrid instance

Method Detail

initialize

public void initialize(PageFormat pageFormat)
Computes the total number of pages for this job.

Parameters:
pageFormat - describes the page orientation for all pages to be printed.

disposePrintTimeRowTree

protected void disposePrintTimeRowTree()
Cleanup the print time row tree.


getPrintTimeRowTree

protected com.klg.jclass.higrid.RowTree getPrintTimeRowTree()
Setup the print time row tree.


getPageWidth

public int getPageWidth()
Gets the width of a page.

Returns:
The page width.

getPageHeight

public int getPageHeight()
Gets the height of a page.

Returns:
The page height.

getMargin

public Insets getMargin()
Gets the margin insets.

Returns:
The margin insets.

setMargin

public void setMargin(Insets margin)
Sets the page margins. Passing null sets the margins to the default 1".

Parameters:
margin - the new margin.

getDefaultMargin

public Insets getDefaultMargin()
Gets the default margin.

Returns:
The default margin insets.

getPageFormat

public PageFormat getPageFormat()
Gets the current pageFormat.

Returns:
The pageFormat.

setPageFormat

public void setPageFormat(PageFormat format)
Sets the current pageFormat.

Parameters:
format - the new pageFormat.

getPrintableHeight

public int getPrintableHeight()
Gets the printable height of a page.

Returns:
The printable height.

getPrintableWidth

public int getPrintableWidth()
Gets the printable width of a page.

Returns:
The printable width.

getPrintOffset

protected Point getPrintOffset(PageFormat pageFormat)
Gets the top/left corner of the printable area on the page.

Returns:
the top/left corner of the printable area on the page.

getRowPageIndex

public int getRowPageIndex()
Gets the row page index value.

Returns:
the row page index value.

getColumnPageIndex

public int getColumnPageIndex()
Gets the column page index value.

Returns:
the column page index value.

getCurrentPageIndex

public int getCurrentPageIndex()
Gets the current page index.

Returns:
the current page index.

getTotalNumPages

public int getTotalNumPages()
Gets the total number of pages to print.

Returns:
the total number of pages to print.

print

public int print(Graphics gc,
                 PageFormat pageFormat,
                 int pageIndex)
Print/Paint the indicated page.

Specified by:
print in interface Printable
Parameters:
gc - the context into which the page is drawn.
pageFormat - - the size and orientation of the page being drawn
pageIndex - - the zero based index of the page to be drawn

getNumberOfPages

public int getNumberOfPages()
Gets the number of pages in the set.

Specified by:
getNumberOfPages in interface Pageable
Returns:
the number of pages in this Pageable.

getPageFormat

public PageFormat getPageFormat(int pageIndex)
                         throws IndexOutOfBoundsException
Always returns the PageFormat of the page specified by pageIndex.

Specified by:
getPageFormat in interface Pageable
Parameters:
pageIndex - ignored
Returns:
the PageFormat describing the size and orientation.
Throws:
IndexOutOfBoundsException - the Pageable does not contain the requested page.

getPrintable

public Printable getPrintable(int pageIndex)
                       throws IndexOutOfBoundsException
Gets the Printable instance responsible for rendering the page specified by pageIndex.

Specified by:
getPrintable in interface Pageable
Parameters:
pageIndex - ignored
Returns:
the Printable that renders the page.
Throws:
IndexOutOfBoundsException - the Pageable does not contain the requested page.

doPrintPageHeader

protected void doPrintPageHeader(Graphics graphicContext,
                                 PageFormat pageFormat)
Notifies print listeners that the page header is being printed.

Parameters:
graphicContext - the context into which the page is drawn.
pageFormat - - the size and orientation of the page being drawn

doPrintPageFooter

protected void doPrintPageFooter(Graphics graphicContext,
                                 PageFormat pageFormat)
Notifies print listeners that the page footer is being printed.

Parameters:
graphicContext - the context into which the page is drawn.
pageFormat - - the size and orientation of the page being drawn

doPrintEnd

protected void doPrintEnd(Graphics graphicContext,
                          PageFormat pageFormat,
                          int top)
Notifies print listeners that the end of the last page is being printed.

Parameters:
graphicContext - the context into which the page is drawn.
pageFormat - - the size and orientation of the page being drawn

printPageFooter

public void printPageFooter(com.klg.jclass.higrid.HiGridPrintEvent event)
Prints default footer.

Parameters:
event - the print event sent when rendering of the footer is needed.

Copyright © 2004 Quest Software Inc..
All rights reserved.