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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TLcyPropertiescreateDefaultProperties(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 aPrintablethat can be used to decorate each page.createPrintPageable(Pageable aViewPageable, TLcyLspPrintContext aPrintContext) Returns thePageablethat is used for printing (not for preview printing), based on the givenPageable.Returns theALcyPrintableMapComponentFactorythat is used by this addon.Returns theALcyPrintPreviewFactorythat is used by this addon.getProperties(ILcyLspMapComponent aMapComponent) Returns theTLcyPropertiesfor the given map component.voidperformQuickPrint(TLcyProperties aProperties, ILcyLspMapComponent aMapComponent) Trigger the print action foraMapComponentwithaPropertiescontaining all desired settings.voidplugInto(ILcyLucyEnv aLucyEnv) Creates and plugs in the add-on's preferences tool.voidsetPrintableComponentFactory(ALcyPrintableMapComponentFactory<ILcyLspMapComponent> aPrintableComponentFactory) Sets theALcyPrintableMapComponentFactorythat should be used by this addon.voidsetPrintPreviewFactory(ALcyPrintPreviewFactory<TLcyLspPrintContext> aPrintPreviewFactory) Sets theALcyPrintPreviewFactorythat should be used by this addon.Methods inherited from class com.luciad.lucy.addons.ALcyPreferencesAddOn
createPreferencesTool, getLongPrefix, getLucyEnv, getPreferences, getPreferencesTool, getShortPrefix, unplugFromMethods 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, theplugIntomethod must also be called. This is typically done by aILcyLucyEnvinstance, upon request of the application front-end.
-
-
Method Details
-
plugInto
Description copied from class:ALcyPreferencesAddOnCreates and plugs in the add-on's preferences tool.- Overrides:
plugIntoin classALcyPreferencesAddOn- Parameters:
aLucyEnv- the Lucy environment to plug into- See Also:
-
getPrintableComponentFactory
Returns theALcyPrintableMapComponentFactorythat is used by this addon.- Returns:
- the
ALcyPrintableMapComponentFactorythat is used by this addon.
-
setPrintableComponentFactory
public void setPrintableComponentFactory(ALcyPrintableMapComponentFactory<ILcyLspMapComponent> aPrintableComponentFactory) Sets theALcyPrintableMapComponentFactorythat should be used by this addon. Please refer toTLcyLspPrintAddOnfor more information.- Parameters:
aPrintableComponentFactory- The printable component factory.
-
getPrintPreviewFactory
Returns theALcyPrintPreviewFactorythat is used by this addon.- Returns:
- the
ALcyPrintPreviewFactorythat is used by this addon.
-
setPrintPreviewFactory
public void setPrintPreviewFactory(ALcyPrintPreviewFactory<TLcyLspPrintContext> aPrintPreviewFactory) Sets theALcyPrintPreviewFactorythat should be used by this addon. Please refer toTLcyLspPrintAddOnfor more information.- Parameters:
aPrintPreviewFactory- The print preview factory.
-
getProperties
Returns theTLcyPropertiesfor the given map component. These are the current stored values of the properties used in the print addon. Please refer toTLcyLspPrintAddOnfor 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
TLcyPropertiesfor 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
TLcyPropertiesinstance 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
TLcyPropertiesinstance 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
TLcyPropertiesfor the given map component. - Since:
- 2015.1.27
- See Also:
-
performQuickPrint
Trigger the print action for
aMapComponentwithaPropertiescontaining 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
Printablethat 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
Printablethat can be used to decorate each page.
-
createPrintPageable
Returns the
Pageablethat is used for printing (not for preview printing), based on the givenPageable. The givenPageableis 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- thePageablethat is capable to print the view.aPrintContext- the print context.- Returns:
- the
Pageablethat is used for printing
-