|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.jadice.printer.PrintJobConfiguration
public class PrintJobConfiguration
Instances of this class accompanies and contains all configuration settings of a print process.
Nested Class Summary | |
---|---|
static class |
PrintJobConfiguration.PrintMode
Print modes: PrintJobConfiguration.PrintMode.AUTO Page structure will be analysed and to suitable print mode will be used
PrintJobConfiguration.PrintMode.DEFAULT Forces default print mode, all elements will be rendered directly to
the print graphics object
PrintJobConfiguration.PrintMode.RASTERIZE_ALL All page elements will be rasterized to bitmap objects
|
Constructor Summary | |
---|---|
PrintJobConfiguration()
Constructs an instance of this class. |
Method Summary | |
---|---|
static PrintJobConfiguration |
create()
Creates a new PrintJobConfiguration instance, prepared with the all default settings
and configuration, as ready to use instance. |
int |
getCurrentPageIndex()
|
com.levigo.jadice.document.filter.FilteredDocument |
getDocument()
Deprecated. |
LayerSelection |
getLayerSelectionToPrint()
|
Collection<DocumentLayer> |
getLayersToPrint()
|
int |
getNumbersOfPages()
|
OutputReferenceBase |
getOutputReferenceBase()
Simply returns the currently set OutputReferenceBase . |
PageFormat |
getPageFormat()
Returns the currently set PageFormat object. |
String |
getPrintServiceName()
Returns the print service name that was set. |
Sides |
getPrintSide()
The current preselected print side. |
String |
getPrintTitle()
Returns the print job title. |
int |
getPrintTitleMaxLength()
Returns the max length of the print job title. |
RenderControlInventory |
getRenderControlInventory()
|
EventList<Page> |
getSourcePages()
|
boolean |
isAsynchronousPrinting()
|
boolean |
isEnlargePageToPaper()
Simply returns the current flag value. |
boolean |
isPageFormatValidationEnabled()
Indicates whether the applied page format should be validated and modified against the chosen print service. |
boolean |
isRotateToFit()
Simply returns the current flag value. |
boolean |
isShowPrintDialog()
Indicates whether a print dialog should be shown. |
boolean |
isShrinkPageToPaper()
Simply returns the current flag value. |
void |
setAsynchronousPrinting(boolean asynchronousPrinting)
Defines whether print tasks will be started synchronously or asynchronously. |
void |
setCurrentPageIndex(int currentPageIndex)
Use this method to set the current viewed Page 's index. |
void |
setEnlargePageToPaper(boolean b)
Simply sets a boolean flag. |
void |
setLayerSelectionToPrint(LayerSelection layerSelection)
|
void |
setLayersToPrint(Collection<DocumentLayer> layers)
|
void |
setPageFormat(PageFormat pf)
Sets a PageFormat object that will be used as the media on which the printer will
print. |
void |
setPageFormatValidationEnabled(boolean pageFormatValidationEnabled)
Sets whether the applied page format should be validated and modified against the chosen print service. |
void |
setPrintServiceName(String printServiceName)
Sets the given print service name. |
void |
setPrintSide(Sides side)
Use this method to preselect the print side attribute. |
void |
setPrintTitle(String printTitle)
Sets the print job title. |
void |
setPrintTitleMaxLength(int maxLength)
Sets the max length of the print job title. |
void |
setReferenceBase(OutputReferenceBase referenceBase)
Sets the reference base. |
void |
setRenderControlInventory(RenderControlInventory renderControlInventory)
|
void |
setRotateToFit(boolean b)
Simply sets a boolean flag. |
void |
setShowPrintDialog(boolean b)
Sets a boolean flag whether a print dialog should be shown. |
void |
setShrinkPageToPaper(boolean b)
Simply sets a boolean flag. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PrintJobConfiguration()
To retrieve a ready-to-use PrintJobConfiguration
instance prepared with default
settings, defined by default values and/or user-defined configuration, it is recommended to use
the factory method create()
instead of using this constructor.
Method Detail |
---|
public static PrintJobConfiguration create()
PrintJobConfiguration
instance, prepared with the all default settings
and configuration, as ready to use instance.
@Deprecated public com.levigo.jadice.document.filter.FilteredDocument getDocument()
public EventList<Page> getSourcePages()
public int getNumbersOfPages()
public Collection<DocumentLayer> getLayersToPrint()
LayerSelection
.public void setLayersToPrint(Collection<DocumentLayer> layers)
public LayerSelection getLayerSelectionToPrint()
public void setLayerSelectionToPrint(LayerSelection layerSelection)
public void setShowPrintDialog(boolean b)
b
- true
if print dialog shall be shown, false
if not.public boolean isShowPrintDialog()
true
if print dialog will be shown; false
if not.public boolean isAsynchronousPrinting()
true
if print task will be started asynchronously, false
if
synchronously.public void setAsynchronousPrinting(boolean asynchronousPrinting)
asynchronousPrinting
- Set to true
if the print task should be executed
asynchronously or false
if synchronously.public void setPageFormat(PageFormat pf)
PageFormat
object that will be used as the media on which the printer will
print. The PageFormat
will be validated and if necessary corrected by printer drivers
before start physical printing if the preferences indicates a validation and correction.
Therefore see Jadice.properties
or user-defined properties-file.
Simply sets an PageFormat
object.
pf
- the PageFormat
object to be set.
IllegalArgumentException
- if argument is null.public PageFormat getPageFormat()
PageFormat
object. If it is not defined before a default page
format will be returned.
PageFormat
that is currently set.public void setEnlargePageToPaper(boolean b)
b
- true
if pages should be enlarged to fit into paper; false
if not.public boolean isEnlargePageToPaper()
true
if pages will be enlarged to fit into the paper; false
if it won't be enlarged.public void setShrinkPageToPaper(boolean b)
b
- true
if pages should be shrunk to fit into paper; false
if not.public boolean isShrinkPageToPaper()
true
if pages will be shrunk to fit into the paper; false
if it won't be shrunk.public void setRotateToFit(boolean b)
b
- true
if pages should be rotated to fit into paper; false
if not.public boolean isRotateToFit()
true
if pages will be rotated to fit into the paper; false
if it won't be rotated.public void setReferenceBase(OutputReferenceBase referenceBase)
Reference base defines whether the imageable area or the paper is used for the fitting of the
content. Use the enumeration OutputReferenceBase
to specify the reference base.
referenceBase
- OutputReferenceBase
public OutputReferenceBase getOutputReferenceBase()
OutputReferenceBase
.
OutputReferenceBase
.public String getPrintTitle()
public void setPrintTitle(String printTitle)
printTitle
- Print title for print job, if the given print tilte is null
, a
empty string will be used as titlepublic int getPrintTitleMaxLength()
public void setPrintTitleMaxLength(int maxLength)
maxLength
- the max length of the print job title. Negative values or zero indicates, that
the print title will not be shortened if necessary.public RenderControlInventory getRenderControlInventory()
public boolean isPageFormatValidationEnabled()
public void setPageFormatValidationEnabled(boolean pageFormatValidationEnabled)
pageFormatValidationEnabled
- public String getPrintServiceName()
public void setPrintServiceName(String printServiceName)
null
, the last print service
name, provided by PrintManager.getLastPrintServiceName()
, will be selected.
printServiceName
- the print service name or null
.public void setRenderControlInventory(RenderControlInventory renderControlInventory)
public Sides getPrintSide()
Sides
-objects or null
if never set.public void setPrintSide(Sides side)
Sides
is part of Java's Printing
Service. Our print model validates if the printer is able to take this option into account.
Note: If a printer or printer driver don't signal the truth about its abilities, this option will mostly be ignored while printing. In rare cases, this option will cause a print job to fail.
side
- One of the predefined Sides
-objects.public int getCurrentPageIndex()
setCurrentPageIndex(int)
or -1 if not set.public void setCurrentPageIndex(int currentPageIndex)
Page
's index.
If a current viewed Page
' index is set a print dialog is able to provide the option to
print only this page.
Note: The default implementation of direct printing (without UI and the ability to
modify print options by an user) doesn't use this page index as an indicator to print the
current page only. For backward compatibility, all source pages will be printed. If only the
current page should be printed, please add only this page via getSourcePages()
.
currentPageIndex
- current viewed Page
's index.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |