com.elixirtech.glint.print
Class GlintPrintable

java.lang.Object
  extended by com.elixirtech.glint.print.GlintPrintable
All Implemented Interfaces:
java.awt.print.Pageable, java.awt.print.Printable

public class GlintPrintable
extends java.lang.Object
implements java.awt.print.Printable, java.awt.print.Pageable

Glint implementation of the Printable and Pageable interfaces.


Field Summary
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Fields inherited from interface java.awt.print.Pageable
UNKNOWN_NUMBER_OF_PAGES
 
Constructor Summary
GlintPrintable(java.io.File glint)
          Constructor.
GlintPrintable(com.elixirtech.glint.IEye eye)
          Constructor.
GlintPrintable(java.io.InputStream is)
          Constructor.
 
Method Summary
 int getNumberOfPages()
           
 java.awt.print.PageFormat getPageFormat(int pageNo)
           
 java.awt.print.Printable getPrintable(int pageIndex)
           
 int print(java.awt.Graphics g, java.awt.print.PageFormat pf, int pageNo)
           
 void setPhysicalPageSize(java.awt.Dimension physicalPageSizeOrNull)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlintPrintable

public GlintPrintable(java.io.File glint)
               throws java.io.IOException
Constructor.

Parameters:
glint - The glint file to load
Throws:
java.io.IOException - if the file doesn't exist or is not a valid glint file

GlintPrintable

public GlintPrintable(java.io.InputStream is)
               throws java.io.IOException
Constructor.

Parameters:
is - The glint input stream to load
Throws:
java.io.IOException - if the stream is not a valid glint stream

GlintPrintable

public GlintPrintable(com.elixirtech.glint.IEye eye)
Constructor.

Parameters:
eye - The eye that holds the glints for printing
Method Detail

setPhysicalPageSize

public void setPhysicalPageSize(java.awt.Dimension physicalPageSizeOrNull)

getNumberOfPages

public int getNumberOfPages()
Specified by:
getNumberOfPages in interface java.awt.print.Pageable

print

public int print(java.awt.Graphics g,
                 java.awt.print.PageFormat pf,
                 int pageNo)
Specified by:
print in interface java.awt.print.Printable

getPageFormat

public java.awt.print.PageFormat getPageFormat(int pageNo)
Specified by:
getPageFormat in interface java.awt.print.Pageable

getPrintable

public java.awt.print.Printable getPrintable(int pageIndex)
                                      throws java.lang.IndexOutOfBoundsException
Specified by:
getPrintable in interface java.awt.print.Pageable
Throws:
java.lang.IndexOutOfBoundsException