org.formaria.print
Class PrintableFrameSet

java.lang.Object
  extended by org.formaria.print.PrintableFrameSet
All Implemented Interfaces:
java.awt.print.Printable

public class PrintableFrameSet
extends java.lang.Object
implements java.awt.print.Printable

A decoration of the container to allow printing when the page is contains multiple pages within frames

Copyright (c) Formaria Ltd., 2008, This software is licensed under the GNU Public License (GPL), please see license.txt for more details. If you make commercial use of this software you must purchase a commercial license from Formaria.

$Revision: 1.4 $


Field Summary
protected  Project currentProject
          The owner project and the context in which this object operates.
protected  java.util.Vector frames
          Storage for the frames of this page
protected  Printout printout
          The PrintOut object that owns this printable page
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Constructor Summary
PrintableFrameSet(Printout po)
          Craete a new PrintableFrameSet
 
Method Summary
 void addFrame(java.awt.Container targetFrame)
          Add a frame to the page.
 int print(java.awt.Graphics g, java.awt.print.PageFormat pf, int pageIndex)
          Print the frameset.The frame elements are assumed to be Targets, the coordinates of which are used to position each frame on the page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frames

protected java.util.Vector frames
Storage for the frames of this page


printout

protected Printout printout
The PrintOut object that owns this printable page


currentProject

protected Project currentProject
The owner project and the context in which this object operates.

Constructor Detail

PrintableFrameSet

public PrintableFrameSet(Printout po)
Craete a new PrintableFrameSet

Parameters:
po - The owner PrintOut
Method Detail

addFrame

public void addFrame(java.awt.Container targetFrame)
Add a frame to the page.

Parameters:
targetFrame - the frame to add

print

public int print(java.awt.Graphics g,
                 java.awt.print.PageFormat pf,
                 int pageIndex)
          throws java.awt.print.PrinterException
Print the frameset.The frame elements are assumed to be Targets, the coordinates of which are used to position each frame on the page. The content of each target area is then printed.

Specified by:
print in interface java.awt.print.Printable
Parameters:
g - the graphics context
pf - the page format
pageIndex - the index of the page within the page set
Returns:
Printable.PAGE_EXISTS on success
Throws:
java.awt.print.PrinterException - some printing error