public class PrintEnvironment extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PRINT_ALL
Configuration setting identifier for print mode: "Print document and annotations"
|
static String |
PRINT_ENLARGE_FIT
Configuration setting identifier for print mode:
"Enlarge document to fit into paper size if needed"
|
static String |
PRINT_FIT
Configuration setting identifier for print mode: "Always fit document into paper size"
|
static String |
PRINT_ONLY_ANNOTATIONS
Configuration setting identifier for print mode: "Print only the annotations"
|
static String |
PRINT_ONLY_DOCUMENT
Configuration setting identifier for print mode: "Print only the document"
|
static String |
PRINT_ORIG_SIZE
Configuration setting identifier for print mode: "Print document in original size"
|
static String |
PRINT_SHRINK_FIT
Configuration setting identifier for print mode:
"Shrink document to fit into paper size if needed"
|
Constructor and Description |
---|
PrintEnvironment() |
Modifier and Type | Method and Description |
---|---|
static PageFormat |
createDefaultPageFormat(org.jadice.util.preferences.PreferenceStore ps)
Returns the default
PageFormat . |
static LayerSelection |
findMatchingLayerSelection(Collection<DocumentLayer> layers) |
static LayerSelection |
getDefaultLayerSelection() |
static String |
getDefaultPrintElement(org.jadice.util.preferences.PreferenceStore ps)
Retrieves the default print elements.
|
static String |
getLastPrintServiceName()
Returns the last used print service name if available.
|
static String[] |
getLastPrintServiceNames()
Returns all last used print service names if available.
|
static OutputReferenceBase |
getOutputReferenceBase(org.jadice.util.preferences.PreferenceStore ps)
Retrieves the setting for output reference base to manipulate the imageable area of the print
output.
|
static List<DocumentLayer> |
getRegisteredLayers()
Returns the list of available layers to be printed based on the preferences.
|
static Collection<LayerSelection> |
getRegisteredLayerSelections() |
static boolean |
isAnnotationPrintEnabled(org.jadice.util.preferences.PreferenceStore ps)
Determines whether the annotations should be printed or not.
|
static boolean |
isDocumentPrintEnabled(org.jadice.util.preferences.PreferenceStore ps)
Determines whether the document should be printed or not.
|
static boolean |
isEnlargeToPaper(org.jadice.util.preferences.PreferenceStore ps)
Determines whether pages should be enlarged to fit into paper size.
|
static boolean |
isOriginalSize(org.jadice.util.preferences.PreferenceStore ps)
Determines whether documents should be printed in original size.
|
static boolean |
isShrinkToPaper(org.jadice.util.preferences.PreferenceStore ps)
Determines whether documents should be shrunk to fit into paper size.
|
static void |
registerLayer(DocumentLayer layer)
Registers given layer for printing.
|
static void |
registerLayerSelection(LayerSelection layerSelection)
Registers a
LayerSelection . |
static void |
setDefaultAdjusting(org.jadice.util.preferences.PreferenceStore ps,
String value)
Sets the default adjusting method.
|
static void |
setDefaultLayerSelection(LayerSelection layerSelection)
Sets the default layer collection for being printed.
|
static void |
setDefaultOutputReferenceBase(org.jadice.util.preferences.PreferenceStore ps,
OutputReferenceBase referenceBase)
Sets the default output reference base.
|
static void |
setDefaultPrintElement(org.jadice.util.preferences.PreferenceStore ps,
String value)
Sets the default print elements.
|
static void |
setLastPrintServiceName(String lastPrintServiceName)
Sets the last used print service name.
|
public static final String PRINT_ALL
public static final String PRINT_ONLY_DOCUMENT
public static final String PRINT_ONLY_ANNOTATIONS
public static final String PRINT_ORIG_SIZE
public static final String PRINT_SHRINK_FIT
public static final String PRINT_ENLARGE_FIT
public static final String PRINT_FIT
public static void setDefaultAdjusting(org.jadice.util.preferences.PreferenceStore ps, String value)
ps
- the preference store that should receive the preferencevalue
- use a constant from the above listpublic static boolean isEnlargeToPaper(org.jadice.util.preferences.PreferenceStore ps)
ps
- the preference store that contains the preferencetrue
if documents should be enlarged to fit into paper size. Otherwise
false
.public static boolean isOriginalSize(org.jadice.util.preferences.PreferenceStore ps)
ps
- the preference store that contains the preferencetrue
if document should be printed in original size. Otherwise false
.public static boolean isShrinkToPaper(org.jadice.util.preferences.PreferenceStore ps)
ps
- the preference store that contains the preferencetrue
if documents should be shrunk to fit into paper size. Otherwise
false
.public static String getDefaultPrintElement(org.jadice.util.preferences.PreferenceStore ps)
PRINT_ALL
, PRINT_ONLY_ANNOTATIONS
and
PRINT_ONLY_DOCUMENT
.ps
- the preference store that contains the preferencePRINT_ALL
,
PRINT_ONLY_ANNOTATIONS
,
PRINT_ONLY_DOCUMENT
public static void setDefaultPrintElement(org.jadice.util.preferences.PreferenceStore ps, String value)
PRINT_ALL
, PRINT_ONLY_ANNOTATIONS
and
PRINT_ONLY_DOCUMENT
.ps
- the preference store that contains the preferencevalue
- use a constant from the above listPRINT_ALL
,
PRINT_ONLY_ANNOTATIONS
,
PRINT_ONLY_DOCUMENT
public static boolean isAnnotationPrintEnabled(org.jadice.util.preferences.PreferenceStore ps)
ps
- the preference store that contains the preferencetrue
if annotations should be printed.false
if not.getDefaultPrintElement(PreferenceStore)
public static boolean isDocumentPrintEnabled(org.jadice.util.preferences.PreferenceStore ps)
ps
- the preference store that contains the preferencetrue
if document should be printed.false
if not.getDefaultPrintElement(PreferenceStore)
public static List<DocumentLayer> getRegisteredLayers()
Automatically registered layers:
public static void registerLayer(DocumentLayer layer)
layer
- the layer to register.public static void setDefaultLayerSelection(LayerSelection layerSelection)
layerSelection
- the LayerSelection
to be used as default.public static LayerSelection getDefaultLayerSelection()
LayerSelection
public static void registerLayerSelection(LayerSelection layerSelection)
LayerSelection
. All registered LayerSelection
s can be used while
printing.layerSelection
- the LayerSelection
to be registered.public static Collection<LayerSelection> getRegisteredLayerSelections()
LayerSelection
s can be used while printing.public static LayerSelection findMatchingLayerSelection(Collection<DocumentLayer> layers)
layers
- a collection of layersLayerSelection
or null
if no match
found.public static OutputReferenceBase getOutputReferenceBase(org.jadice.util.preferences.PreferenceStore ps)
ps
- the preference store that contains the preferenceOutputReferenceBase
.OutputReferenceBase
public static void setDefaultOutputReferenceBase(org.jadice.util.preferences.PreferenceStore ps, OutputReferenceBase referenceBase)
ps
- the preference store should receive the given reference basereferenceBase
- the reference base preference so storepublic static PageFormat createDefaultPageFormat(org.jadice.util.preferences.PreferenceStore ps)
PageFormat
.
If the object wasn't build until now, the method retrieves all required information and builds
the default PageFormat
. The gathered information will be stored in
JadicePreferenceHolder
if not done so far.
ps
- the preference store that contains the preferencePageFormat
.public static String getLastPrintServiceName()
null
if not available.public static String[] getLastPrintServiceNames()
null
if not availablepublic static void setLastPrintServiceName(String lastPrintServiceName)
lastPrintServiceName
- last used print service name.IllegalArgumentException
- if argument for lastPrintServiceName is null
.Copyright © 2024 levigo holding gmbh. All rights reserved.