Class TLcyLspPrintAddOn
- Page Setup...: shows a page setup dialog.
- Print Preview...: shows a print preview dialog.
- Print...: shows a print dialog.
ALcyPrintableMapComponentFactory
. The factory instance
can be explicitly set by using setPrintableComponentFactory
or the class can be set by using the configuration file. If no factory is set, a default factory
will be used.
The content of the print preview dialog is created by a ALcyLspPrintPreviewFactory
. The
factory instance can be explicitly set by using setPrintPreviewFactory
or the class
can be set by using the configuration file. If no factory is set, a default factory will be used.
A TLcyProperties
object is created for every map component. It contains the current
stored values of the properties used in the print addon. Initially all configured properties from the
configuration file are added. Afterwards, the object is updated each time a property has changed eg.
the page orientation, the visibility of the footer text,...
The keys that can be used to retrieve
information from or set information to the properties (using for example get
)
are the constants of the TLcyPrintAddOn
class ending in KEY
, e.g., TLcyPrintAddOn.PAGE_FORMAT_KEY
,
TLcyPrintAddOn.HEADER_TEXT_SELECTED_KEY
, ... The value that can be expected for every key is documented
in the key constant itself, the default value is specified in constants ending in VALUE_DEFAULT
.
It is possible to decorate each printed page by overriding createPageDecorator
, or to add printed pages by overriding
createPrintPageable
. For more
information, see the javadoc of these methods.
- Since:
- 2013.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected TLcyProperties
createDefaultProperties
(ILcyLspMapComponent aMapComponent) This method is used by thegetProperties(ILcyLspMapComponent)
method to retrieve the properties for a certain map component the first time printing is triggered for that map component.createPageDecorator
(TLcyLspPrintContext aPrintContext) Creates aPrintable
that can be used to decorate each page.createPrintPageable
(Pageable aViewPageable, TLcyLspPrintContext aPrintContext) Returns thePageable
that is used for printing (not for preview printing), based on the givenPageable
.Returns theALcyPrintableMapComponentFactory
that is used by this addon.Returns theALcyPrintPreviewFactory
that is used by this addon.getProperties
(ILcyLspMapComponent aMapComponent) Returns theTLcyProperties
for the given map component.void
performQuickPrint
(TLcyProperties aProperties, ILcyLspMapComponent aMapComponent) Trigger the print action foraMapComponent
withaProperties
containing all desired settings.void
plugInto
(ILcyLucyEnv aLucyEnv) Creates and plugs in the add-on's preferences tool.void
setPrintableComponentFactory
(ALcyPrintableMapComponentFactory<ILcyLspMapComponent> aPrintableComponentFactory) Sets theALcyPrintableMapComponentFactory
that should be used by this addon.void
setPrintPreviewFactory
(ALcyPrintPreviewFactory<TLcyLspPrintContext> aPrintPreviewFactory) Sets theALcyPrintPreviewFactory
that should be used by this addon.Methods inherited from class com.luciad.lucy.addons.ALcyPreferencesAddOn
createPreferencesTool, getLongPrefix, getLucyEnv, getPreferences, getPreferencesTool, getShortPrefix, unplugFrom
Methods inherited from class com.luciad.lucy.addons.ALcyAddOn
getConfigSourceName, getDisplayName, setConfigSourceName, setDisplayName
-
Constructor Details
-
TLcyLspPrintAddOn
public TLcyLspPrintAddOn()Creates a new print add-on. To plug in the add-on, theplugInto
method must also be called. This is typically done by aILcyLucyEnv
instance, upon request of the application front-end.
-
-
Method Details
-
plugInto
Description copied from class:ALcyPreferencesAddOn
Creates and plugs in the add-on's preferences tool.- Overrides:
plugInto
in classALcyPreferencesAddOn
- Parameters:
aLucyEnv
- the Lucy environment to plug into- See Also:
-
getPrintableComponentFactory
Returns theALcyPrintableMapComponentFactory
that is used by this addon.- Returns:
- the
ALcyPrintableMapComponentFactory
that is used by this addon.
-
setPrintableComponentFactory
public void setPrintableComponentFactory(ALcyPrintableMapComponentFactory<ILcyLspMapComponent> aPrintableComponentFactory) Sets theALcyPrintableMapComponentFactory
that should be used by this addon. Please refer toTLcyLspPrintAddOn
for more information.- Parameters:
aPrintableComponentFactory
- The printable component factory.
-
getPrintPreviewFactory
Returns theALcyPrintPreviewFactory
that is used by this addon.- Returns:
- the
ALcyPrintPreviewFactory
that is used by this addon.
-
setPrintPreviewFactory
public void setPrintPreviewFactory(ALcyPrintPreviewFactory<TLcyLspPrintContext> aPrintPreviewFactory) Sets theALcyPrintPreviewFactory
that should be used by this addon. Please refer toTLcyLspPrintAddOn
for more information.- Parameters:
aPrintPreviewFactory
- The print preview factory.
-
getProperties
Returns theTLcyProperties
for the given map component. These are the current stored values of the properties used in the print addon. Please refer toTLcyLspPrintAddOn
for more information. Note that if you want to change the default properties (=the properties used the first time printing is triggered for a certain map component), it is best to override thecreateDefaultProperties(ILcyLspMapComponent)
method instead.- Parameters:
aMapComponent
- The map component to query.- Returns:
- the
TLcyProperties
for the given map component.
-
createDefaultProperties
This method is used by the
getProperties(ILcyLspMapComponent)
method to retrieve the properties for a certain map component the first time printing is triggered for that map component.By default this method returns a
TLcyProperties
instance containing the settings defined in the configuration file. You can override this method to for example add extra settings to those properties. Note that you can add those extra settings as well by putting them in the configuration file.It is important that this method always returns a new
TLcyProperties
instance to avoid that changing the settings of one map component would affect the settings of another map component.- Parameters:
aMapComponent
- The map component- Returns:
- The initial
TLcyProperties
for the given map component. - Since:
- 2015.1.27
- See Also:
-
performQuickPrint
Trigger the print action for
aMapComponent
withaProperties
containing all desired settings.This method allows you to perform a print action through the API.
- Parameters:
aProperties
- The properties containing the desired print settings.aMapComponent
- The map component which must be printed.
-
createPageDecorator
Creates a
Printable
that can be used to decorate each page. It is for example possible to add a watermark to each page by overriding this method.By default, this method returns
null
, meaning that no decorations are added.- Parameters:
aPrintContext
- the print context.- Returns:
- a
Printable
that can be used to decorate each page.
-
createPrintPageable
Returns the
Pageable
that is used for printing (not for preview printing), based on the givenPageable
. The givenPageable
is used to print the view. Override this method to return a customPageable
, e.g. by wrapping the givenPageable
. It is for example possible to add a title page by overriding this method.By default, this method returns
aViewPageable
.- Parameters:
aViewPageable
- thePageable
that is capable to print the view.aPrintContext
- the print context.- Returns:
- the
Pageable
that is used for printing
-