|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.page.JCPrinter | +--com.klg.jclass.page.awt.JCAWTPrinter
Implements PrinterDriver interface.
Nested Class Summary | |
static class |
JCAWTPrinter.PrinterJobCancelledException
|
protected class |
JCAWTPrinter.PrinterThread
To get proper metrics for the printer we need to get its graphics. |
Field Summary | |
protected boolean |
abort
|
protected boolean |
actuallyPrinting
|
protected Stack |
clipStack
|
protected com.klg.jclass.page.JCDocument |
document
|
protected com.klg.jclass.page.JCPage |
firstPage
First template page in document, used to set up correct PageFormat properties for initial page. |
protected int |
firstToPrint
|
protected int |
lastToPrint
|
protected PageFormat |
pageFormat
|
protected PrinterJob |
printerJob
|
protected JCAWTPrinter.PrinterThread |
printerThread
|
protected boolean |
showDialog
|
protected Thread |
thread
|
protected PrinterException |
threadException
|
protected boolean |
updatePageFormat
True if the PageFormat should be updated with information from the passed page template (for the first page) or the document (for other pages). |
Fields inherited from class com.klg.jclass.page.JCPrinter |
bookmarkTree, bookmarkTreeVisible, collate, compressed, endPage, graphics, imageNumber, isDocOpen, numCopies, orientation, os, pageCount, printListeners, reverseOrder, startPage |
Constructor Summary | |
JCAWTPrinter()
Constructor -- uses 8.5 x 11 default page. |
|
JCAWTPrinter(boolean showDialog)
Constructor -- uses 8.5 x 11 default page. |
|
JCAWTPrinter(List templates)
Constructor with template list. |
|
JCAWTPrinter(List templates,
boolean showDialog)
Constructor with template list. |
|
JCAWTPrinter(PageFormat pageFormat)
Constructor taking specialized PageFormat class. |
|
JCAWTPrinter(PageFormat pageFormat,
boolean showDialog)
Constructor taking specialized PageFormat class. |
|
JCAWTPrinter(PageFormat pageFormat,
List templates)
Constructor taking specialized PageFormat class and list of page templates. |
|
JCAWTPrinter(PageFormat pageFormat,
List templates,
boolean showDialog)
Constructor taking specialized PageFormat class and list of page templates. |
|
JCAWTPrinter(PrinterJob printerJob,
PageFormat pageFormat)
Constructor taking specific PrinterJob and PageFormat. |
|
JCAWTPrinter(PrinterJob printerJob,
PageFormat pageFormat,
boolean showDialog)
Constructor taking specific PrinterJob and PageFormat. |
|
JCAWTPrinter(PrinterJob printerJob,
PageFormat pageFormat,
List templates)
Constructor taking specific PrinterJob and PageFormat as well as a list of page templates. |
|
JCAWTPrinter(PrinterJob printerJob,
PageFormat pageFormat,
List templates,
boolean showDialog)
Constructor taking specific PrinterJob and PageFormat as well as a list of page templates. |
Method Summary | |
void |
beginPage(Rectangle2D pageSize,
int pageNumber)
PS Document Structuring Conventions comments, page orientation... |
void |
cancel()
Cancel the pending job and kill the waiting thread. |
void |
cancelFromPrinterThread(PrinterException e)
Cancel the pending job and note the exception that caused the printer thread to fail. |
protected void |
clearThread()
Called by the print thread after it has finished printing (but before waking up the main thread) to clear out the variable that would impede another thread being created. |
void |
closeDocument(Rectangle2D pageSize)
document completion (e.g. |
void |
closeDocument(Rectangle2D pageSize,
boolean superclass)
Convenience method with bogus boolean to overload the method and call super, since VisualAge doesn't understand calling the superclass from an inner class. |
void |
endPage(Rectangle2D pageSize)
Page bounding box... |
Graphics |
getGraphics()
Retruns null if user cancel this print job. |
boolean |
getShowDialog()
Is the print dialog to be shown when printing is requested? True means show it. |
protected void |
initPrinterJob()
|
boolean |
isImageScalable()
Returns false since images sent to AWT Printer are pre-scaled. |
void |
openDocument(Rectangle2D pageSize)
Any required initialisation (e.g. |
void |
openDocument(Rectangle2D pageSize,
boolean superclass)
Convenience method with bogus boolean to overload the method and call super, since VisualAge doesn't understand calling the superclass from an inner class. |
void |
print(com.klg.jclass.page.JCDocument document)
Deprecated. Use document.print() instead. |
protected void |
printPage(com.klg.jclass.page.JCDocument document,
int pageIndex)
Print a range |
void |
registerDocument(com.klg.jclass.page.JCDocument document)
Store the document being printed in this object so callbacks to the document can be made by the printer thread This is for internal use only. |
void |
registerFirstLast(int first,
int last)
Store the first and last page to be printed so that when printing actually starts, we know what we're supposed to print. |
protected void |
setGraphics(Graphics2D g)
|
void |
setShowDialog(boolean showDialog)
Deprecated. Not implemented -- its intended functionality has been superceded by the constructors for this class which take the showDialog parameter. |
void |
setup()
Creates default styles, any other one-time initialisation Builds font families from available fonts. |
protected void |
updatePageFormat(com.klg.jclass.page.JCPage page)
Update the current PageFormat object with properties from the current page being printed. |
protected void |
wakeUpMainThread()
Called by the print thread after it has finished printing the document. |
Methods inherited from class com.klg.jclass.page.JCPrinter |
addPrintListener, getCollate, getFontFamilies, getNumCopies, getOrientation, getOutputPageEnd, getOutputPageStart, getOutputStream, getReverseOrder, isBookmarkTreeVisible, isCompressed, isDocumentOpen, isLandscape, output, output, output, output, removePrintListener, setCollate, setCompressed, setNumCopies, setOrientation, setOutputPageEnd, setOutputPageStart, setOutputStream, setReverseOrder, supportsHyperlinks |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected JCAWTPrinter.PrinterThread printerThread
protected Thread thread
protected PrinterJob printerJob
protected boolean actuallyPrinting
protected com.klg.jclass.page.JCDocument document
protected boolean showDialog
protected Stack clipStack
protected PageFormat pageFormat
protected boolean abort
protected int firstToPrint
protected int lastToPrint
protected PrinterException threadException
protected com.klg.jclass.page.JCPage firstPage
protected boolean updatePageFormat
Constructor Detail |
public JCAWTPrinter() throws JCAWTPrinter.PrinterJobCancelledException, PrinterException
public JCAWTPrinter(boolean showDialog) throws JCAWTPrinter.PrinterJobCancelledException, PrinterException
showDialog
- a boolean; true means show the dialog,
false means do not show the dialog -- use the default printer.public JCAWTPrinter(List templates) throws JCAWTPrinter.PrinterJobCancelledException, PrinterException
templates
- a List of page templates, the same one that will
later be passed to the JCDocument constructor.public JCAWTPrinter(List templates, boolean showDialog) throws JCAWTPrinter.PrinterJobCancelledException, PrinterException
templates
- a List of page templates, the same one that will
later be passed to the JCDocument constructor.showDialog
- a boolean; true means show the dialog,
false means do not show the dialog -- use the default printer.public JCAWTPrinter(PageFormat pageFormat) throws JCAWTPrinter.PrinterJobCancelledException, PrinterException
pageFormat
- the PageFormat object to use for page
information.public JCAWTPrinter(PageFormat pageFormat, boolean showDialog) throws JCAWTPrinter.PrinterJobCancelledException, PrinterException
pageFormat
- the PageFormat object to use for page
information.showDialog
- a boolean; true means show the dialog,
false means do not show the dialog -- use the default printer.public JCAWTPrinter(PageFormat pageFormat, List templates) throws JCAWTPrinter.PrinterJobCancelledException, PrinterException
pageFormat
- the PageFormat object to use for page
information.templates
- a List of page templates, the same one that will
later be passed to the JCDocument constructor.public JCAWTPrinter(PageFormat pageFormat, List templates, boolean showDialog) throws JCAWTPrinter.PrinterJobCancelledException, PrinterException
pageFormat
- the PageFormat object to use for page
information.templates
- a List of page templates, the same one that will
later be passed to the JCDocument constructor.showDialog
- a boolean; true means show the dialog,
false means do not show the dialog -- use the default printer.public JCAWTPrinter(PrinterJob printerJob, PageFormat pageFormat) throws JCAWTPrinter.PrinterJobCancelledException, PrinterException
printerJob
- the PrinterJob whose information will be used
for printingpageFormat
- the PageFormat object to use for page
information.public JCAWTPrinter(PrinterJob printerJob, PageFormat pageFormat, boolean showDialog) throws JCAWTPrinter.PrinterJobCancelledException, PrinterException
printerJob
- the PrinterJob whose information will be used
for printingpageFormat
- the PageFormat object to use for page
information.showDialog
- a boolean; true means show the dialog,
false means do not show the dialog -- use the default printer.public JCAWTPrinter(PrinterJob printerJob, PageFormat pageFormat, List templates) throws JCAWTPrinter.PrinterJobCancelledException, PrinterException
printerJob
- the PrinterJob whose information will be used
for printingpageFormat
- the PageFormat object to use for page
information.templates
- a List of page templates, the same one that will
later be passed to the JCDocument constructor.public JCAWTPrinter(PrinterJob printerJob, PageFormat pageFormat, List templates, boolean showDialog) throws JCAWTPrinter.PrinterJobCancelledException, PrinterException
printerJob
- the PrinterJob whose information will be used
for printingpageFormat
- the PageFormat object to use for page
information.templates
- a List of page templates, the same one that will
later be passed to the JCDocument constructor.showDialog
- a boolean; true means show the dialog,
false means do not show the dialog -- use the default printer.Method Detail |
public void setup()
setup
in class JCPrinter
public boolean isImageScalable()
isImageScalable
in class JCPrinter
public void registerDocument(com.klg.jclass.page.JCDocument document)
public void registerFirstLast(int first, int last)
public void openDocument(Rectangle2D pageSize)
openDocument
in class JCPrinter
pageSize
- a rectangle describing the size and location of the pagepublic void openDocument(Rectangle2D pageSize, boolean superclass)
protected void wakeUpMainThread()
protected void clearThread()
public void print(com.klg.jclass.page.JCDocument document)
public void closeDocument(Rectangle2D pageSize)
closeDocument
in class JCPrinter
pageSize
- a rectangle describing the size and location of the pagepublic void closeDocument(Rectangle2D pageSize, boolean superclass)
public void beginPage(Rectangle2D pageSize, int pageNumber)
beginPage
in class JCPrinter
pageSize
- a rectangle describing the size and location of the pagepageNumber
- the number of the new pagepublic void endPage(Rectangle2D pageSize)
endPage
in class JCPrinter
pageSize
- a rectangle describing the size and location of the pageprotected void initPrinterJob()
protected void updatePageFormat(com.klg.jclass.page.JCPage page)
page
- JCPage object (perhaps a template page, perhaps a real
document page) to query for PageFormat propertiespublic Graphics getGraphics()
getGraphics
in class JCPrinter
protected void printPage(com.klg.jclass.page.JCDocument document, int pageIndex)
protected void setGraphics(Graphics2D g)
public void setShowDialog(boolean showDialog)
public boolean getShowDialog()
public void cancel()
public void cancelFromPrinterThread(PrinterException e)
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |