net.sf.paperclips
Class SeriesPrint

java.lang.Object
  extended by net.sf.paperclips.SeriesPrint
All Implemented Interfaces:
Print

public class SeriesPrint
extends java.lang.Object
implements Print

A Print which displays its child prints in series. Each element in the series is displayed one at a time (no more than one child per page, although one Print may span several pages).

Use this class as the top-level Print when several distinct Prints should be batched into one print job, but printed on separate pages.


Constructor Summary
SeriesPrint()
           
 
Method Summary
 void add(Print item)
          Adds the given print to this SeriesPrint.
 void add(Print[] items)
          Adds the given prints to this SeriesPrint.
 boolean equals(java.lang.Object obj)
           
 Print[] getItems()
          Returns an array of items in the series.
 int hashCode()
           
 PrintIterator iterator(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)
          Returns a PrintIterator for laying out the contents of this Print.
 int size()
          Returns the number of Prints that have been added to this SeriesPrint.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SeriesPrint

public SeriesPrint()
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

add

public void add(Print[] items)
Adds the given prints to this SeriesPrint.

Parameters:
items - the Prints to add

add

public void add(Print item)
Adds the given print to this SeriesPrint.

Parameters:
item - the Print to add

size

public int size()
Returns the number of Prints that have been added to this SeriesPrint.

Returns:
the number of Prints that have been added to this SeriesPrint.

getItems

public Print[] getItems()
Returns an array of items in the series.

Returns:
an array of items in the series.

iterator

public PrintIterator iterator(org.eclipse.swt.graphics.Device device,
                              org.eclipse.swt.graphics.GC gc)
Description copied from interface: Print
Returns a PrintIterator for laying out the contents of this Print. The iterator uses a snapshot of the print at the time this method is invoked, so subsequent changes to the Print will not affect the output of the iterator.

Specified by:
iterator in interface Print
Parameters:
device - the graphics device this Print will be drawn onto.
gc - the graphics context to be used for calculating layout and drawing the Print's contents.
Returns:
a PrintIterator for laying out the contents of this Print.