Class TLcyMapOverviewLayerControlFactory

java.lang.Object
com.luciad.lucy.map.TLcyMapLayerControlFactory
com.luciad.lucy.addons.map.TLcyMapOverviewLayerControlFactory
All Implemented Interfaces:
ILcyMapLayerControlFactory

public class TLcyMapOverviewLayerControlFactory extends TLcyMapLayerControlFactory
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.
  • Constructor Details

    • TLcyMapOverviewLayerControlFactory

      public TLcyMapOverviewLayerControlFactory()
      Creates a new TLcyMapOverviewLayerControlFactory. The ILcyLucyEnv and configuration source name need to be set before using this factory.
  • Method Details

    • createEnabledFilter

      protected ILcdFilter<ILcdGXYLayer> createEnabledFilter(int aID, ILcyMapLayerControl aLayerControl)
      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 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 );
          }
        }
       

      Overrides:
      createEnabledFilter in class TLcyMapLayerControlFactory
      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.