ice.storm.print
Class PageNumberPageDecoration
java.lang.Object
ice.storm.print.AbstractPageDecoration
ice.storm.print.PageNumberPageDecoration
- All Implemented Interfaces:
- PageDecoration
- public class PageNumberPageDecoration
- extends AbstractPageDecoration
The PageNumberPageDecoration paints "x of y" just outside of
the pages margins to the specified vertical and horizontal alignment. Where
x is the current page number and y is the total number of pages in the
document. This class is a demonstration of how
AbstractPageDecoration can be implemented and used.
- Since:
- 6.0
- Version:
- %I%, %G%
- Author:
- Patrick Corless
- See Also:
AbstractPageDecoration
|
Constructor Summary |
PageNumberPageDecoration(String name,
int verticalAlignment,
int horizontalAlignment)
Create a new PageNumberPageDecoration object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PageNumberPageDecoration
public PageNumberPageDecoration(String name,
int verticalAlignment,
int horizontalAlignment)
- Create a new
PageNumberPageDecoration object.
- Parameters:
name - verticalAlignment - vertical alignment constant, LEFT, RIGHT or CENTERhorizontalAlignment - horizontal alignment constant, TOP OR BOTTOM
paint
public void paint(Graphics g,
int currentPageIndex,
int pageCount,
StormPageFormat pageFormat)
- Description copied from class:
AbstractPageDecoration
- Paint the page decoration. This method is invoked by the StormPrinter
when one of the print methods are called.
- Specified by:
paint in interface PageDecoration- Specified by:
paint in class AbstractPageDecoration
- Parameters:
g - graphics context in which the decoration will be painted to.currentPageIndex - page number of the page being printed. This is
useful as some page decoration that should only be printed on
specific page or need to paint page numbers.pageCount - the total number of pages being printed in the
print jobpageFormat - the StormPageFormat associated with the StormPrinter.
The pageFormat is essential for retrieving the page
dimensions and coordinates for painting the decoration .