ice.storm.print
Class StringPageDecoration
java.lang.Object
ice.storm.print.AbstractPageDecoration
ice.storm.print.StringPageDecoration
- All Implemented Interfaces:
- PageDecoration
- public class StringPageDecoration
- extends AbstractPageDecoration
The StringPageDecoration draws text to a specified area
of the page just outside of the pages margins. 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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StringPageDecoration
public StringPageDecoration(String name,
String text,
int verticalAlignment,
int horizontalAlignment)
- Create a new
StringPageDecoration 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 .