public class TLcyMapOverviewLayerControlFactory extends TLcyMapLayerControlFactory
ACTION_BAR, COPY_LAYER_REFERENCE_ACTION, COPY_LAYER_REFERENCE_ACTION_ENABLED_FILTER, DELETE_COMPONENT, DELETE_LAYER_ACTION, DELETE_LAYER_ACTION_ENABLED_FILTER, FIT_TO_LAYER_ACTION, FIT_TO_LAYER_ACTION_ENABLED_FILTER, HELP_ID, LAYER_EDITABLE_ACTIVE_SETTABLE, LAYER_EDITABLE_ACTIVE_SETTABLE_ENABLED_FILTER, LAYER_LABEL_DECONFLICTION_ACTIVE_SETTABLE, LAYER_LABEL_DECONFLICTION_ACTIVE_SETTABLE_ENABLED_FILTER, LAYER_LABELED_ACTIVE_SETTABLE, LAYER_LABELED_ACTIVE_SETTABLE_ENABLED_FILTER, LAYER_LIST_COMPONENT, LAYER_LIST_COMPONENT__TREE, LAYER_LIST_COMPONENT__TREE_CELL_RENDERER, LAYER_LIST_COMPONENT__TREE_MODEL, LAYER_PROPERTIES_ACTION, LAYER_PROPERTIES_ACTION_ENABLED_FILTER, LAYER_PROPERTIES_GROUP_DESCRIPTOR, LAYER_SELECTABLE_ACTIVE_SETTABLE, LAYER_SELECTABLE_ACTIVE_SETTABLE_ENABLED_FILTER, LAYER_SNAPPABLE_ACTIVE_SETTABLE, LAYER_SNAPPABLE_ACTIVE_SETTABLE_ENABLED_FILTER, LAYER_TREE_COMPONENT, LAYER_TREE_COMPONENT__TREE, LAYER_TREE_COMPONENT__TREE_CELL_RENDERER, LAYER_TREE_COMPONENT__TREE_MODEL, LAYER_VISIBLE_ACTIVE_SETTABLE, LAYER_VISIBLE_ACTIVE_SETTABLE_ENABLED_FILTER, MODIFY_VIEW_GROUP_DESCRIPTOR, MOVE_LAYER_BOTTOM_ACTION, MOVE_LAYER_DOWN_ACTION, MOVE_LAYER_GROUP_DESCRIPTOR, MOVE_LAYER_TOP_ACTION, MOVE_LAYER_UP_ACTION, ORDER_ACTION_BAR, POPUP_ACTION_BAR, SCALE_TO_RASTER_ACTION, SCALE_TO_RASTER_ACTION_ENABLED_FILTER, TOGGLE_TREE_ACTIVE_SETTABLE
Constructor and Description |
---|
TLcyMapOverviewLayerControlFactory()
Creates a new
TLcyMapOverviewLayerControlFactory . |
Modifier and Type | Method and Description |
---|---|
protected ILcdFilter<ILcdGXYLayer> |
createEnabledFilter(int aID,
ILcyMapLayerControl aLayerControl)
Creates an
ILcdFilter for the corresponding actions and active settables. |
createAction, createActionBar, createActionBar, createActiveSettable, createAndSetLayout, createComponent, createEmptyMapLayerControl, createMapLayerControl, createPopupMenu, createTree, createTreeCellRenderer, createTreeModel, finalizeCreation, getConfigSourceName, getLucyEnv, insertAction, insertActionBar, insertActionBar, insertActionInActionBar, insertActionInOrderBar, insertActionInPopupMenu, insertActiveSettable, insertActiveSettableInActionBar, insertActiveSettableInOrderBar, insertActiveSettableInPopupMenu, insertComponent, insertComponentInActionBar, insertComponentInOrderBar, setConfigSourceName, setLucyEnv
public TLcyMapOverviewLayerControlFactory()
TLcyMapOverviewLayerControlFactory
. The ILcyLucyEnv
and configuration source name need to be set before using this factory.protected ILcdFilter<ILcdGXYLayer> createEnabledFilter(int aID, ILcyMapLayerControl aLayerControl)
TLcyMapLayerControlFactory
Creates an ILcdFilter
for the corresponding actions and active settables. If
the filter does not accept a layer passed as argument to the ILcdFilter.accept(Object)
method (ie. returns false), the corresponding user
interface element will be disabled when that layer is selected.
This default implementation will always return an ILcdFilter
that is not null.
It is good practice to combine this filter with your filter by using an ALcyCompositeFilter
to which you add your filter and the filter returned
by this defaut implementation.
Following example demonstrates how you could override this method:
protected ILcdFilter<ILcdGXYLayer> createEnabledFilter( int aID, ILcyMapLayerControl aLayerControl ) {
switch ( aID ){
// create a filter that will disable the visibility checkbox for specific layers.
case LAYER_VISIBLE_ACTIVE_SETTABLE_ENABLED_FILTER:
TLcyCompositeAndFilter<ILcdGXYLayer> my_filter = new TLcyCompositeAndFilter<ILcdGXYLayer>();
// Make sure we use the filter created by the super implementation.
// This filter will never be null
.
my_filter.addFilter( super.createEnabledFilter( aID, aLayerControl ) );
// do not accept layers that have a model with a MyModelDescriptor as modeldescriptor.
my_filter.addFilter( new ILcdFilter<ILcdGXYLayer>(){
public boolean accept( ILcdGXYLayer aLayer ){
return !( aLayer.getModel().getModelDescriptor() instanceof MyModelDescriptor );
}
} );
return my_filter;
default:
return super.createEnabledFilter( aID, aLayerControl );
}
}
createEnabledFilter
in class TLcyMapLayerControlFactory
aID
- The ID indicating for which action or active settable the filter applies. It is an
ID defined in this class ending in *_ENABLED_FILTER.aLayerControl
- The layer control for which to create the filter.