|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectprinter
public class printer
Print class provides functionalities of printing the images. It holds a private BufferedImage image that is initialized once it is passed through the constructor. It holds one method called print which is executed if the variable param is passed in as 0. Otherwise it throws a printerException. There are no OS/Hardware dependencies and no variances. There is no need for any security constraints and no references to external specifications.
Field Summary | |
---|---|
(package private) java.awt.image.BufferedImage |
image
Contains the image to be printed. |
(package private) java.awt.print.PageFormat |
pageFormat
Indicates the type of page format to be printed. |
(package private) TerpPaint |
parent
TerpPaint object used to print functionality. |
(package private) java.awt.print.PrinterJob |
printerJob
Describes the printer job. |
(package private) javax.swing.JFrame |
view
Print preview frame. |
Fields inherited from interface java.awt.print.Printable |
---|
NO_SUCH_PAGE, PAGE_EXISTS |
Constructor Summary | |
---|---|
printer(java.awt.Frame Parent)
Constructs the BufferedImage that is passed in to image. |
Method Summary | |
---|---|
void |
pageSetup()
Provides the preferred size and source to be printed. |
void |
preview()
Shows the previewed image before printing. |
int |
print(java.awt.Graphics graphics,
java.awt.print.PageFormat page,
int param)
Prints the images if the param is passed in as 0. |
void |
printTo()
Prints the selected image. |
void |
setImage(java.awt.image.BufferedImage imageToPrint)
Sets the buffered image to be printed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.awt.image.BufferedImage image
java.awt.print.PageFormat pageFormat
java.awt.print.PrinterJob printerJob
javax.swing.JFrame view
TerpPaint parent
Constructor Detail |
---|
public printer(java.awt.Frame Parent)
Parent
- Frame type that sets the field "image" to it.Method Detail |
---|
public int print(java.awt.Graphics graphics, java.awt.print.PageFormat page, int param) throws java.awt.print.PrinterException
print
in interface java.awt.print.Printable
graphics
- Is casted to a Graphics2D and set to the variable g.page
- Indicates the selection of page format.param
- Must be set to 0 to print. Otherwise the page does not exist
and throws an exception.
java.awt.print.PrinterException
- if param is not 0 or unable to print within marginspublic void pageSetup()
public void setImage(java.awt.image.BufferedImage imageToPrint)
imageToPrint
- BufferedImage to be set and printed.public void printTo()
public void preview()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |