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
ConstructorsConstructorDescriptionALcyCustomizerPanelFactory(ILcdFilter aObjectFilter) Creates a newALcyCustomizerPanelFactory. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanCreateCustomizerPanel(Object aObject) ReturnstrueifcreateObjectCustomizerwill return a customizer that can handle the given object,falseotherwise.final ILcyCustomizerPanelcreateCustomizerPanel(Object aObject) Creates a new instance ofILcyCustomizerPanel.protected abstract ILcyCustomizerPanelcreateCustomizerPanelImpl(Object aObject) Called bycreateCustomizerPanelif the given object has passed the filter.Returns theILcdFilterused to decide if this factory accepts a certain object or not.voidsetFilter(ILcdFilter aFilter) Sets theILcdFilterthat is used to decide if this factory accepts a certain object or not.
-
Constructor Details
-
ALcyCustomizerPanelFactory
Creates a newALcyCustomizerPanelFactory. Theacceptmethod 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 theILcdFilterused to decide if this factory accepts a certain object or not.- Returns:
- the
ILcdFilterused to decide if this factory accepts a certain object or not. This will never benull. - See Also:
-
setFilter
Sets theILcdFilterthat is used to decide if this factory accepts a certain object or not. Theacceptmethod of the specified filter will receive the objects passed incanCreateCustomizerPanel. SocanCreateCustomizerPanelhas 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
trueifcreateObjectCustomizerwill return a customizer that can handle the given object,falseotherwise.- Specified by:
canCreateCustomizerPanelin 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 returnedILcyCustomizerPanelusingILcyCustomizerPanel.setObject(Object). Whether that is possible can be verified in advance usingILcyCustomizerPanelFactory.canCreateCustomizerPanel(Object).- Specified by:
createCustomizerPanelin interfaceILcyCustomizerPanelFactory- Parameters:
aObject- The object to create anILcyCustomizerPanelfor.- Returns:
- The result of
createCustomizerPanelImpl(Object)if the object was accepted bycanCreateCustomizerPanel. - Throws:
IllegalArgumentException- ifcanCreateCustomizerPanelreturnsfalseforaObject.- See Also:
-
createCustomizerPanelImpl
Called bycreateCustomizerPanelif 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.
-