ice.storm.print
Class StringPageDecoration

java.lang.Object
  extended byice.storm.print.AbstractPageDecoration
      extended byice.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

Field Summary
 
Fields inherited from class ice.storm.print.AbstractPageDecoration
BOTTOM, CENTER, horizontalAlignment, LEFT, name, OTHER, RIGHT, TOP, verticalAlignment
 
Constructor Summary
StringPageDecoration(String name, String text, int verticalAlignment, int horizontalAlignment)
          Create a new StringPageDecoration object.
 
Method Summary
 void paint(Graphics g, int currentPageIndex, int pageCount, StormPageFormat pageFormat)
          Paint the page decoration.
 
Methods inherited from class ice.storm.print.AbstractPageDecoration
getHorizontalAlignment, getName, getVerticalAlignment, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 CENTER
horizontalAlignment - horizontal alignment constant, TOP OR BOTTOM
Method Detail

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 job
pageFormat - the StormPageFormat associated with the StormPrinter. The pageFormat is essential for retrieving the page dimensions and coordinates for painting the decoration .