Class TLcyLspMapLayerControlFactory
Factory to create a TLcyLspMapLayerControl for a given
TLcyLspMapComponent. It cannot create a layer control for other
ILcyGenericMapComponent implementations.
It uses the concept of an ALcyGUIFactory, allowing the users of this
class to modify almost every part of the creation process.
The layer control is composed of a list of layers, and several ILcyActionBar
instances that contain actions to move and delete the selected layer(s) and to change their
properties.
- Since:
- 2012.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe ID for thecreateActionBarmethod that represents the regularILcyActionBar, by default the tool bar located at the top of the layer control panel.static final intThe ID for thecreatePanelmethod that represents the panel located at the center of the layer control.static final intThe ID for thecreateActionmethod that represents the action to adapt the world reference of the view so that the projection and geodetic datum match with that of the model of the selected layer.static final intThe ID for thecreateActionEnabledFiltermethod that represents theILcdFilterto enable or disable the copy layer reference action.static final intThe ID for thecreateActionmethod that represents the action to import layers from another map component.static final intThe ID for thecreateActionmethod that represents the action to delete the selected layer(s).static final intThe ID for thecreateEnabledActionFiltermethod that represents theILcdFilterto enable or disable the delete layer action.static final intThe ID for thecreatePanelmethod that represents the panel located at the east of the layer control.static final intThe ID for thecreateActionmethod that represents the action to fit the map extents so that the selected layers are shown.static final intThe ID for thecreateEnabledActionFiltermethod that represents theILcdFilterto enable or disable the fit to layer action.static final intThe ID for thecreateTransferHandler(int, com.luciad.lucy.util.properties.ALcyProperties)method that represents the transfer handler for the layer control.static final intThe ID for thecreateActiveSettablemethod that represents the active settable to toggle the editable property of the selected layer(s) on or off.static final intThe ID for thecreateEnabledActiveSettableFiltermethod that represents theILcdFilterto enable or disable the layer editable active settablestatic final intThe ID for thecreateActiveSettablemethod that represents the active settable to toggle the labeled property of the selected layer(s).static final intThe ID for thecreateEnabledActiveSettableFiltermethod that represents theILcdFilterto enable or disable the layer labeled active settable.static final intThe ID for thecreateActionmethod that represents the action to show the layer properties of the selected layer(s).static final intThe ID for thecreateEnabledActionFiltermethod that represents theILcdFilterto enable or disable the layer properties action.static final intThe ID for thecreateActiveSettablemethod that represents the active settable to toggle the selectable property of the selected layer(s).static final intThe ID for thecreateEnabledActiveSettableFiltermethod that represents theILcdFilterto enable or disable the layer selectable active settable.static final intThe ID for thecreateComponentmethod that represents theComponentto show a hierarchical view on the layers of the view.static final intThe ID for thecreateActiveSettablemethod that represents the active settable to toggle the visibility property of the selected layer(s).static final intThe ID for thecreateEnabledActiveSettableFiltermethod that represents theILcdFilterto enable or disable the layer visible active settable.static final StringThe name of the property, containing the map component.static final intThe ID for thecreateActionmethod that represents the action to move layers to the bottom of the view.static final intThe ID for thecreateActionmethod that represents the action to move layers one position towards the bottom of the view.static final intThe ID for thecreateActionmethod that represents the action to move layers to the top of the view.static final intThe ID for thecreateActionmethod that represents the action to move layers one position towards the top of the view.static final intThe ID for thecreatePanelmethod that represents the panel located at the north of the layer control.static final intThe ID for thecreateActionBarmethod that represents the so called order bar, which contains by default the buttons to change the position of layers in the view, and which is located by default at the east of the layer control panel.static final intThe ID for thecreateActionmethod that represents the action to change the transparency of the layer.static final intThe ID for thecreateActionEnabledFiltermethod that represents theILcdFilterfor the action to change the transparency of a layer.static final intThe ID for thecreatePanelmethod that represents the panel located at the south of the layer control.static final intThe ID for thecreateTreemethod that represents the SwingJTreefor the hierarchical layer view.static final intThe ID for thecreateTreeCellRenderermethod that represents the Swing tree cell renderer for the hierarchical layer view.static final intThe ID for thecreateTreeModelmethod that represents the Swing tree model for the hierarchical layer view.static final intThe ID for thecreatePanelmethod that represents the panel located at the west of the layer control. -
Constructor Summary
ConstructorsConstructorDescriptionTLcyLspMapLayerControlFactory(ILcyLucyEnv aLucyEnv) Creates a new layer control factory for the specifiedILcyLucyEnv. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcleanup(ALcyProperties aProperties) Performs cleanup operations, such as nullifying fields that are no longer needed.protected ILcdActioncreateAction(int aActionID, ALcyProperties aProperties) Creates anILcdActionfor the given ID.protected ILcyActionBarcreateActionBar(int aActionBarID, ALcyProperties aProperties) Creates an empty action bar.protected ILcdFilter<ILspLayer> createActionEnabledFilter(int aFilterID, ALcyProperties aProperties) Creates anILcdFilterfor the corresponding action.protected ILcyActiveSettablecreateActiveSettable(int aActiveSettableID, ALcyProperties aProperties) Creates anILcyActiveSettablefor the given ID.protected ILcdFilter<ILspLayer> createActiveSettableEnabledFilter(int aFilterID, ALcyProperties aProperties) Creates anILcdFilterfor the corresponding active settable.protected ComponentcreateComponent(int aComponentID, ALcyProperties aProperties) Creates a widget for the given ID.protected TLcyLspMapLayerControlcreateEmptyMapLayerControl(ALcyProperties aProperties) Creates an empty layer control, without any content, buttons or panels.protected TLcyLspMapLayerControlcreateGUIContent(ALcyProperties aProperties) Retrieves all panels and lays them out in ajava.awt.Component.protected ComponentcreatePanel(int aPanelID, ALcyProperties aProperties) Creates a panel for the given ID.protected ILcyPopupMenucreatePopupMenu(ALcyProperties aProperties) Creates an empty popup menu.protected TransferHandlercreateTransferHandler(int aTransferHandlerID, ALcyProperties aProperties) Creates aTransferHandlerfor the given ID.protected JTreecreateTree(int aTreeID, ALcyProperties aProperties) Creates the tree corresponding to the IDaTreeID.protected TreeCellRenderercreateTreeCellRenderer(int aTreeCellRendererID, ALcyProperties aProperties) Creates the tree cell renderer corresponding to the IDaTreeCellRendererID.protected TreeModelcreateTreeModel(int aTreeModelID, ALcyProperties aProperties) Creates the tree model corresponding to the IDaTreeModelID.protected ILcyActionBargetActionBar(int aActionBarID) Returns theILcyActionBarfor the given ID.protected ILcdIntListReturns the list with all action bar IDs.protected ObjectgetActionContext(int aActionID, ALcyProperties aProperties) Returns the context of the action bars in which the action with the specified ID should be inserted.protected ILcdFilter<ILspLayer> getActionEnabledFilter(int aFilterID) Returns theILcdFilterfor the given ID.protected ILcdIntListReturns the list with all enabled action filter IDs.protected ObjectgetActiveSettableContext(int aActiveSettableID, ALcyProperties aProperties) Returns the context of the action bars in which the active settable with the specified ID should be inserted.protected ILcdFilter<ILspLayer> getActiveSettableEnabledFilter(int aFilterID) Returns theILcdFilterfor the given ID.protected ILcdIntListReturns the list with all enabled active settable filter IDs.protected ILcyLspMapComponentgetMapComponent(ALcyProperties aProperties) Convenience method to retrieve the map component fromaProperties.protected TLcyLspMapLayerControlReturns the map layer control under construction.protected ILcyPopupMenuReturns the createdILcyPopupMenu.protected TransferHandlergetTransferHandler(int aTransferHandlerID) Returns theTransferHandlerfor the given ID.protected ILcdIntListReturns the list with all transfer handler IDs.protected JTreegetTree(int aTreeID) Returns theJTreefor the given ID.protected TreeCellRenderergetTreeCellRenderer(int aTreeCellRendererID) Returns theTreeCellRendererfor the given ID.protected ILcdIntListReturns the list with all tree cell renderer IDs.protected ILcdIntListReturns the list with all tree IDs.protected TreeModelgetTreeModel(int aTreeModelID) Returns theTreeModelfor the given ID.protected ILcdIntListReturns the list with all tree model IDs.protected voidsetup(ALcyProperties aProperties) This method overrides the default behavior of thesetupmethod.Methods inherited from class com.luciad.lucy.gui.ALcyGUIFactory
createGUI, getAction, getActionIDs, getActiveSettable, getActiveSettableIDs, getComponent, getComponentIDs, getLucyEnv, getPanel, getPanelIDs, isActiveSettableDeactivatePossible
-
Field Details
-
MAP_COMPONENT_PROPERTY_NAME
The name of the property, containing the map component. TheTLcyLspMapComponentFactorywill insert the map component it is creating in the properties, passed to this factory. This map component can be retrieved by this String.- See Also:
-
FIT_TO_LAYER_ACTION
public static final int FIT_TO_LAYER_ACTIONThe ID for thecreateActionmethod that represents the action to fit the map extents so that the selected layers are shown.- See Also:
-
LAYER_PROPERTIES_ACTION
public static final int LAYER_PROPERTIES_ACTIONThe ID for thecreateActionmethod that represents the action to show the layer properties of the selected layer(s). It does so using theILcyCustomizerPanelFactorys available in theTLcyUserInterfaceManagerfor an object of typeTLcyLayerContext.- See Also:
-
DELETE_LAYER_ACTION
public static final int DELETE_LAYER_ACTIONThe ID for thecreateActionmethod that represents the action to delete the selected layer(s).- See Also:
-
MOVE_LAYER_TOP_ACTION
public static final int MOVE_LAYER_TOP_ACTIONThe ID for thecreateActionmethod that represents the action to move layers to the top of the view.- See Also:
-
MOVE_LAYER_UP_ACTION
public static final int MOVE_LAYER_UP_ACTIONThe ID for thecreateActionmethod that represents the action to move layers one position towards the top of the view.- See Also:
-
MOVE_LAYER_DOWN_ACTION
public static final int MOVE_LAYER_DOWN_ACTIONThe ID for thecreateActionmethod that represents the action to move layers one position towards the bottom of the view.- See Also:
-
MOVE_LAYER_BOTTOM_ACTION
public static final int MOVE_LAYER_BOTTOM_ACTIONThe ID for thecreateActionmethod that represents the action to move layers to the bottom of the view.- See Also:
-
COPY_LAYERS_ACTION
public static final int COPY_LAYERS_ACTIONThe ID for the
createActionmethod that represents the action to import layers from another map component.- See Also:
-
COPY_LAYER_REFERENCE_ACTION
public static final int COPY_LAYER_REFERENCE_ACTIONThe ID for thecreateActionmethod that represents the action to adapt the world reference of the view so that the projection and geodetic datum match with that of the model of the selected layer. As a result, no projection or geodetic datum transformations are required when painting that specific layer, resulting in faster paint times (for that layer). This is especially true for raster data (imagery), where those transformations are computationally expensive (called warping).- See Also:
-
SET_LAYER_TRANSPARENCY_ACTION
public static final int SET_LAYER_TRANSPARENCY_ACTIONThe ID for thecreateActionmethod that represents the action to change the transparency of the layer.- Since:
- 2017.0
- See Also:
-
LAYER_SELECTABLE_ACTIVE_SETTABLE
public static final int LAYER_SELECTABLE_ACTIVE_SETTABLEThe ID for thecreateActiveSettablemethod that represents the active settable to toggle the selectable property of the selected layer(s).- See Also:
-
LAYER_LABELED_ACTIVE_SETTABLE
public static final int LAYER_LABELED_ACTIVE_SETTABLEThe ID for thecreateActiveSettablemethod that represents the active settable to toggle the labeled property of the selected layer(s).- See Also:
-
LAYER_VISIBLE_ACTIVE_SETTABLE
public static final int LAYER_VISIBLE_ACTIVE_SETTABLEThe ID for thecreateActiveSettablemethod that represents the active settable to toggle the visibility property of the selected layer(s).- See Also:
-
LAYER_EDITABLE_ACTIVE_SETTABLE
public static final int LAYER_EDITABLE_ACTIVE_SETTABLEThe ID for thecreateActiveSettablemethod that represents the active settable to toggle the editable property of the selected layer(s) on or off.- See Also:
-
LAYER_SELECTABLE_ACTIVE_SETTABLE_ENABLED_FILTER
public static final int LAYER_SELECTABLE_ACTIVE_SETTABLE_ENABLED_FILTERThe ID for thecreateEnabledActiveSettableFiltermethod that represents theILcdFilterto enable or disable the layer selectable active settable.- See Also:
-
LAYER_LABELED_ACTIVE_SETTABLE_ENABLED_FILTER
public static final int LAYER_LABELED_ACTIVE_SETTABLE_ENABLED_FILTERThe ID for thecreateEnabledActiveSettableFiltermethod that represents theILcdFilterto enable or disable the layer labeled active settable.- See Also:
-
LAYER_VISIBLE_ACTIVE_SETTABLE_ENABLED_FILTER
public static final int LAYER_VISIBLE_ACTIVE_SETTABLE_ENABLED_FILTERThe ID for thecreateEnabledActiveSettableFiltermethod that represents theILcdFilterto enable or disable the layer visible active settable.- See Also:
-
LAYER_EDITABLE_ACTIVE_SETTABLE_ENABLED_FILTER
public static final int LAYER_EDITABLE_ACTIVE_SETTABLE_ENABLED_FILTERThe ID for thecreateEnabledActiveSettableFiltermethod that represents theILcdFilterto enable or disable the layer editable active settable- See Also:
-
LAYER_PROPERTIES_ACTION_ENABLED_FILTER
public static final int LAYER_PROPERTIES_ACTION_ENABLED_FILTERThe ID for thecreateEnabledActionFiltermethod that represents theILcdFilterto enable or disable the layer properties action.- See Also:
-
FIT_TO_LAYER_ACTION_ENABLED_FILTER
public static final int FIT_TO_LAYER_ACTION_ENABLED_FILTERThe ID for thecreateEnabledActionFiltermethod that represents theILcdFilterto enable or disable the fit to layer action.- See Also:
-
DELETE_LAYER_ACTION_ENABLED_FILTER
public static final int DELETE_LAYER_ACTION_ENABLED_FILTERThe ID for thecreateEnabledActionFiltermethod that represents theILcdFilterto enable or disable the delete layer action.- See Also:
-
COPY_LAYER_REFERENCE_ACTION_ENABLED_FILTER
public static final int COPY_LAYER_REFERENCE_ACTION_ENABLED_FILTERThe ID for thecreateActionEnabledFiltermethod that represents theILcdFilterto enable or disable the copy layer reference action.- See Also:
-
SET_LAYER_TRANSPARENCY_ACTION_ENABLED_FILTER
public static final int SET_LAYER_TRANSPARENCY_ACTION_ENABLED_FILTERThe ID for thecreateActionEnabledFiltermethod that represents theILcdFilterfor the action to change the transparency of a layer.- Since:
- 2017.0
- See Also:
-
LAYER_TREE_COMPONENT
public static final int LAYER_TREE_COMPONENTThe ID for the
createComponentmethod that represents theComponentto show a hierarchical view on the layers of the view.The creation of this component is performed in parts, please refer to the constants that are prefixed with
LAYER_TREE_COMPONENTfor more information.- See Also:
-
ACTION_BAR
public static final int ACTION_BARThe ID for thecreateActionBarmethod that represents the regularILcyActionBar, by default the tool bar located at the top of the layer control panel.- See Also:
-
ORDER_ACTION_BAR
public static final int ORDER_ACTION_BARThe ID for thecreateActionBarmethod that represents the so called order bar, which contains by default the buttons to change the position of layers in the view, and which is located by default at the east of the layer control panel.- See Also:
-
TREE_MODEL
public static final int TREE_MODELThe ID for thecreateTreeModelmethod that represents the Swing tree model for the hierarchical layer view. This ID represents a part of theLAYER_TREE_COMPONENT.- See Also:
-
TREE_CELL_RENDERER
public static final int TREE_CELL_RENDERERThe ID for thecreateTreeCellRenderermethod that represents the Swing tree cell renderer for the hierarchical layer view. This ID represents a part of theLAYER_TREE_COMPONENT.- See Also:
-
TREE
public static final int TREEThe ID for thecreateTreemethod that represents the SwingJTreefor the hierarchical layer view. This ID represents a part of theLAYER_TREE_COMPONENT.- See Also:
-
NORTH_PANEL
public static final int NORTH_PANELThe ID for thecreatePanelmethod that represents the panel located at the north of the layer control.- See Also:
-
EAST_PANEL
public static final int EAST_PANELThe ID for thecreatePanelmethod that represents the panel located at the east of the layer control.- See Also:
-
SOUTH_PANEL
public static final int SOUTH_PANELThe ID for thecreatePanelmethod that represents the panel located at the south of the layer control.- See Also:
-
WEST_PANEL
public static final int WEST_PANELThe ID for thecreatePanelmethod that represents the panel located at the west of the layer control.- See Also:
-
CENTER_PANEL
public static final int CENTER_PANELThe ID for thecreatePanelmethod that represents the panel located at the center of the layer control.- See Also:
-
LAYER_CONTROL_TRANSFER_HANDLER
public static final int LAYER_CONTROL_TRANSFER_HANDLERThe ID for thecreateTransferHandler(int, com.luciad.lucy.util.properties.ALcyProperties)method that represents the transfer handler for the layer control.- See Also:
-
-
Constructor Details
-
TLcyLspMapLayerControlFactory
Creates a new layer control factory for the specified
ILcyLucyEnv.It will create all the default actions, active settables, ... of which the IDs can be found as static fields on this class.
- Parameters:
aLucyEnv- the Lucy backend.
-
-
Method Details
-
setup
This method overrides the default behavior of the
setupmethod. It will create all the components in a certain order. It will- create the empty map layer control using
createEmptyMapLayerControl(com.luciad.lucy.util.properties.ALcyProperties). - create the pop up menu using
createPopupMenu(com.luciad.lucy.util.properties.ALcyProperties). - create all the action bars using
createActionBar(int, com.luciad.lucy.util.properties.ALcyProperties)with all given action bar ids (seegetActionBarIDs()). - create all active settable enabled filters using
createActiveSettableEnabledFilter(int, com.luciad.lucy.util.properties.ALcyProperties)with all given active settable filter ids (seegetActiveSettableEnabledFilterIDs()). - create all action enabled filters using
createActionEnabledFilter(int, com.luciad.lucy.util.properties.ALcyProperties)with all given action filter ids (seegetActionEnabledFilterIDs()). - create all the tree models using
createTreeModel(int, com.luciad.lucy.util.properties.ALcyProperties)with all given tree model ids (seegetTreeModelIDs()). - create all the tree cell renderers using
createTreeCellRenderer(int, com.luciad.lucy.util.properties.ALcyProperties)with all given tree cell renderer ids (seegetTreeCellRendererIDs()). - create all the trees using
createTree(int, com.luciad.lucy.util.properties.ALcyProperties)with all given tree ids (seegetTreeIDs()). - create all actions, active settables, components and panels using
ALcyGUIFactory.setup(com.luciad.lucy.util.properties.ALcyProperties). - create all transfer handlers using
createTransferHandler(int, com.luciad.lucy.util.properties.ALcyProperties)with all given transfer handler ids (seegetTransferHandlerIDs()).
Note that because of this order, panels can be composed of components, and components can use the active settables and actions, ... . So the
createPanel(int, com.luciad.lucy.util.properties.ALcyProperties)method can useALcyGUIFactory.getComponent(int)to retrieve its sub components, and thecreateComponent(int, com.luciad.lucy.util.properties.ALcyProperties)method can useALcyGUIFactory.getAction(int)andALcyGUIFactory.getActiveSettable(int)to retrieve needed actions and active settables.- Overrides:
setupin classALcyGUIFactory<TLcyLspMapLayerControl>- Parameters:
aProperties- a properties object that can be used to tune the behavior of this factory.
- create the empty map layer control using
-
cleanup
Description copied from class:ALcyGUIFactoryPerforms cleanup operations, such as nullifying fields that are no longer needed.
Warning: Should not be overridden without calling the super function.
- Overrides:
cleanupin classALcyGUIFactory<TLcyLspMapLayerControl>- Parameters:
aProperties- a properties object that can be used to tune the behavior of this factory.
-
getActionContext
Description copied from class:ALcyGUIFactoryReturns the context of the action bars in which the action with the specified ID should be inserted.
All actions are inserted in the action bars by
TLcyActionBarUtil.insertInConfiguredActionBars(com.luciad.gui.ILcdAction, Object, com.luciad.lucy.gui.TLcyActionBarManager, com.luciad.lucy.util.properties.ALcyProperties). This method specifies the context for which the action with IDaActionIDis inserted.By default this method returns
null.- Overrides:
getActionContextin classALcyGUIFactory<TLcyLspMapLayerControl>- Parameters:
aActionID- the ID of the action.aProperties- The properties. Can be used to tune the behavior of this factory.- Returns:
- the context of the action with the specified ID
-
getActiveSettableContext
Description copied from class:ALcyGUIFactoryReturns the context of the action bars in which the active settable with the specified ID should be inserted.
All active settables are inserted in the action bars by
TLcyActionBarUtil#insertInConfiguredActionBars. This method specifies the context for which the active settable with IDaActiveSettableIDis inserted.By default this method returns
null.- Overrides:
getActiveSettableContextin classALcyGUIFactory<TLcyLspMapLayerControl>- Parameters:
aActiveSettableID- the ID of the active settableaProperties- The properties. Can be used to tune the behavior of this factory.- Returns:
- the context of the active settable with the specified ID.
-
createGUIContent
Description copied from class:ALcyGUIFactoryRetrieves all panels and lays them out in a
java.awt.Component. Therefore, this method usesALcyGUIFactory.getPanel(int)with all ID's that end inPANEL, and lays out those components in for example ajavax.swing.JPanel.This function should be overridden when the global layout of the panel needs to be changed, for example when the main panels need to be rearranged, or when a new panel needs to be added.
An example implementation could be:
public Component createGUIContent( ALcyProperties aProperties ) { JPanel content = new JPanel( new BorderLayout() ); Component somePanel = getPanel( SOME_PANEL ); if ( somePanel != null ) content.add( somePanel, BorderLayout.NORTH ); Component otherPanel = getPanel( OTHER_PANEL ); if ( otherPanel != null ) content.add( otherPanel, BorderLayout.CENTER ); return content; }- Specified by:
createGUIContentin classALcyGUIFactory<TLcyLspMapLayerControl>- Parameters:
aProperties- a properties object that can be used to tune the behavior of this factory.- Returns:
- the component containing all panels, layed out appropriately.
-
createEmptyMapLayerControl
Creates an empty layer control, without any content, buttons or panels.
- Parameters:
aProperties- a properties object that can be used to tune the behavior of this factory.- Returns:
- the new layer control. Must not be
null.
-
createPopupMenu
Creates an empty popup menu.
- Parameters:
aProperties- a properties object that can be used to tune the behavior of this factory.- Returns:
- the empty popup menu. By default this is not
null, but subclasses may choose to returnnullif they want to remove the popup menu from the layer control.
-
getPopupMenu
Returns the created
ILcyPopupMenu.Please refer to
setupto know when this method can be used.- Returns:
- the created
ILcyPopupMenu, ornull.
-
createActionBar
Creates an empty action bar.
- Parameters:
aActionBarID- The ID of the action bar. It is typically a constant ending inACTION_BARaProperties- a properties object that can be used to tune the behavior of this factory.- Returns:
- the empty action bar. By default this is not
null, but subclasses may choose to returnnullif they want to remove the specified action bar from the layer control.
-
getActionBar
Returns the
ILcyActionBarfor the given ID.Please refer to
setupto know when this method can be used.- Parameters:
aActionBarID- The id describing whichILcyActionBarto return. This is normally a constant that ends inACTION_BAR.- Returns:
- the
ILcyActionBarfor the given ID.
-
getActionBarIDs
Returns the list with all action bar IDs.
By default, this list only contains the IDs defined in this class. Adding and/or removing action bar IDs to/from this factory is achieved by altering this list.
Warning: do not alter the list when the factory is creating the GUI. Only modify it before or after the
ALcyGUIFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties)method.- Returns:
- a list with the action bar IDs
-
createActiveSettableEnabledFilter
protected ILcdFilter<ILspLayer> createActiveSettableEnabledFilter(int aFilterID, ALcyProperties aProperties) Creates an
ILcdFilterfor the corresponding active settable. 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
ILcdFilterthat is not null. It is good practice to combine this filter with your filter by using anALcyCompositeFilterto which you add your filter and the filter returned by this default implementation.Following example demonstrates how you could override this method:
protected ILcdFilter<ILspLayer> createActiveSettableEnabledFilter( int aFilterID, ALcyProperties aProperties ) { switch ( aFilterID ){ // create a filter that will disable the layer selectable button for specific layers. case LAYER_SELECTABLE_ACTIVE_SETTABLE_ENABLED_FILTER: TLcyCompositeAndFilter<ILspLayer> my_filter = new TLcyCompositeAndFilter<ILspLayer>(); // Make sure we use the filter created by the super implementation. // This filter will never benull. my_filter.addFilter( super.createActiveSettableEnabledFilter( aFilterID, aProperties ) ); // do not accept layers that have a model with a MyModelDescriptor as model descriptor. my_filter.addFilter( new ILcdFilter<ILspLayer>(){ public boolean accept( ILspLayer aLayer ){ return !( aLayer.getModel().getModelDescriptor() instanceof MyModelDescriptor ); } } ); return my_filter; default: return super.createActiveSettableEnabledFilter( aFilterID, aProperties ); } }- Parameters:
aFilterID- the ID indicating for which active settable the filter applies. It is typically an ID ending inACTIVE_SETTABLE_ENABLED_FILTER.aProperties- a properties object that can be used to tune the behavior of this factory.- Returns:
- an ILcdFilter that determines for which layers the corresponding active settable will be enabled in the user interface. The default implementation never returns null, but subclasses can and may return null;
-
getActiveSettableEnabledFilter
Returns the
ILcdFilterfor the given ID.Please refer to
setupto know when this method can be used.- Parameters:
aFilterID- the id describing whichILcdFilterto return. This is usually a constant that ends inACTIVE_SETTABLE_ENABLED_FILTER.- Returns:
- the
ILcdFilterfor the given ID.
-
getActiveSettableEnabledFilterIDs
Returns the list with all enabled active settable filter IDs.
By default, this list only contains the IDs defined in this class. Adding and/or removing enabled active settable filter IDs to/from this factory is achieved by altering this list.
Warning: do not alter the list when the factory is creating the GUI. Only modify it before or after the
ALcyGUIFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties)method.- Returns:
- a list with the enabled active settable filter IDs
-
createActionEnabledFilter
protected ILcdFilter<ILspLayer> createActionEnabledFilter(int aFilterID, ALcyProperties aProperties) Creates an
ILcdFilterfor the corresponding action. 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
ILcdFilterthat is not null. It is good practice to combine this filter with your filter by using anALcyCompositeFilterto which you add your filter and the filter returned by this default implementation.Following example demonstrates how you could override this method:
protected ILcdFilter<ILspLayer> createActionEnabledFilter( int aFilterID, ALcyProperties aProperties ) { switch ( aFilterID ){ // create a filter that will disable the fit action for specific layers. case FIT_TO_LAYER_ACTION_ENABLED_FILTER: TLcyCompositeAndFilter<ILspLayer> my_filter = new TLcyCompositeAndFilter<ILspLayer>(); // Make sure we use the filter created by the super implementation. // This filter will never benull. my_filter.addFilter( super.createActionEnabledFilter( aFilterID, aProperties ) ); // do not accept layers that have a model with a MyModelDescriptor as modeldescriptor. my_filter.addFilter( new ILcdFilter<ILspLayer>(){ public boolean accept( ILspLayer aLayer ){ return !( aLayer.getModel().getModelDescriptor() instanceof MyModelDescriptor ); } ); return my_filter; default: return super.createActionEnabledFilter( aFilterID, aProperties ); } }- Parameters:
aFilterID- the ID indicating for which action the filter applies. It is typically an ID ending inACTION_ENABLED_FILTER.aProperties- a properties object that can be used to tune the behavior of this factory.- 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;
-
getActionEnabledFilter
Returns the
ILcdFilterfor the given ID.Please refer to
setupto know when this method can be used.- Parameters:
aFilterID- the id describing whichILcdFilterto return. This is normally a constant that ends inACTION_ENABLED_FILTER.- Returns:
- the
ILcdFilterfor the given ID.
-
getActionEnabledFilterIDs
Returns the list with all enabled action filter IDs.
By default, this list only contains the IDs defined in this class. Adding and/or removing enabled action filter IDs to/from this factory is achieved by altering this list.
Warning: do not alter the list when the factory is creating the GUI. Only modify it before or after the
ALcyGUIFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties)method.- Returns:
- a list with the enabled action filter IDs
-
createTreeModel
Creates the tree model corresponding to the IDaTreeModelID. May returnnull.- Parameters:
aTreeModelID- the ID of the tree model. This is typically a constant ending inTREE_MODEL.aProperties- a properties object that can be used to tune the behavior of this factory.- Returns:
- the tree model corresponding to the ID
aTreeModelID. May benull.
-
getTreeModel
Returns the
TreeModelfor the given ID.Please refer to
setupto know when this method can be used.- Parameters:
aTreeModelID- the id describing whichTreeModelto return. This is usually a constant that ends inTREE_MODEL.- Returns:
- the
TreeModelfor the given ID.
-
getTreeModelIDs
Returns the list with all tree model IDs.
By default, this list only contains the IDs defined in this class. Adding and/or removing tree model IDs to/from this factory is achieved by altering this list.
Warning: do not alter the list when the factory is creating the GUI. Only modify it before or after the
ALcyGUIFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties)method.- Returns:
- a list with the tree model IDs
-
createTreeCellRenderer
protected TreeCellRenderer createTreeCellRenderer(int aTreeCellRendererID, ALcyProperties aProperties) Creates the tree cell renderer corresponding to the IDaTreeCellRendererID. May returnnull.- Parameters:
aTreeCellRendererID- the ID of the tree cell renderer. This is typically a constant ending inTREE_CELL_RENDERER.aProperties- a properties object that can be used to tune the behavior of this factory.- Returns:
- the tree cell renderer corresponding to the ID
aTreeCellRendererID. May benull.
-
getTreeCellRenderer
Returns the
TreeCellRendererfor the given ID.Please refer to
setupto know when this method can be used.- Parameters:
aTreeCellRendererID- the id describing whichTreeCellRendererto return. This is normally a constant that ends inTREE_CELL_RENDERER.- Returns:
- the
TreeCellRendererfor the given ID.
-
getTreeCellRendererIDs
Returns the list with all tree cell renderer IDs.
By default, this list only contains the IDs defined in this class. Adding and/or removing tree cell renderer IDs to/from this factory is achieved by altering this list.
Warning: do not alter the list when the factory is creating the GUI. Only modify it before or after the
ALcyGUIFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties)method.- Returns:
- a list with the tree cell renderer IDs
-
createTree
Creates the tree corresponding to the IDaTreeID. May returnnull.- Parameters:
aTreeID- the ID of the tree. This is typically a constant ending inTREE.aProperties- a properties object that can be used to tune the behavior of this factory.- Returns:
- the tree corresponding to the ID
aTreeID. May benull.
-
getTree
Returns the
JTreefor the given ID.Please refer to
setupto know when this method can be used.- Parameters:
aTreeID- the id describing whichJTreeto return. This is normally a constant that ends inTREE.- Returns:
- the
JTreefor the given ID.
-
getTreeIDs
Returns the list with all tree IDs.
By default, this list only contains the IDs defined in this class. Adding and/or removing tree IDs to/from this factory is achieved by altering this list.
Warning: do not alter the list when the factory is creating the GUI. Only modify it before or after the
ALcyGUIFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties)method.- Returns:
- a list with the tree IDs
-
createAction
Description copied from class:ALcyGUIFactoryCreates an
ILcdActionfor the given ID.Note: if the action should be inserted in the configured action bars, the ID_KEY of the returned action must be set (see
TLcyActionBarUtil.ID_KEY).- Specified by:
createActionin classALcyGUIFactory<TLcyLspMapLayerControl>- Parameters:
aActionID- the ID describing which action to create. This is normally a constant that ends withACTION.aProperties- a properties object that can be used to tune the behavior of this factory.- Returns:
- the newly created
ILcdAction, ornull. - See Also:
-
createActiveSettable
protected ILcyActiveSettable createActiveSettable(int aActiveSettableID, ALcyProperties aProperties) Description copied from class:ALcyGUIFactoryCreates an
ILcyActiveSettablefor the given ID.Note: if the active settable should be inserted in the configured action bars, the ID_KEY of the returned active settable must be set (see
TLcyActionBarUtil.ID_KEY).- Specified by:
createActiveSettablein classALcyGUIFactory<TLcyLspMapLayerControl>- Parameters:
aActiveSettableID- the ID describing which active settable to create. This is normally a constant that ends withACTIVE_SETTABLE.aProperties- a properties object that can be used to tune the behavior of this factory.- Returns:
- the newly created
ILcyActiveSettable, ornull.
-
createComponent
Description copied from class:ALcyGUIFactoryCreates a widget for the given ID. It is safe to use the
ALcyGUIFactory.getAction(int)andALcyGUIFactory.getActiveSettable(int)methods in this method, to build widgets that use an action or active settable.These widgets might interact with the given properties object, to retrieve or store some state. Such a widget could for example be a check box whose 'selected' state is synchronized with some property.
- Specified by:
createComponentin classALcyGUIFactory<TLcyLspMapLayerControl>- Parameters:
aComponentID- the ID describing which component to create. This is normally a constant that ends withCOMPONENT.aProperties- a properties object that can be used to tune the behavior of this factory. state.- Returns:
- the newly created
java.awt.Component, or null.
-
createPanel
Description copied from class:ALcyGUIFactoryCreates a panel for the given ID. It is safe to use
ALcyGUIFactory.getComponent(int)in this method, to build panels that are composed of components.An example implementation could be:
protected Component createPanel( int aPanelID, ALcyProperties aProperties ) { if ( aPanelID == SOME_PANEL ) { JPanel content = new JPanel( new BorderLayout() ); Component someComponent = getComponent( SOME_COMPONENT ); if ( someComponent != null ) content.add( someComponent, BorderLayout.NORTH ); Component otherComponent = getComponent( OTHER_COMPONENT ); if ( otherComponent != null ) content.add( otherComponent, BorderLayout.CENTER ); return content; } else if ( aPanelID == ... ) { ... } }- Specified by:
createPanelin classALcyGUIFactory<TLcyLspMapLayerControl>- Parameters:
aPanelID- the ID describing which panel to create. This is normally a constant that ends withPANEL.aProperties- a properties object that can be used to tune the behavior of this factory.- Returns:
- the newly created
java.awt.Component, or null.
-
createTransferHandler
Creates aTransferHandlerfor the given ID.- Parameters:
aTransferHandlerID- the ID describing which transfer handler to create. This is normally a constant that ends withTRANSFER_HANDLER.aProperties- a properties object that can be used to tune the behavior of this factory.- Returns:
- the newly created
TransferHandler, ornull.
-
getTransferHandler
Returns the
TransferHandlerfor the given ID.Please refer to
setup(com.luciad.lucy.util.properties.ALcyProperties)to know when this method can be used.- Parameters:
aTransferHandlerID- the id describing which transfer handler to return. This is normally a constant that ends inTRANSFER_HANDLER.- Returns:
- the
TransferHandlerfor the given ID.
-
getTransferHandlerIDs
Returns the list with all transfer handler IDs.
By default, this list only contains the IDs defined in this class. Adding and/or removing transfer handler IDs to/from this factory is achieved by altering this list.
Warning: do not alter the list when the factory is creating the GUI. Only modify it before or after the
ALcyGUIFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties)method.- Returns:
- a list with the transfer handler IDs
-
getMapLayerControl
Returns the map layer control under construction.
- Returns:
- the map layer control under construction. Must not be
null.
-
getMapComponent
Convenience method to retrieve the map component from
aProperties. The map component should be stored with keyMAP_COMPONENT_PROPERTY_NAME.An exception is thrown when the map component could not be retrieved from the properties.
- Parameters:
aProperties- the properties containing the map component.- Returns:
- the map component stored in the properties. Will not be
null.
-