Package com.luciad.lucy.gui.customizer
Class ALcyCustomizerPanelFactory
java.lang.Object
com.luciad.lucy.gui.customizer.ALcyCustomizerPanelFactory
- All Implemented Interfaces:
ILcyCustomizerPanelFactory
- Direct Known Subclasses:
TLcyEditableAPP6AObjectCustomizerPanelFactory
,TLcyEditableMS2525bObjectCustomizerPanelFactory
public abstract class ALcyCustomizerPanelFactory
extends Object
implements ILcyCustomizerPanelFactory
Abstract implementation of
ILcyCustomizerPanelFactory
that uses a
ILcdFilter
to decide if this factory can be used for a given object.
When using an extension of ALcyCustomizerPanel
as the actual customizer, the
ILcdFilter
instance can thus be shared between the factory and the panel itself,
enforcing a consistent behavior.-
Constructor Summary
ConstructorDescriptionALcyCustomizerPanelFactory
(ILcdFilter aObjectFilter) Creates a newALcyCustomizerPanelFactory
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canCreateCustomizerPanel
(Object aObject) Returnstrue
ifcreateObjectCustomizer
will return a customizer that can handle the given object,false
otherwise.final ILcyCustomizerPanel
createCustomizerPanel
(Object aObject) Creates a new instance ofILcyCustomizerPanel
.protected abstract ILcyCustomizerPanel
createCustomizerPanelImpl
(Object aObject) Called bycreateCustomizerPanel
if the given object has passed the filter.Returns theILcdFilter
used to decide if this factory accepts a certain object or not.void
setFilter
(ILcdFilter aFilter) Sets theILcdFilter
that is used to decide if this factory accepts a certain object or not.
-
Constructor Details
-
ALcyCustomizerPanelFactory
Creates a newALcyCustomizerPanelFactory
. Theaccept
method of the specified filter will receive the objects passed incanCreateCustomizerPanel
.- Parameters:
aObjectFilter
- The filter used to decide if this factory accepts a certain object or not. This must not benull
.
-
-
Method Details
-
getFilter
Returns theILcdFilter
used to decide if this factory accepts a certain object or not.- Returns:
- the
ILcdFilter
used to decide if this factory accepts a certain object or not. This will never benull
. - See Also:
-
setFilter
Sets theILcdFilter
that is used to decide if this factory accepts a certain object or not. Theaccept
method of the specified filter will receive the objects passed incanCreateCustomizerPanel
. SocanCreateCustomizerPanel
has the same return value for a given object asaFilter.accept
.- Parameters:
aFilter
- The filter to decide if an object is accepted or not. This must not benull
.
-
canCreateCustomizerPanel
Returns
true
ifcreateObjectCustomizer
will return a customizer that can handle the given object,false
otherwise.- Specified by:
canCreateCustomizerPanel
in interfaceILcyCustomizerPanelFactory
- Parameters:
aObject
- The object to test if a customizer can be created for it.- Returns:
getFilter().accept( aObject )
- See Also:
-
createCustomizerPanel
Creates a new instance of
ILcyCustomizerPanel
. Users of this method will most likely set an object to the returnedILcyCustomizerPanel
usingILcyCustomizerPanel.setObject(Object)
. Whether that is possible can be verified in advance usingILcyCustomizerPanelFactory.canCreateCustomizerPanel(Object)
.- Specified by:
createCustomizerPanel
in interfaceILcyCustomizerPanelFactory
- Parameters:
aObject
- The object to create anILcyCustomizerPanel
for.- Returns:
- The result of
createCustomizerPanelImpl(Object)
if the object was accepted bycanCreateCustomizerPanel
. - Throws:
IllegalArgumentException
- ifcanCreateCustomizerPanel
returnsfalse
foraObject
.- See Also:
-
createCustomizerPanelImpl
Called bycreateCustomizerPanel
if the given object has passed the filter. Please refer toILcyCustomizerPanelFactory.createCustomizerPanel(Object)
for more details about what this method should do.- Parameters:
aObject
- The object to customize, it is guaranteed to have passed the filter.- Returns:
- The created
ILcyCustomizerPanel
. This should never benull
.
-