ilog.views.util.print
Class IlvPage

java.lang.Object
  extended by ilog.views.util.print.IlvPage
All Implemented Interfaces:
Printable

public class IlvPage
extends Object
implements Printable

A IlvPage defines a page that can be printed. It maintains a set of IlvPrintableObject objects. When a IlvPage is being printed, it calls the print() method of the contained printable objects.

The IlvPage class is designed to work with a IlvPrintableDocument object: IlvPages are added to the IlvPrintableDocument.

Since:
JViews 5.5
See Also:
IlvPrintableObject

Field Summary
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Constructor Summary
IlvPage()
          Creates an empty page.
 
Method Summary
 void addPrintableObject(IlvPrintableObject printable)
          Adds a printable object to the page.
 IlvPrintableDocument getDocument()
          Returns the owner IlvPrintableDocument.
 PageFormat getPageFormat()
          Returns the page format of the printable page.
 int getPageIndex()
          Returns the page index of the page.
 int getPrintableCount()
          Returns the number of printable objects in the page.
 IlvPrintableObject getPrintableObject(int index)
          Gets the IlvPrintableObject at the specified position.
 int print(Graphics graphics, PageFormat format, int pageIndex)
          Implements the java.awt.print.Printable.print method.
 void removePrintableObject(IlvPrintableObject printable)
          Removes the specified printable object from the page.
 void setDocument(IlvPrintableDocument document)
          Sets the owner IlvPrintableDocument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvPage

public IlvPage()
Creates an empty page. Once a page is created you can add printable objects to this page.

Method Detail

getDocument

public IlvPrintableDocument getDocument()
Returns the owner IlvPrintableDocument.

Returns:
The owner IlvPrintableDocument.

setDocument

public void setDocument(IlvPrintableDocument document)
Sets the owner IlvPrintableDocument.

Parameters:
document - The owner IlvPrintableDocument.

getPageFormat

public PageFormat getPageFormat()
Returns the page format of the printable page. The default implementation is to return the page format of the owner IlvPrintableDocument.

Returns:
The page format.

getPrintableCount

public int getPrintableCount()
Returns the number of printable objects in the page.

Returns:
The number of printable objects.

getPrintableObject

public IlvPrintableObject getPrintableObject(int index)
Gets the IlvPrintableObject at the specified position.

Parameters:
index - The index of the printable object.

getPageIndex

public int getPageIndex()
Returns the page index of the page. The default implementation is to return the index of this page in the owner IlvPrintableDocument.

Returns:
The page index.

addPrintableObject

public void addPrintableObject(IlvPrintableObject printable)
Adds a printable object to the page.

Parameters:
printable - The printable object to be added.

removePrintableObject

public void removePrintableObject(IlvPrintableObject printable)
Removes the specified printable object from the page.

Parameters:
printable - The printable object to be removed.

print

public int print(Graphics graphics,
                 PageFormat format,
                 int pageIndex)
          throws PrinterException
Implements the java.awt.print.Printable.print method. If the IlvPrintableDocument of this page has a template page, this method first prints the template page. Then, it calls the print method of the contained IlvPrintableObject.

Specified by:
print in interface Printable
Parameters:
graphics - The output device, which must be a Graphics2D object.
format - The format of the page.
pageIndex - The index of the page.
Throws:
PrinterException


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.