|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ach.image.PrintImage2
PrintImage2.java
Copyright (c) 1998-2001 Helge Hackbarth, All Rights Reserved.
Enhancement to class PrintImage for printing in Java 2 environments.
THE AUTHOR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY
OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, OR NON-INFRINGEMENT. THE AUTHOR SHALL NOT BE LIABLE FOR ANY
DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
Constructor Summary | |
PrintImage2(java.awt.Frame parent,
EMemImageSource imgSrc,
java.util.Hashtable props,
BatchPrinter batchPrinter)
Constructor. |
|
PrintImage2(java.awt.Frame parent,
EMemImageSource imgSrc,
java.awt.Rectangle printArea,
java.awt.print.PrinterJob printerJob)
Constructor. |
Method Summary | |
static java.awt.Dimension |
getPageDimension(java.lang.Object printerJob)
Retrieve the dimension of the default paper setting in a JDK 1.1 compatible manner. |
static void |
printBook(java.lang.Object printerJob,
java.lang.Object book)
Print a pageable object (e.g. an instance of Book) through a Java 2 PrinterJob. |
static java.lang.Object |
printImage(java.lang.Object printerJob,
java.lang.Object book,
java.awt.Image img,
int iWidth,
int iHeight,
java.awt.Dimension printDimension,
double pX,
double pY,
double pWidth,
double pHeight,
java.util.Hashtable props)
Add an image to a "Book" (instance of class Book) to be printed in a specified location and size. |
void |
run()
Run Java 2 (JDK 1.2) compatible printing (automatically called as separate thread by start()). |
void |
start()
Start printing as a seperate thread (calls run() automatically). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PrintImage2(java.awt.Frame parent, EMemImageSource imgSrc, java.util.Hashtable props, BatchPrinter batchPrinter)
parent
- the parent frameimgSrc
- image producer derived from EMemImageSourceprops
- Hashtable with properties (values for "PAGESIZE", "ORIENTATION",
"LEFTMARGIN", "RIGHTMARGIN", "TOPMARGIN", "BOTTOMMARGIN");
"PAGESIZE"="Executive", "Letter", "Legal", "A4", "A3", "Tabloid", "A2", "A1", "A0";
"ORIENTATION"=true for portrait, false for landscape;
margins specified in 1/1000 cm = 1/2540 inchbatchPrinter
- allows to hand over a callback method for printing a sequence of slides (see interface BatchPrinter)public PrintImage2(java.awt.Frame parent, EMemImageSource imgSrc, java.awt.Rectangle printArea, java.awt.print.PrinterJob printerJob)
parent
- the parent frameimgSrc
- image producer derived from EMemImageSourceprintArea
- Rectangle to be used for printing (JDK >= 1.1.6 uses points (1/72 inch), other VMs relate to screen resolution)printerJob
- print job (must be created once before and can be reused for all printouts)Method Detail |
public void start()
public void run()
run
in interface java.lang.Runnable
public static void printBook(java.lang.Object printerJob, java.lang.Object book)
printerJob
- an instance of PrinterJobbook
- an object implementing the Pageable interface (e.g. a Book)public static java.awt.Dimension getPageDimension(java.lang.Object printerJob)
printerJob
- an instance of PrinterJobpublic static java.lang.Object printImage(java.lang.Object printerJob, java.lang.Object book, java.awt.Image img, int iWidth, int iHeight, java.awt.Dimension printDimension, double pX, double pY, double pWidth, double pHeight, java.util.Hashtable props)
printerJob
- an instance of PrinterJobbook
- an object implementing the Pageable interface (e.g. a Book)img
- specifying the image to be printediWidth
- specifying the width of the image in pixelsiHeight
- specifying the height of the image in pixelsprintDimension
- width and height of image in print units (72 dpi)pX
- the horizontal location on the page where image should be printed (in print units (72 dpi))pY
- the vertical location on the page where image should be printed (in print units (72 dpi))pWidth
- the width of the image on the page (in print units (72 dpi))pHeight
- the height of the image on the page (in print units (72 dpi))props
- a hashtable containing additional properties, e.g. annotations
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |