|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectPrint2DPrinterJob
public class Print2DPrinterJob
This class handles printing for the CLIP system.
It is capable of printing an array of
BufferedImage
s with one image per page.
Images are initially scaled down and then scale further
if necessary to fit on a single page.
The following code was used as reference when creating this class:
http://java.sun.com/j2se/1.4.2/docs/guide/jps/spec/appendix_2DPrinterJob.fm.html#997825
Field Summary | |
---|---|
(package private) static int |
ARRANGEMENT
Print job intended to print out a tile arrangement |
(package private) java.awt.image.BufferedImage[] |
image
Array of BufferedImage s to print |
(package private) static int |
INFORMATION
Print job intended to print out the addtional tile information |
(package private) double |
minScale
Minimum scale value of previous pages in the same job |
(package private) static double |
normalScale
Normal amount of scaling applied to each image |
(package private) int |
printType
Type of print job (ARRANGEMENT or INFORMATION) |
(package private) int |
totalPages
Total number of pages in the print job |
Fields inherited from interface java.awt.print.Printable |
---|
NO_SUCH_PAGE, PAGE_EXISTS |
Constructor Summary | |
---|---|
Print2DPrinterJob(java.awt.image.BufferedImage[] img,
int type)
This Constructor sets up the print job, locates printers, and then performs the printing. |
Method Summary | |
---|---|
int |
print(java.awt.Graphics g,
java.awt.print.PageFormat pf,
int pageIndex)
Prints the image by scaling it down by the normalScale
ammount or further if needed to fit on a single page. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final int ARRANGEMENT
static final int INFORMATION
int printType
int totalPages
java.awt.image.BufferedImage[] image
BufferedImage
s to print
static final double normalScale
double minScale
Constructor Detail |
---|
public Print2DPrinterJob(java.awt.image.BufferedImage[] img, int type)
img
- Array of BufferedImage
s to printtype
- Type of print job (ARRANGEMENT or INFORMATION)Method Detail |
---|
public int print(java.awt.Graphics g, java.awt.print.PageFormat pf, int pageIndex)
normalScale
ammount or further if needed to fit on a single page. If printing
multiple pages, later pages will always scale by the same ammount as
past pages unless they need to scale further to fit on one page.
print
in interface java.awt.print.Printable
g
- Graphics object to draw the page onpf
- The PageFormat object of the pagepageIndex
- The number of the page being printing.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |