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
Modifier and TypeFieldDescriptionstatic final int
The ID for thecreateActionBar
method that represents the regularILcyActionBar
, by default the tool bar located at the top of the layer control panel.static final int
The ID for thecreatePanel
method that represents the panel located at the center of the layer control.static final int
The ID for thecreateAction
method 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 int
The ID for thecreateActionEnabledFilter
method that represents theILcdFilter
to enable or disable the copy layer reference action.static final int
The ID for thecreateAction
method that represents the action to import layers from another map component.static final int
The ID for thecreateAction
method that represents the action to delete the selected layer(s).static final int
The ID for thecreateEnabledActionFilter
method that represents theILcdFilter
to enable or disable the delete layer action.static final int
The ID for thecreatePanel
method that represents the panel located at the east of the layer control.static final int
The ID for thecreateAction
method that represents the action to fit the map extents so that the selected layers are shown.static final int
The ID for thecreateEnabledActionFilter
method that represents theILcdFilter
to enable or disable the fit to layer action.static final int
The ID for thecreateTransferHandler(int, com.luciad.lucy.util.properties.ALcyProperties)
method that represents the transfer handler for the layer control.static final int
The ID for thecreateActiveSettable
method that represents the active settable to toggle the editable property of the selected layer(s) on or off.static final int
The ID for thecreateEnabledActiveSettableFilter
method that represents theILcdFilter
to enable or disable the layer editable active settablestatic final int
The ID for thecreateActiveSettable
method that represents the active settable to toggle the labeled property of the selected layer(s).static final int
The ID for thecreateEnabledActiveSettableFilter
method that represents theILcdFilter
to enable or disable the layer labeled active settable.static final int
The ID for thecreateAction
method that represents the action to show the layer properties of the selected layer(s).static final int
The ID for thecreateEnabledActionFilter
method that represents theILcdFilter
to enable or disable the layer properties action.static final int
The ID for thecreateActiveSettable
method that represents the active settable to toggle the selectable property of the selected layer(s).static final int
The ID for thecreateEnabledActiveSettableFilter
method that represents theILcdFilter
to enable or disable the layer selectable active settable.static final int
The ID for thecreateComponent
method that represents theComponent
to show a hierarchical view on the layers of the view.static final int
The ID for thecreateActiveSettable
method that represents the active settable to toggle the visibility property of the selected layer(s).static final int
The ID for thecreateEnabledActiveSettableFilter
method that represents theILcdFilter
to enable or disable the layer visible active settable.static final String
The name of the property, containing the map component.static final int
The ID for thecreateAction
method that represents the action to move layers to the bottom of the view.static final int
The ID for thecreateAction
method that represents the action to move layers one position towards the bottom of the view.static final int
The ID for thecreateAction
method that represents the action to move layers to the top of the view.static final int
The ID for thecreateAction
method that represents the action to move layers one position towards the top of the view.static final int
The ID for thecreatePanel
method that represents the panel located at the north of the layer control.static final int
The ID for thecreateActionBar
method 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 int
The ID for thecreateAction
method that represents the action to change the transparency of the layer.static final int
The ID for thecreateActionEnabledFilter
method that represents theILcdFilter
for the action to change the transparency of a layer.static final int
The ID for thecreatePanel
method that represents the panel located at the south of the layer control.static final int
The ID for thecreateTree
method that represents the SwingJTree
for the hierarchical layer view.static final int
The ID for thecreateTreeCellRenderer
method that represents the Swing tree cell renderer for the hierarchical layer view.static final int
The ID for thecreateTreeModel
method that represents the Swing tree model for the hierarchical layer view.static final int
The ID for thecreatePanel
method that represents the panel located at the west of the layer control. -
Constructor Summary
ConstructorDescriptionTLcyLspMapLayerControlFactory
(ILcyLucyEnv aLucyEnv) Creates a new layer control factory for the specifiedILcyLucyEnv
. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
cleanup
(ALcyProperties aProperties) Performs cleanup operations, such as nullifying fields that are no longer needed.protected ILcdAction
createAction
(int aActionID, ALcyProperties aProperties) Creates anILcdAction
for the given ID.protected ILcyActionBar
createActionBar
(int aActionBarID, ALcyProperties aProperties) Creates an empty action bar.protected ILcdFilter
<ILspLayer> createActionEnabledFilter
(int aFilterID, ALcyProperties aProperties) Creates anILcdFilter
for the corresponding action.protected ILcyActiveSettable
createActiveSettable
(int aActiveSettableID, ALcyProperties aProperties) Creates anILcyActiveSettable
for the given ID.protected ILcdFilter
<ILspLayer> createActiveSettableEnabledFilter
(int aFilterID, ALcyProperties aProperties) Creates anILcdFilter
for the corresponding active settable.protected Component
createComponent
(int aComponentID, ALcyProperties aProperties) Creates a widget for the given ID.protected TLcyLspMapLayerControl
createEmptyMapLayerControl
(ALcyProperties aProperties) Creates an empty layer control, without any content, buttons or panels.protected TLcyLspMapLayerControl
createGUIContent
(ALcyProperties aProperties) Retrieves all panels and lays them out in ajava.awt.Component
.protected Component
createPanel
(int aPanelID, ALcyProperties aProperties) Creates a panel for the given ID.protected ILcyPopupMenu
createPopupMenu
(ALcyProperties aProperties) Creates an empty popup menu.protected TransferHandler
createTransferHandler
(int aTransferHandlerID, ALcyProperties aProperties) Creates aTransferHandler
for the given ID.protected JTree
createTree
(int aTreeID, ALcyProperties aProperties) Creates the tree corresponding to the IDaTreeID
.protected TreeCellRenderer
createTreeCellRenderer
(int aTreeCellRendererID, ALcyProperties aProperties) Creates the tree cell renderer corresponding to the IDaTreeCellRendererID
.protected TreeModel
createTreeModel
(int aTreeModelID, ALcyProperties aProperties) Creates the tree model corresponding to the IDaTreeModelID
.protected ILcyActionBar
getActionBar
(int aActionBarID) Returns theILcyActionBar
for the given ID.protected ILcdIntList
Returns the list with all action bar IDs.protected Object
getActionContext
(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 theILcdFilter
for the given ID.protected ILcdIntList
Returns the list with all enabled action filter IDs.protected Object
getActiveSettableContext
(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 theILcdFilter
for the given ID.protected ILcdIntList
Returns the list with all enabled active settable filter IDs.protected ILcyLspMapComponent
getMapComponent
(ALcyProperties aProperties) Convenience method to retrieve the map component fromaProperties
.protected TLcyLspMapLayerControl
Returns the map layer control under construction.protected ILcyPopupMenu
Returns the createdILcyPopupMenu
.protected TransferHandler
getTransferHandler
(int aTransferHandlerID) Returns theTransferHandler
for the given ID.protected ILcdIntList
Returns the list with all transfer handler IDs.protected JTree
getTree
(int aTreeID) Returns theJTree
for the given ID.protected TreeCellRenderer
getTreeCellRenderer
(int aTreeCellRendererID) Returns theTreeCellRenderer
for the given ID.protected ILcdIntList
Returns the list with all tree cell renderer IDs.protected ILcdIntList
Returns the list with all tree IDs.protected TreeModel
getTreeModel
(int aTreeModelID) Returns theTreeModel
for the given ID.protected ILcdIntList
Returns the list with all tree model IDs.protected void
setup
(ALcyProperties aProperties) This method overrides the default behavior of thesetup
method.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. TheTLcyLspMapComponentFactory
will 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 thecreateAction
method 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 thecreateAction
method that represents the action to show the layer properties of the selected layer(s). It does so using theILcyCustomizerPanelFactory
s available in theTLcyUserInterfaceManager
for an object of typeTLcyLayerContext
.- See Also:
-
DELETE_LAYER_ACTION
public static final int DELETE_LAYER_ACTIONThe ID for thecreateAction
method 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 thecreateAction
method 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 thecreateAction
method 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 thecreateAction
method 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 thecreateAction
method 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
createAction
method 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 thecreateAction
method 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 thecreateAction
method 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 thecreateActiveSettable
method 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 thecreateActiveSettable
method 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 thecreateActiveSettable
method 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 thecreateActiveSettable
method 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 thecreateEnabledActiveSettableFilter
method that represents theILcdFilter
to 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 thecreateEnabledActiveSettableFilter
method that represents theILcdFilter
to 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 thecreateEnabledActiveSettableFilter
method that represents theILcdFilter
to 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 thecreateEnabledActiveSettableFilter
method that represents theILcdFilter
to 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 thecreateEnabledActionFilter
method that represents theILcdFilter
to 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 thecreateEnabledActionFilter
method that represents theILcdFilter
to 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 thecreateEnabledActionFilter
method that represents theILcdFilter
to 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 thecreateActionEnabledFilter
method that represents theILcdFilter
to 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 thecreateActionEnabledFilter
method that represents theILcdFilter
for 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
createComponent
method that represents theComponent
to 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_COMPONENT
for more information.- See Also:
-
ACTION_BAR
public static final int ACTION_BARThe ID for thecreateActionBar
method 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 thecreateActionBar
method 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 thecreateTreeModel
method 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 thecreateTreeCellRenderer
method 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 thecreateTree
method that represents the SwingJTree
for 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 thecreatePanel
method that represents the panel located at the north of the layer control.- See Also:
-
EAST_PANEL
public static final int EAST_PANELThe ID for thecreatePanel
method that represents the panel located at the east of the layer control.- See Also:
-
SOUTH_PANEL
public static final int SOUTH_PANELThe ID for thecreatePanel
method that represents the panel located at the south of the layer control.- See Also:
-
WEST_PANEL
public static final int WEST_PANELThe ID for thecreatePanel
method that represents the panel located at the west of the layer control.- See Also:
-
CENTER_PANEL
public static final int CENTER_PANELThe ID for thecreatePanel
method 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
setup
method. 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:
setup
in 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:ALcyGUIFactory
Performs cleanup operations, such as nullifying fields that are no longer needed.
Warning: Should not be overridden without calling the super function.
- Overrides:
cleanup
in classALcyGUIFactory<TLcyLspMapLayerControl>
- Parameters:
aProperties
- a properties object that can be used to tune the behavior of this factory.
-
getActionContext
Description copied from class:ALcyGUIFactory
Returns 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 IDaActionID
is inserted.By default this method returns
null
.- Overrides:
getActionContext
in 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:ALcyGUIFactory
Returns 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 IDaActiveSettableID
is inserted.By default this method returns
null
.- Overrides:
getActiveSettableContext
in 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:ALcyGUIFactory
Retrieves 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:
createGUIContent
in 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 returnnull
if they want to remove the popup menu from the layer control.
-
getPopupMenu
Returns the created
ILcyPopupMenu
.Please refer to
setup
to 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_BAR
aProperties
- 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 returnnull
if they want to remove the specified action bar from the layer control.
-
getActionBar
Returns the
ILcyActionBar
for the given ID.Please refer to
setup
to know when this method can be used.- Parameters:
aActionBarID
- The id describing whichILcyActionBar
to return. This is normally a constant that ends inACTION_BAR
.- Returns:
- the
ILcyActionBar
for 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
ILcdFilter
for 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
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 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 be
null
. 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
ILcdFilter
for the given ID.Please refer to
setup
to know when this method can be used.- Parameters:
aFilterID
- the id describing whichILcdFilter
to return. This is usually a constant that ends inACTIVE_SETTABLE_ENABLED_FILTER
.- Returns:
- the
ILcdFilter
for 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
ILcdFilter
for 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
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 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 be
null
. 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
ILcdFilter
for the given ID.Please refer to
setup
to know when this method can be used.- Parameters:
aFilterID
- the id describing whichILcdFilter
to return. This is normally a constant that ends inACTION_ENABLED_FILTER
.- Returns:
- the
ILcdFilter
for 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
TreeModel
for the given ID.Please refer to
setup
to know when this method can be used.- Parameters:
aTreeModelID
- the id describing whichTreeModel
to return. This is usually a constant that ends inTREE_MODEL
.- Returns:
- the
TreeModel
for 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
TreeCellRenderer
for the given ID.Please refer to
setup
to know when this method can be used.- Parameters:
aTreeCellRendererID
- the id describing whichTreeCellRenderer
to return. This is normally a constant that ends inTREE_CELL_RENDERER
.- Returns:
- the
TreeCellRenderer
for 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
JTree
for the given ID.Please refer to
setup
to know when this method can be used.- Parameters:
aTreeID
- the id describing whichJTree
to return. This is normally a constant that ends inTREE
.- Returns:
- the
JTree
for 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:ALcyGUIFactory
Creates an
ILcdAction
for 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:
createAction
in 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:ALcyGUIFactory
Creates an
ILcyActiveSettable
for 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:
createActiveSettable
in 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:ALcyGUIFactory
Creates 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:
createComponent
in 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:ALcyGUIFactory
Creates 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:
createPanel
in 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 aTransferHandler
for 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
TransferHandler
for 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
TransferHandler
for 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
.
-