ReportCat 1.1

li.netcat.print.util
Class PageNumberPrint

java.lang.Object
  extended byli.netcat.print.util.PageNumberPrint
All Implemented Interfaces:
Print

public class PageNumberPrint
extends java.lang.Object
implements Print

Supporting class to write the number on a page. This class is intended to be overridden. It uses a LabelDrawer to render the page number.

Author:
Arthur Marxer

Constructor Summary
PageNumberPrint(PageNumber pageNumber)
          Constructs a new PageNumberPrint with the given PageNumber.
 
Method Summary
 LabelDrawer getDrawer()
          Returns the Drawer that is used to render the page number.
protected  java.lang.String getLabelText(int pageNumber, int numberOfPages)
          Override this method to customize the text.
 java.awt.Dimension getPreferredSize(java.awt.Graphics g)
          Returns the preferred size of the Print.
 PrintIterator getPrintIterator()
          Factory method, that produces a PrintIerator.
 void setDrawer(LabelDrawer drawer)
          Sets the Drawer that is used to render the page number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageNumberPrint

public PageNumberPrint(PageNumber pageNumber)
Constructs a new PageNumberPrint with the given PageNumber.

Parameters:
pageNumber - The page number that should be displayed.
Method Detail

getDrawer

public LabelDrawer getDrawer()
Returns the Drawer that is used to render the page number. Use this instance to configure font and alignment.

Returns:
The Drawer that is used to render the page number.

setDrawer

public void setDrawer(LabelDrawer drawer)
Sets the Drawer that is used to render the page number.

Parameters:
drawer - The Drawer that is used to render the page number, not null.

getLabelText

protected java.lang.String getLabelText(int pageNumber,
                                        int numberOfPages)
Override this method to customize the text.

Returns:
The string "Page "+(pageNumber+1)+ "/" + numberOfPages;

getPreferredSize

public java.awt.Dimension getPreferredSize(java.awt.Graphics g)
Description copied from interface: Print
Returns the preferred size of the Print.

Specified by:
getPreferredSize in interface Print
Parameters:
g - The relevant Graphics object. It can be used to calculate the widths of strings.
Returns:
The preferred size of the Print.

getPrintIterator

public PrintIterator getPrintIterator()
Description copied from interface: Print
Factory method, that produces a PrintIerator. The PrintIterator is used like an enumeration to generate all Prints.

Specified by:
getPrintIterator in interface Print
Returns:
An instance of a PrintIterator that is able to iterate over the Print.

ReportCat 1.1

Copyright © 2003 - 2005 NetCat Inc.. All rights reserved. Feedback

Print,Printing,Printer,Java,Java Print,SDK,Java Printing,Printing Java,Print Java,Library,Java Library,Print Library,Report,Reports,Java Report,Java Programming,Java Output,Layout,Page,API,Preview,Print Preview,Content,A4,Free,Output,Header,Footer,Download,Package,Jar,Evaluation, Print,Printing,Printer,Java,Java Print,SDK,Java Printing,Printing Java,Print Java,Library,Java Library,Print Library,Report,Reports,Java Report,Java Programming,Java Output,Layout,Page,API,Preview,Print Preview,Content,A4,Free,Output,Header,Footer,Download,Package,Jar,Evaluation, Print,Printing,Printer,Java,Java Print,SDK,Java Printing,Printing Java,Print Java,Library,Java Library,Print Library,Report,Reports,Java Report,Java Programming,Java Output,Layout,Page,API,Preview,Print Preview,Content,A4,Free,Output,Header,Footer,Download,Package,Jar,Evaluation