public class TLcyPrintAreaCustomizerFactory extends Object implementsILcyObjectCustomizerFactory, ILcyCustomizerPanelFactory
Customizer
or ILcyCustomizerPanel
(the GUI)
that allows the user to edit the print area when it is selected.
This implementation creates a panel containing two customizer panels. The top panel lets the
user modify the page orientation (portrait or landscape) of the print area. The bottom panel
lets the user modify the properties corresponding to the printing area. This panel allows to
type in the page row count, the page column count, the scale and to change the 'snap to pages'
checkbox.
To replace the GUI with a custom one, create an extension of this class that overwrites the
method createPrintAreaCustomizerPanelContent(com.luciad.lucy.addons.print.TLcyPrintContext, com.luciad.lucy.util.context.TLcyDomainObjectContext)
and configure the TLcyPrintAddOn to use
that extension.Modifier and Type | Field and Description |
---|---|
static int |
PRINTER_SETTINGS_PANEL
The id for creating the printer settings
ILcyCustomizerPanel . |
static int |
PRINTING_AREA_PANEL
The id for creating the settings
ILcyCustomizerPanel corresponding to the printing area. |
Constructor and Description |
---|
TLcyPrintAreaCustomizerFactory()
Default constructor.
|
TLcyPrintAreaCustomizerFactory(ILcyLucyEnv aLucyEnv)
Creates a new
TLcyPrintAreaCustomizerFactory . |
Modifier and Type | Method and Description |
---|---|
boolean |
canCreateCustomizerPanel(Object aObject)
Returns
true if createObjectCustomizer will return a customizer that
can handle the given object, false otherwise. |
boolean |
canCreateObjectCustomizer(Object aObject,
ILcdModel aModel,
ILcdGXYView aView)
Deprecated.
Use methods of
ILcyCustomizerPanelFactory instead. |
ILcyCustomizerPanel |
createCustomizerPanel(Object aObject)
Creates a new instance of
ILcyCustomizerPanel . |
Customizer |
createObjectCustomizer(Object aObject,
ILcdModel aModel,
ILcdGXYView aGXYView)
Deprecated.
Use methods of
ILcyCustomizerPanelFactory instead. |
String |
createObjectCustomizerDisplayName(Object aObject,
ILcdModel aModel,
ILcdGXYView aView)
Deprecated.
Use methods of
ILcyCustomizerPanelFactory instead. |
protected ILcyCustomizerPanel |
createPanel(int aID,
TLcyPrintContext aPrintContext)
Creates a
ILcyCustomizerPanel for the given ID. |
protected ILcyCustomizerPanel |
createPrintAreaCustomizerPanel(TLcyPrintContext aPrintContext,
TLcyDomainObjectContext aContext)
Creates the
ILcyCustomizerPanel that can modify the attributes of the print area
(area that can be drawn on the map to exactly define what needs to be printed), by offering a
user interface that allows modifying the properties stored in the given aPrintContext (see
ALcyPrintContext.getProperties() ).
Note that the aPrintContext object is also set afterwards to the returned
ILcyCustomizerPanel , using setObject . |
protected ILcyCustomizerPanel |
createPrintAreaCustomizerPanelContent(TLcyPrintContext aPrintContext,
TLcyDomainObjectContext aContext)
Retrieves all
ILcyCustomizerPanel s and lays them out in one big ILcyCustomizerPanel . |
protected Customizer |
createPrintContextCustomizer(TLcyPrintContext aPrintContext,
Object aObject,
ILcdModel aModel,
ILcdGXYView aGXYView)
Deprecated.
Use methods of
ILcyCustomizerPanelFactory instead.
Creates the Customizer that can modify the attributes of the
print area (area that can be drawn on the map to exactly define what needs
to be printed), by offering a user interface that allows modifying the
properties stored in the given aPrintContext
(see ALcyPrintContext.getProperties() ).
Note that the aPrintContext object is also set afterwards to the returned
Customizer , using setObject .
Subclasses can overwrite this method to return their own Customizer. They could for example
return a Customizer that links the property
TLcyPrintAddOn.PRINTING_AREA_PREFIX + TLcyPrintAddOn.PRINTING_AREA_CHOICE_VALUE_PRINT_AREA + "." + TLcyPrintAddOn.SNAP_TO_FULL_PAGES_SELECTED_SUFFIX
to a checkbox in its user interface. |
ILcyLucyEnv |
getLucyEnv()
Returns the Lucy environment to which this customizer factory belongs.
|
protected ILcyCustomizerPanel |
getPanel(int aID)
Returns the panel, that was created earlier, as a
java.awt.Component for the given ID. |
void |
setLucyEnv(ILcyLucyEnv aLucyEnv)
Sets the Lucy environment to which this customizer factory belongs.
|
public static final int PRINTER_SETTINGS_PANEL
ILcyCustomizerPanel
. It allows to choose the
page orientation.public static final int PRINTING_AREA_PANEL
ILcyCustomizerPanel
corresponding to the printing area.
It allows the user to select the number of pages, the scale, ...public TLcyPrintAreaCustomizerFactory()
TLcyPrintAreaCustomizerFactory
. Note that
you will have to set an ILcyLucyEnv
before this instance can be used.public TLcyPrintAreaCustomizerFactory(ILcyLucyEnv aLucyEnv)
TLcyPrintAreaCustomizerFactory
.aLucyEnv
- The lucy environment, contextual information.public void setLucyEnv(ILcyLucyEnv aLucyEnv)
aLucyEnv
- The Lucy environment to which this customizer factory belongs.public ILcyLucyEnv getLucyEnv()
@Deprecated public String createObjectCustomizerDisplayName(Object aObject, ILcdModel aModel, ILcdGXYView aView)
ILcyCustomizerPanelFactory
instead.ILcyObjectCustomizerFactory
createObjectCustomizerDisplayName
in interface ILcyObjectCustomizerFactory
ILcyObjectCustomizerFactory.createObjectCustomizer(java.lang.Object, com.luciad.model.ILcdModel, com.luciad.view.gxy.ILcdGXYView)
@Deprecated public boolean canCreateObjectCustomizer(Object aObject, ILcdModel aModel, ILcdGXYView aView)
ILcyCustomizerPanelFactory
instead.ILcyObjectCustomizerFactory
canCreateObjectCustomizer
in interface ILcyObjectCustomizerFactory
aObject
- The object to test if a customizer can be created for it.aModel
- The model that contains aObject. This parameter can be null if no
model is available.aView
- The view the given object is in. This parameter can be null is
no such view is available.ILcyObjectCustomizerFactory.createObjectCustomizer(java.lang.Object, com.luciad.model.ILcdModel, com.luciad.view.gxy.ILcdGXYView)
@Deprecated public Customizer createObjectCustomizer(Object aObject, ILcdModel aModel, ILcdGXYView aGXYView)
ILcyCustomizerPanelFactory
instead.ILcyObjectCustomizerFactory
ILcyObjectCustomizerFactory.canCreateObjectCustomizer(Object, com.luciad.model.ILcdModel, com.luciad.view.gxy.ILcdGXYView)
and customizer.setObject
: at least when the
canCreateObjectCustomizer
method returns false, an
IllegalArgumentException
should be thrown by
setObject
for the same object.
setObject(null) can be used on the created Customizer to (temporarily) de-initialize it.
Note: the implementation of this method must not call setObject on the
newly created Customizer as this is the responsibility of the user of the
created Customizer.createObjectCustomizer
in interface ILcyObjectCustomizerFactory
aObject
- The object to create a customizer for.aModel
- The model that contains aObject. This parameter can be null if no
model is available.aGXYView
- The view the given object is in. This parameter can be null if
no such view is available.ILcyObjectCustomizerFactory.canCreateObjectCustomizer(java.lang.Object, com.luciad.model.ILcdModel, com.luciad.view.gxy.ILcdGXYView)
@Deprecated protected Customizer createPrintContextCustomizer(TLcyPrintContext aPrintContext, Object aObject, ILcdModel aModel, ILcdGXYView aGXYView)
ILcyCustomizerPanelFactory
instead.
Creates the Customizer
that can modify the attributes of the
print area (area that can be drawn on the map to exactly define what needs
to be printed), by offering a user interface that allows modifying the
properties stored in the given aPrintContext
(see ALcyPrintContext.getProperties()
).
Note that the aPrintContext object is also set afterwards to the returned
Customizer
, using setObject
.
Subclasses can overwrite this method to return their own Customizer. They could for example
return a Customizer
that links the property
TLcyPrintAddOn.PRINTING_AREA_PREFIX + TLcyPrintAddOn.PRINTING_AREA_CHOICE_VALUE_PRINT_AREA + "." + TLcyPrintAddOn.SNAP_TO_FULL_PAGES_SELECTED_SUFFIX
to a checkbox in its user interface.aPrintContext
- The print context object this customizer should customize. It
typically only customizes the properties retrieved using ALcyPrintContext.getProperties()
).
The keys of that properties object are the various constants defined in TLcyPrintAddOn
.
This aPrintContext is also set afterwards to the returned customizer using setObject
.aObject
- The object, can be used as contextual information.aModel
- The model, can be used as contextual information.aGXYView
- The view, can be used as contextual information.Customizer
.public boolean canCreateCustomizerPanel(Object aObject)
Returns true
if createObjectCustomizer
will return a customizer that
can handle the given object, false
otherwise.
This implementation operates on TLcyDomainObjectContext
s that contain a reference to
a print area (area that can be drawn on the map to exactly define what needs to be printed).
canCreateCustomizerPanel
in interface ILcyCustomizerPanelFactory
aObject
- The object to test if a customizer can be created for it.true
if createObjectCustomizer will return a customizer that can handle the given
object, false
otherwise.ILcyCustomizerPanelFactory.createCustomizerPanel(java.lang.Object)
public ILcyCustomizerPanel createCustomizerPanel(Object aObject)
Creates a new instance of ILcyCustomizerPanel
. Users of this method will most
likely set an object to the returned ILcyCustomizerPanel
using ILcyCustomizerPanel.setObject(Object)
. Whether that is possible can be verified in advance
using ILcyCustomizerPanelFactory.canCreateCustomizerPanel(Object)
.
This implementation operates on TLcyDomainObjectContext
s that contain a reference to
a print area (area that can be drawn on the map to exactly define what needs to be printed).
createCustomizerPanel
in interface ILcyCustomizerPanelFactory
aObject
- The object to create an ILcyCustomizerPanel
for.ILcyCustomizerPanel
.ILcyCustomizerPanelFactory.canCreateCustomizerPanel(java.lang.Object)
protected ILcyCustomizerPanel createPrintAreaCustomizerPanel(TLcyPrintContext aPrintContext, TLcyDomainObjectContext aContext)
ILcyCustomizerPanel
that can modify the attributes of the print area
(area that can be drawn on the map to exactly define what needs to be printed), by offering a
user interface that allows modifying the properties stored in the given aPrintContext (see
ALcyPrintContext.getProperties()
).
Note that the aPrintContext object is also set afterwards to the returned
ILcyCustomizerPanel
, using setObject
.
This function
createPanel
with all ID's ending in PANEL
.
createPrintAreaCustomizerPanelContent
,
which creates the content of the customizer panel by laying out all panels created in the previous step.
Those panels can be retrieved using getPanel
.
aPrintContext
- The print context object this customizer should customize. It typically
only customizes the properties retrieved using ALcyPrintContext.getProperties()
). The
keys of that properties object are the various constants defined in TLcyPrintAddOn
.
This aPrintContext is also set afterwards to the returned customizer using setObject
.aContext
- The TLcyDomainObjectContext
, can be used as contextual information.ILcyCustomizerPanel
.protected ILcyCustomizerPanel createPrintAreaCustomizerPanelContent(TLcyPrintContext aPrintContext, TLcyDomainObjectContext aContext)
ILcyCustomizerPanel
s and lays them out in one big ILcyCustomizerPanel
.
Therefore, this method uses getPanel(int)
with all ID's that end in
PANEL
, and lays out those components in for example a
TLcyCompositeCustomizerPanel
.
This function should be overridden when the global layout of the print are customizer panel
needs to be changed, for example when the main panels such as the 'Printer settings' panel,
'Printing area' panel need to be rearranged, or when a new panel needs to be added.aPrintContext
- The print context to use.aContext
- The TLcyDomainObjectContext
, can be used as contextual information.protected ILcyCustomizerPanel createPanel(int aID, TLcyPrintContext aPrintContext)
Creates a ILcyCustomizerPanel
for the given ID.
Please refer to createPrintAreaCustomizerPanel
for an overview of the method call sequence.
aID
- The id describing which panel to create. This is a constant that ends in PANEL
.aPrintContext
- The print context to use.ILcyCustomizerPanel
, or null.getPanel(int)
protected ILcyCustomizerPanel getPanel(int aID)
Returns the panel, that was created earlier, as a java.awt.Component
for the given ID.
Please refer to createPrintAreaCustomizerPanel
for an overview of the method call sequence.
aID
- The id describing which panel to return. This is a constant that ends in PANEL
.java.awt.Component
for the given ID.createPanel(int, TLcyPrintContext)