public abstract class ALcyCustomizerPanelFactory extends Object implements ILcyCustomizerPanelFactory
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 and Description |
---|
ALcyCustomizerPanelFactory(ILcdFilter aObjectFilter)
Creates a new
ALcyCustomizerPanelFactory . |
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. |
ILcyCustomizerPanel |
createCustomizerPanel(Object aObject)
Creates a new instance of
ILcyCustomizerPanel . |
protected abstract ILcyCustomizerPanel |
createCustomizerPanelImpl(Object aObject)
Called by
createCustomizerPanel if the given object has passed the filter. |
ILcdFilter |
getFilter()
Returns the
ILcdFilter used to decide if this factory accepts a certain object or
not. |
void |
setFilter(ILcdFilter aFilter)
Sets the
ILcdFilter that is used to decide if this factory accepts a certain
object or not. |
public ALcyCustomizerPanelFactory(ILcdFilter aObjectFilter)
ALcyCustomizerPanelFactory
. The accept
method of the
specified filter will receive the objects passed in canCreateCustomizerPanel
.aObjectFilter
- The filter used to decide if this factory accepts a certain object or
not. This must not be null
.public ILcdFilter getFilter()
ILcdFilter
used to decide if this factory accepts a certain object or
not.ILcdFilter
used to decide if this factory accepts a certain object or
not. This will never be null
.setFilter(com.luciad.util.ILcdFilter)
public void setFilter(ILcdFilter aFilter)
ILcdFilter
that is used to decide if this factory accepts a certain
object or not. The accept
method of the specified filter will receive the objects
passed in canCreateCustomizerPanel
. So canCreateCustomizerPanel
has
the same return value for a given object as aFilter.accept
.aFilter
- The filter to decide if an object is accepted or not. This must not be
null
.public boolean canCreateCustomizerPanel(Object aObject)
Returns true
if createObjectCustomizer
will return a customizer that
can handle the given object, false
otherwise.
canCreateCustomizerPanel
in interface ILcyCustomizerPanelFactory
aObject
- The object to test if a customizer can be created for it.getFilter().accept( aObject )
ILcyCustomizerPanelFactory.createCustomizerPanel(java.lang.Object)
public final 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)
.
createCustomizerPanel
in interface ILcyCustomizerPanelFactory
aObject
- The object to create an ILcyCustomizerPanel
for.createCustomizerPanelImpl(Object)
if the object was accepted by
canCreateCustomizerPanel
.IllegalArgumentException
- if canCreateCustomizerPanel
returns
false
for aObject
.ILcyCustomizerPanelFactory.canCreateCustomizerPanel(java.lang.Object)
protected abstract ILcyCustomizerPanel createCustomizerPanelImpl(Object aObject)
createCustomizerPanel
if the given object has passed the filter. Please
refer to ILcyCustomizerPanelFactory.createCustomizerPanel(Object)
for more details
about what this method should do.aObject
- The object to customize, it is guaranteed to have passed the filter.ILcyCustomizerPanel
. This should never be null
.