Modifier and Type | Class and Description |
---|---|
protected class |
AbstractPrinter.BasicPageable |
Modifier and Type | Field and Description |
---|---|
protected PrintJobConfiguration |
cfg |
protected int |
currentPageIndex
Current printed page index for pageSelection array.
|
protected PrintErrorHandler |
errorHandler
The
PrintErrorHandler to be applied when a print error occurred. |
protected int |
lastPage
Last page processed saved here to indicate a page change to set new page index from page
selection array.
|
Pageable |
myPageable |
protected List<PrinterException> |
printerExceptionList
A list of printer exceptions, which may have occurred using this printer
|
Constructor and Description |
---|
AbstractPrinter(PrintJobConfiguration cfg) |
Modifier and Type | Method and Description |
---|---|
void |
addException(PrinterException e) |
boolean |
doPrint()
Performs synchronous printing.
|
void |
firePrintEvent(PrintEvent printEvent)
Fires a print page print event for a page contained in the book to print.
|
List<Class<? extends Annotation>> |
getAnnotationsToDisable()
Return current annotation classes disabled for printing.
|
PrintErrorHandler |
getErrorHandler() |
List<PrinterException> |
getPrinterExceptions() |
PrinterJob |
getPrinterJob()
Gets the job.
|
PrintJobConfiguration |
getPrintJobConfiguration() |
PrintRequestAttributeSet |
getPrintRequestAttributeSet()
Returns the
PrintRequestAttributeSet to apply while printing. |
void |
initializePrintCache()
Creates a fresh instance of the cache.
|
boolean |
isPrintAllAnnotationsUsed()
Return current flag.
|
static boolean |
isPrinting()
Determines whether this method is called from within a print process.
|
void |
reset()
Resets this printer.
A fresh PrintJobConfiguration with default settings will be set and a new
PrinterJob is assigned. |
void |
resetPrintCache()
Clears the cache instance and frees the resources.
|
void |
resetPrinterExceptions() |
void |
setAnnotationsToDisable(List<Class<? extends Annotation>> allAnnotationsToDisable)
Sets a list containing annotation class (e.g.
|
void |
setErrorHandler(PrintErrorHandler errorHandler) |
void |
setPrintAllAnnotations(boolean doForcePrintAllAnnotations)
Sets a flag to print all annotation types.
|
void |
setPrinterJob(PrinterJob aPrinterJob)
Associates a printer job.
|
protected static void |
setPrinting(boolean value) |
void |
setPrintRequestAttributeSet(PrintRequestAttributeSet attributes)
Sets the attributes to be applied by the printer job for printing.
|
protected PageFormat |
validatePageFormat(PageFormat aPageFormat)
Validates given pageformat, logs an error message, if given pageformat is not valid and returns
a correct pageformat.
|
public final Pageable myPageable
protected PrintJobConfiguration cfg
protected PrintErrorHandler errorHandler
PrintErrorHandler
to be applied when a print error occurred.protected List<PrinterException> printerExceptionList
protected int currentPageIndex
protected int lastPage
public AbstractPrinter(PrintJobConfiguration cfg) throws JadiceException
cfg
- basic print job configurationJadiceException
- especially if permissions prohibit export or print.public static boolean isPrinting()
true
if this method is called from within a print process,false
if not.protected static void setPrinting(boolean value)
value
- true
if printer is in a print process, false
if not.public void initializePrintCache()
null
.public void resetPrintCache()
public void firePrintEvent(PrintEvent printEvent)
printEvent
- the print event to fire, if given print event is null
no print
event will be fired.public boolean doPrint()
true
if print succeededfalse
if not.public PrinterJob getPrinterJob()
public void setPrinterJob(PrinterJob aPrinterJob)
aPrinterJob
- The job to setpublic PrintRequestAttributeSet getPrintRequestAttributeSet()
PrintRequestAttributeSet
to apply while printing.public void setPrintRequestAttributeSet(PrintRequestAttributeSet attributes)
This method will be called when a PrintDialog was committed by the user, to set the actually choosen print request attributes.
Predefined attributes, set with this method, before opening a PrintDialog will be ignored and overriden, when the dialog is closed and acknowledged by the user.
attributes
- a set of attributes for the jobprotected PageFormat validatePageFormat(PageFormat aPageFormat)
aPageFormat
- pageformat to validatepublic void setAnnotationsToDisable(List<Class<? extends Annotation>> allAnnotationsToDisable)
allAnnotationsToDisable
- a list containing annotation classes.public List<Class<? extends Annotation>> getAnnotationsToDisable()
public void setPrintAllAnnotations(boolean doForcePrintAllAnnotations)
true
all render
context settings depending to annotations will be ignored !!! Default value is
false
.doForcePrintAllAnnotations
- Flagpublic boolean isPrintAllAnnotationsUsed()
public PrintErrorHandler getErrorHandler()
public void setErrorHandler(PrintErrorHandler errorHandler)
public void addException(PrinterException e)
public List<PrinterException> getPrinterExceptions()
public void resetPrinterExceptions()
public PrintJobConfiguration getPrintJobConfiguration()
public void reset()
PrintJobConfiguration
with default settings will be set and a new
PrinterJob
is assigned.Copyright © 2024 levigo holding gmbh. All rights reserved.