Package com.luciad.lucy.addons.map
Class TLcyMapOverviewLayerControlFactory
java.lang.Object
com.luciad.lucy.map.TLcyMapLayerControlFactory
com.luciad.lucy.addons.map.TLcyMapOverviewLayerControlFactory
- All Implemented Interfaces:
ILcyMapLayerControlFactory
Extension of the normal TLcyMapLayerControlFactory, which disables the delete action for both the
grid layer and the overview layer, since there is no mean to restore those layers once they are
deleted.
-
Field Summary
Fields inherited from class com.luciad.lucy.map.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 Summary
ConstructorDescriptionCreates a newTLcyMapOverviewLayerControlFactory
. -
Method Summary
Modifier and TypeMethodDescriptionprotected ILcdFilter
<ILcdGXYLayer> createEnabledFilter
(int aID, ILcyMapLayerControl aLayerControl) Creates anILcdFilter
for the corresponding actions and active settables.Methods inherited from class com.luciad.lucy.map.TLcyMapLayerControlFactory
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
-
Constructor Details
-
TLcyMapOverviewLayerControlFactory
public TLcyMapOverviewLayerControlFactory()Creates a newTLcyMapOverviewLayerControlFactory
. TheILcyLucyEnv
and configuration source name need to be set before using this factory.
-
-
Method Details
-
createEnabledFilter
Description copied from class:TLcyMapLayerControlFactory
Creates an
ILcdFilter
for the corresponding actions and active settables. If the filter does not accept a layer passed as argument to theILcdFilter.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 anALcyCompositeFilter
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 ); } }- Overrides:
createEnabledFilter
in classTLcyMapLayerControlFactory
- Parameters:
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.- Returns:
- An ILcdFilter that determines for which layers the corresponding action will be enabled in the user interface. The default implementation never returns null, but subclasses can and may return null.
-