public class TLcyMapLayerControlFactory extends Object implements ILcyMapLayerControlFactory
Factory to create a TLcyMapLayerControl
for a given TLcyMapComponent
.
It cannot create a layer control for other ILcyMapComponent
implementations.
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.
This list of layers can be displayed as a linear list, where every layer in the user interface maps one on one with ILcdGXYView.layers()
.
This linear list is created by createComponent(int, TLcyMapLayerControl)
with ID LAYER_LIST_COMPONENT
.
The list of layers can also be displayed as a layer tree.
In this case, every ILcdGXYLayerList
that was added using ILcyMapComponent.insertGXYLayer(com.luciad.view.gxy.ILcdGXYLayer)
is displayed as a tree node,
which can recursively be expanded, modeling the structure of the added ILcdGXYLayerList
s.
The layers that were never added using the insertGXYLayer
method, but that are part of ILcdGXYView.layers()
are put at the top level of the tree.
This factory is typically used during the creation of a ILcyMapComponent
.
E.g. this factory can be set to a TLcyMapComponentFactory
using TLcyMapComponentFactory.setMapLayerControlFactory(ILcyMapLayerControlFactory)
.
Modifier and Type | Field and Description |
---|---|
static int |
ACTION_BAR
The ID for the
createActionBar
method that represents the regular ILcyActionBar , by default the tool bar located
at the top of the layer control panel. |
static int |
COPY_LAYER_REFERENCE_ACTION
The ID for the
createAction 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 int |
COPY_LAYER_REFERENCE_ACTION_ENABLED_FILTER
The ID for the
createEnabledFilter
method that represents the ILcdFilter to enable or disable the copy layer reference
action. |
static int |
DELETE_COMPONENT
The ID for the
createComponent
method that represents the Component to delete the selected layers. |
static int |
DELETE_LAYER_ACTION
The ID for the
createAction method that
represents the action to delete the selected layer(s). |
static int |
DELETE_LAYER_ACTION_ENABLED_FILTER
The ID for the
createEnabledFilter
method that represents the ILcdFilter to enable or disable the delete layer
action. |
static int |
FIT_TO_LAYER_ACTION
The ID for the
createAction method that
represents the action to fit the map extents so that the selected layers are shown. |
static int |
FIT_TO_LAYER_ACTION_ENABLED_FILTER
The ID for the
createEnabledFilter
method that represents the ILcdFilter to enable or disable the fit to layer
action. |
static String |
HELP_ID
The help id for the component representing a layer control.
|
static int |
LAYER_EDITABLE_ACTIVE_SETTABLE
The ID for the
createActiveSettable
method that represents the active settable to toggle the editable property of the selected
layer(s). |
static int |
LAYER_EDITABLE_ACTIVE_SETTABLE_ENABLED_FILTER
The ID for the
createEnabledFilter
method that represents the ILcdFilter to enable or disable the layer editable
active settable. |
static int |
LAYER_LABEL_DECONFLICTION_ACTIVE_SETTABLE
The ID for the
createActiveSettable
method that represents the active settable to toggle the label deconfliction property of the
selected layer(s). |
static int |
LAYER_LABEL_DECONFLICTION_ACTIVE_SETTABLE_ENABLED_FILTER
The ID for the
createEnabledFilter
method that represents the ILcdFilter to enable or disable the layer label
decluttering active settable. |
static int |
LAYER_LABELED_ACTIVE_SETTABLE
The ID for the
createActiveSettable
method that represents the active settable to toggle the labeled property of the selected
layer(s). |
static int |
LAYER_LABELED_ACTIVE_SETTABLE_ENABLED_FILTER
The ID for the
createEnabledFilter
method that represents the ILcdFilter to enable or disable the layer labeled
active settable. |
static int |
LAYER_LIST_COMPONENT
The ID for the
createComponent
method that represents the Component to show a flat view on the layers of
the view, as they are retrieved using the ILcdLayered interface. |
static int |
LAYER_LIST_COMPONENT__TREE
The ID for the
createTree
method that represents the Swing JTree for the flat layer view. |
static int |
LAYER_LIST_COMPONENT__TREE_CELL_RENDERER
The ID for the
createTreeCellRenderer
method that represents the Swing tree cell renderer for the flat layer view. |
static int |
LAYER_LIST_COMPONENT__TREE_MODEL
The ID for the
createTreeModel
method that represents the Swing tree model for the flat layer view. |
static int |
LAYER_PROPERTIES_ACTION
The ID for the
createAction method that
represents the action to show the layer properties of the selected layer(s). |
static int |
LAYER_PROPERTIES_ACTION_ENABLED_FILTER
The ID for the
createEnabledFilter
method that represents the ILcdFilter to enable or disable the layer properties
action. |
static TLcyGroupDescriptor |
LAYER_PROPERTIES_GROUP_DESCRIPTOR
Not used.
|
static int |
LAYER_SELECTABLE_ACTIVE_SETTABLE
The ID for the
createActiveSettable
method that represents the active settable to toggle the selectable property of the selected
layer(s). |
static int |
LAYER_SELECTABLE_ACTIVE_SETTABLE_ENABLED_FILTER
The ID for the
createEnabledFilter
method that represents the ILcdFilter to enable or disable the layer selectable
active settable. |
static int |
LAYER_SNAPPABLE_ACTIVE_SETTABLE
The ID for the
createActiveSettable
method that represents the active settable to toggle the snappable property of the selected
layer(s). |
static int |
LAYER_SNAPPABLE_ACTIVE_SETTABLE_ENABLED_FILTER
The ID for the
createEnabledFilter
method that represents the ILcdFilter to enable or disable the layer snappable
active settable. |
static int |
LAYER_TREE_COMPONENT
The ID for the
createComponent
method that represents the Component to show a hierarchical view on the layers of
the view. |
static int |
LAYER_TREE_COMPONENT__TREE
The ID for the
createTree
method that represents the Swing JTree for the hierarchical layer view. |
static int |
LAYER_TREE_COMPONENT__TREE_CELL_RENDERER
The ID for the
createTreeCellRenderer
method that represents the Swing tree cell renderer for the hierarchical layer view. |
static int |
LAYER_TREE_COMPONENT__TREE_MODEL
The ID for the
createTreeModel
method that represents the Swing tree model for the hierarchical layer view. |
static int |
LAYER_VISIBLE_ACTIVE_SETTABLE
The ID for the
createActiveSettable
method that represents the active settable to toggle the visible property of the selected
layer(s). |
static int |
LAYER_VISIBLE_ACTIVE_SETTABLE_ENABLED_FILTER
The ID for the
createEnabledFilter
method that represents the ILcdFilter to enable or disable the layer visible
active settable. |
static TLcyGroupDescriptor |
MODIFY_VIEW_GROUP_DESCRIPTOR
Not used.
|
static int |
MOVE_LAYER_BOTTOM_ACTION
The ID for the
createAction method that
represents the action to move the selected layers to the bottom. |
static int |
MOVE_LAYER_DOWN_ACTION
The ID for the
createAction method that
represents the action to move the selected layers down. |
static TLcyGroupDescriptor |
MOVE_LAYER_GROUP_DESCRIPTOR
Not used.
|
static int |
MOVE_LAYER_TOP_ACTION
The ID for the
createAction method that
represents the action to move the selected layers to the top. |
static int |
MOVE_LAYER_UP_ACTION
The ID for the
createAction method that
represents the action to move the selected layers up. |
static int |
ORDER_ACTION_BAR
The ID for the
createActionBar
method that represents the order ILcyActionBar , by default the tool bar located
at the right side of the layer control panel. |
static int |
POPUP_ACTION_BAR
The ID for the
createActionBar
method that represents the popup ILcyActionBar , by default the right click menu
of the layer control panel. |
static int |
SCALE_TO_RASTER_ACTION
The ID for the
createAction method that
represents the action to adjust the map scale so that it matches with the raster data of the
selected layer. |
static int |
SCALE_TO_RASTER_ACTION_ENABLED_FILTER
The ID for the
createEnabledFilter
method that represents the ILcdFilter to enable or disable the scale to raster
action. |
static int |
TOGGLE_TREE_ACTIVE_SETTABLE
The ID for the
createActiveSettable
method that represents the active settable to toggle the layer view between the hierarchical
structure (see LAYER_TREE_COMPONENT ) and the flat list (see
LAYER_LIST_COMPONENT ). |
Constructor and Description |
---|
TLcyMapLayerControlFactory()
Creates a new layer control factory.
|
TLcyMapLayerControlFactory(ILcyLucyEnv aLucyEnv)
Creates a new layer control factory with the given
ILcyLucyEnv . |
TLcyMapLayerControlFactory(ILcyLucyEnv aLucyEnv,
String aConfigSourceName)
Creates a new layer control factory with the given
ILcyLucyEnv and the properties
of the config file aConfigSourceName . |
Modifier and Type | Method and Description |
---|---|
protected ILcdAction |
createAction(int aID,
TLcyMapLayerControl aLayerControl)
Creates an action.
|
protected ILcyActionBar |
createActionBar(int aID,
TLcyMapLayerControl aLayerControl)
Creates an empty action bar.
|
protected ILcyActionBar |
createActionBar(TLcyMapLayerControl aLayerControl)
Creates an empty action bar.
|
protected ILcyActiveSettable |
createActiveSettable(int aID,
TLcyMapLayerControl aLayerControl)
Creates an active settable.
|
protected void |
createAndSetLayout(TLcyMapLayerControl aLayerControlSFCT)
Creates and sets the layout to the given layer control.
|
protected Component |
createComponent(int aID,
TLcyMapLayerControl aLayerControl)
Creates a component.
|
protected TLcyMapLayerControl |
createEmptyMapLayerControl(TLcyMapComponent aMapComponent)
Creates an empty layer control, without any content, buttons or panels.
|
protected ILcdFilter<ILcdGXYLayer> |
createEnabledFilter(int aID,
ILcyMapLayerControl aLayerControl)
Creates an
ILcdFilter for the corresponding actions and active settables. |
ILcyMapLayerControl |
createMapLayerControl(ILcyMapComponent aMapComponent)
Creates a new
TLcyMapLayerControl for the given map
component. |
protected ILcyPopupMenu |
createPopupMenu(int aID,
TLcyMapLayerControl aLayerControl)
Creates an empty popup menu.
|
protected JTree |
createTree(int aID,
TLcyMapLayerControl aMapLayerControl)
Creates a
JTree which will be used in the map layer control. |
protected TreeCellRenderer |
createTreeCellRenderer(int aID,
TLcyMapLayerControl aMapLayerControl)
Creates the
TreeCellRenderer used by the JTree of the map layer
control |
protected TreeModel |
createTreeModel(int aID,
TLcyMapLayerControl aMapLayerControl)
Creates the
TreeModel used by the JTree of the map layer control |
protected void |
finalizeCreation(TLcyMapLayerControl aLayerControl)
Method called to finalize the creation process.
|
String |
getConfigSourceName()
Returns the configuration source name.
|
ILcyLucyEnv |
getLucyEnv()
Returns the associated lucy environment.
|
protected void |
insertAction(int aID,
ILcdAction aAction,
TLcyMapLayerControl aLayerControlSFCT)
Inserts the given action into the action bar, order bar and popup menu of the given layer
control.
|
protected void |
insertActionBar(ILcyActionBar aActionBar,
TLcyMapLayerControl aLayerControlSFCT)
Insert the given action bar into the given layer control.
|
protected void |
insertActionBar(int aID,
ILcyActionBar aActionBar,
TLcyMapLayerControl aLayerControlSFCT)
Inserts the given action bar into the given layer control.
|
protected void |
insertActionInActionBar(int aID,
ILcdAction aAction,
TLcyMapLayerControl aLayerControlSFCT)
Inserts the given action into the regular action bar of the given layer control.
|
protected void |
insertActionInOrderBar(int aID,
ILcdAction aAction,
TLcyMapLayerControl aLayerControlSFCT)
Inserts the given action into the order action bar of the given layer control.
|
protected void |
insertActionInPopupMenu(int aID,
ILcdAction aAction,
TLcyMapLayerControl aLayerControlSFCT)
Inserts the given action into the popup menu of the given layer control.
|
protected void |
insertActiveSettable(int aID,
ILcyActiveSettable aActiveSettable,
TLcyMapLayerControl aLayerControlSFCT)
Inserts the given active settable into the action bar, order bar and popup menu of the given
layer control.
|
protected void |
insertActiveSettableInActionBar(int aID,
ILcyActiveSettable aActiveSettable,
TLcyMapLayerControl aLayerControlSFCT)
Inserts the given active settable into the regular action bar of the given layer control.
|
protected void |
insertActiveSettableInOrderBar(int aID,
ILcyActiveSettable aActiveSettable,
TLcyMapLayerControl aLayerControlSFCT)
Inserts the given active settable into the order action bar of the given layer control.
|
protected void |
insertActiveSettableInPopupMenu(int aID,
ILcyActiveSettable aActiveSettable,
TLcyMapLayerControl aLayerControlSFCT)
Inserts the given active settable into the popup menu of the given layer control.
|
protected void |
insertComponent(int aID,
Component aComponent,
TLcyMapLayerControl aLayerControlSFCT)
Inserts the given component into the given layer control.
|
protected void |
insertComponentInActionBar(int aID,
Component aComponent,
TLcyMapLayerControl aMapLayerControl)
Inserts the given component in the regular action bar (see
TLcyMapLayerControl.getActionBar() ) of the given map layer control. |
protected void |
insertComponentInOrderBar(int aID,
Component aComponent,
TLcyMapLayerControl aMapLayerControl)
Inserts the given component in the order action bar (see
TLcyMapLayerControl.getOrderActionBar() ) of the given map layer control. |
void |
setConfigSourceName(String aConfigSourceName)
Sets the configuration source name.
|
void |
setLucyEnv(ILcyLucyEnv aLucyEnv)
Sets the lucy environment.
|
public static final String HELP_ID
public static final TLcyGroupDescriptor MOVE_LAYER_GROUP_DESCRIPTOR
public static final TLcyGroupDescriptor LAYER_PROPERTIES_GROUP_DESCRIPTOR
public static final TLcyGroupDescriptor MODIFY_VIEW_GROUP_DESCRIPTOR
public static final int MOVE_LAYER_UP_ACTION
createAction
method that
represents the action to move the selected layers up.public static final int MOVE_LAYER_DOWN_ACTION
createAction
method that
represents the action to move the selected layers down.public static final int MOVE_LAYER_TOP_ACTION
createAction
method that
represents the action to move the selected layers to the top.public static final int MOVE_LAYER_BOTTOM_ACTION
createAction
method that
represents the action to move the selected layers to the bottom.public static final int FIT_TO_LAYER_ACTION
createAction
method that
represents the action to fit the map extents so that the selected layers are shown.TLcdGXYViewFitAction
,
Constant Field Valuespublic static final int COPY_LAYER_REFERENCE_ACTION
createAction
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).public static final int SCALE_TO_RASTER_ACTION
createAction
method that
represents the action to adjust the map scale so that it matches with the raster data of the
selected layer. As a result, one pixel on screen approximately matches with one pixel of the
raster data. If invoked after COPY_LAYER_REFERENCE_ACTION
, one pixel on screen
matches exactly with one pixel of the raster data.public static final int LAYER_PROPERTIES_ACTION
createAction
method that
represents the action to show the layer properties of the selected layer(s). It does so
using the ILcyCustomizerPanelFactory
s available in the
TLcyUserInterfaceManager
for an object of type TLcyLayerContext
.public static final int DELETE_LAYER_ACTION
createAction
method that
represents the action to delete the selected layer(s).public static final int LAYER_VISIBLE_ACTIVE_SETTABLE
createActiveSettable
method that represents the active settable to toggle the visible property of the selected
layer(s).public static final int LAYER_SELECTABLE_ACTIVE_SETTABLE
createActiveSettable
method that represents the active settable to toggle the selectable property of the selected
layer(s).public static final int LAYER_EDITABLE_ACTIVE_SETTABLE
createActiveSettable
method that represents the active settable to toggle the editable property of the selected
layer(s).public static final int LAYER_LABELED_ACTIVE_SETTABLE
createActiveSettable
method that represents the active settable to toggle the labeled property of the selected
layer(s).public static final int LAYER_LABEL_DECONFLICTION_ACTIVE_SETTABLE
createActiveSettable
method that represents the active settable to toggle the label deconfliction property of the
selected layer(s).public static final int LAYER_SNAPPABLE_ACTIVE_SETTABLE
createActiveSettable
method that represents the active settable to toggle the snappable property of the selected
layer(s).public static final int TOGGLE_TREE_ACTIVE_SETTABLE
createActiveSettable
method that represents the active settable to toggle the layer view between the hierarchical
structure (see LAYER_TREE_COMPONENT
) and the flat list (see
LAYER_LIST_COMPONENT
).public static final int DELETE_LAYER_ACTION_ENABLED_FILTER
createEnabledFilter
method that represents the ILcdFilter
to enable or disable the delete layer
action.DELETE_LAYER_ACTION
,
Constant Field Valuespublic static final int LAYER_VISIBLE_ACTIVE_SETTABLE_ENABLED_FILTER
createEnabledFilter
method that represents the ILcdFilter
to enable or disable the layer visible
active settable.public static final int LAYER_SELECTABLE_ACTIVE_SETTABLE_ENABLED_FILTER
createEnabledFilter
method that represents the ILcdFilter
to enable or disable the layer selectable
active settable.public static final int LAYER_EDITABLE_ACTIVE_SETTABLE_ENABLED_FILTER
createEnabledFilter
method that represents the ILcdFilter
to enable or disable the layer editable
active settable.public static final int LAYER_LABELED_ACTIVE_SETTABLE_ENABLED_FILTER
createEnabledFilter
method that represents the ILcdFilter
to enable or disable the layer labeled
active settable.public static final int LAYER_LABEL_DECONFLICTION_ACTIVE_SETTABLE_ENABLED_FILTER
createEnabledFilter
method that represents the ILcdFilter
to enable or disable the layer label
decluttering active settable.public static final int LAYER_SNAPPABLE_ACTIVE_SETTABLE_ENABLED_FILTER
createEnabledFilter
method that represents the ILcdFilter
to enable or disable the layer snappable
active settable.public static final int LAYER_PROPERTIES_ACTION_ENABLED_FILTER
createEnabledFilter
method that represents the ILcdFilter
to enable or disable the layer properties
action.LAYER_PROPERTIES_ACTION
,
Constant Field Valuespublic static final int FIT_TO_LAYER_ACTION_ENABLED_FILTER
createEnabledFilter
method that represents the ILcdFilter
to enable or disable the fit to layer
action.FIT_TO_LAYER_ACTION
,
Constant Field Valuespublic static final int COPY_LAYER_REFERENCE_ACTION_ENABLED_FILTER
createEnabledFilter
method that represents the ILcdFilter
to enable or disable the copy layer reference
action.COPY_LAYER_REFERENCE_ACTION
,
Constant Field Valuespublic static final int SCALE_TO_RASTER_ACTION_ENABLED_FILTER
createEnabledFilter
method that represents the ILcdFilter
to enable or disable the scale to raster
action.SCALE_TO_RASTER_ACTION
,
Constant Field Valuespublic static final int DELETE_COMPONENT
createComponent
method that represents the Component
to delete the selected layers.
It is different from the DELETE_LAYER_ACTION
in that it is a button itself.
By default, this component is configured not to be inserted in the UI.DELETE_LAYER_ACTION
,
Constant Field Valuespublic static final int LAYER_LIST_COMPONENT
The ID for the createComponent
method that represents the Component
to show a flat view on the layers of
the view, as they are retrieved using the ILcdLayered
interface.
The creation of this component is performed in parts, please refer to the constants
that are prefixed with LAYER_LIST_COMPONENT
for more information.
public static final int LAYER_TREE_COMPONENT
The ID for the createComponent
method that represents the Component
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.
public static final int ACTION_BAR
createActionBar
method that represents the regular ILcyActionBar
, by default the tool bar located
at the top of the layer control panel.public static final int ORDER_ACTION_BAR
createActionBar
method that represents the order ILcyActionBar
, by default the tool bar located
at the right side of the layer control panel.public static final int POPUP_ACTION_BAR
createActionBar
method that represents the popup ILcyActionBar
, by default the right click menu
of the layer control panel.public static final int LAYER_TREE_COMPONENT__TREE_MODEL
createTreeModel
method that represents the Swing tree model for the hierarchical layer view. This
ID represents a part of the LAYER_TREE_COMPONENT
.public static final int LAYER_LIST_COMPONENT__TREE_MODEL
createTreeModel
method that represents the Swing tree model for the flat layer view. This
ID represents a part of the LAYER_LIST_COMPONENT
.public static final int LAYER_TREE_COMPONENT__TREE_CELL_RENDERER
createTreeCellRenderer
method that represents the Swing tree cell renderer for the hierarchical layer view. This
ID represents a part of the LAYER_TREE_COMPONENT
.public static final int LAYER_LIST_COMPONENT__TREE_CELL_RENDERER
createTreeCellRenderer
method that represents the Swing tree cell renderer for the flat layer view. This
ID represents a part of the LAYER_LIST_COMPONENT
.public static final int LAYER_TREE_COMPONENT__TREE
createTree
method that represents the Swing JTree
for the hierarchical layer view. This
ID represents a part of the LAYER_TREE_COMPONENT
.public static final int LAYER_LIST_COMPONENT__TREE
createTree
method that represents the Swing JTree
for the flat layer view. This
ID represents a part of the LAYER_LIST_COMPONENT
.public TLcyMapLayerControlFactory()
ILcyLucyEnv
before
using this object.public TLcyMapLayerControlFactory(ILcyLucyEnv aLucyEnv)
ILcyLucyEnv
.aLucyEnv
- The lucy environment.public TLcyMapLayerControlFactory(ILcyLucyEnv aLucyEnv, String aConfigSourceName)
ILcyLucyEnv
and the properties
of the config file aConfigSourceName
.aLucyEnv
- The lucy environment.aConfigSourceName
- The source name (e.g., file name) of the configuration file.
See setConfigSourceName(String)
.public ILcyLucyEnv getLucyEnv()
ILcyMapLayerControlFactory
getLucyEnv
in interface ILcyMapLayerControlFactory
public void setLucyEnv(ILcyLucyEnv aLucyEnv)
ILcyMapLayerControlFactory
setLucyEnv
in interface ILcyMapLayerControlFactory
aLucyEnv
- The lucy environment.ILcyMapLayerControlFactory.getLucyEnv()
public String getConfigSourceName()
ILcyMapLayerControlFactory
getConfigSourceName
in interface ILcyMapLayerControlFactory
ILcyMapLayerControlFactory.setConfigSourceName(java.lang.String)
public void setConfigSourceName(String aConfigSourceName)
ILcyMapLayerControlFactory
setConfigSourceName
in interface ILcyMapLayerControlFactory
aConfigSourceName
- The source name (e.g. file name) of the configuration file.ILcyMapLayerControlFactory.getConfigSourceName()
public ILcyMapLayerControl createMapLayerControl(ILcyMapComponent aMapComponent)
TLcyMapLayerControl
for the given map
component. The given map component must be an instance of
TLcyMapComponent
.createMapLayerControl
in interface ILcyMapLayerControlFactory
aMapComponent
- The TLcyMapComponent
to create a layer control for.protected TLcyMapLayerControl createEmptyMapLayerControl(TLcyMapComponent aMapComponent)
aMapComponent
- The map component to create the layer control for.protected void createAndSetLayout(TLcyMapLayerControl aLayerControlSFCT)
aLayerControlSFCT
- The layer control to set the layer to.protected void finalizeCreation(TLcyMapLayerControl aLayerControl)
aLayerControl
- The map component under construction.protected ILcdAction createAction(int aID, TLcyMapLayerControl aLayerControl)
aID
- An id defined in this class ending in ACTION.aLayerControl
- The layer control to create the action for.protected ILcyActiveSettable createActiveSettable(int aID, TLcyMapLayerControl aLayerControl)
aID
- An id defined in this class ending in ACTIVE_SETTABLE.aLayerControl
- The layer control to create the active settable for.protected Component createComponent(int aID, TLcyMapLayerControl aLayerControl)
aID
- An id defined in this class ending in COMPONENT.aLayerControl
- The layer control to create the active settable for.protected JTree createTree(int aID, TLcyMapLayerControl aMapLayerControl)
JTree
which will be used in the map layer control.aID
- must be LAYER_TREE_COMPONENT__TREE
or
LAYER_LIST_COMPONENT__TREE
aMapLayerControl
- the map layer control to create the tree forJTree
which will be used in the map layer controlprotected TreeModel createTreeModel(int aID, TLcyMapLayerControl aMapLayerControl)
TreeModel
used by the JTree
of the map layer controlaID
- must be LAYER_TREE_COMPONENT__TREE_MODEL
or LAYER_LIST_COMPONENT__TREE_MODEL
aMapLayerControl
- the map layer controlTreeModel
used by the JTree
of the map layer controlprotected TreeCellRenderer createTreeCellRenderer(int aID, TLcyMapLayerControl aMapLayerControl)
TreeCellRenderer
used by the JTree
of the map layer
controlaID
- must be LAYER_TREE_COMPONENT__TREE_CELL_RENDERER
or LAYER_LIST_COMPONENT__TREE_CELL_RENDERER
aMapLayerControl
- the map layer controlTreeCellRenderer
used by the JTree
of the map layer
controlprotected ILcdFilter<ILcdGXYLayer> createEnabledFilter(int aID, ILcyMapLayerControl aLayerControl)
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 );
}
}
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.protected void insertComponentInActionBar(int aID, Component aComponent, TLcyMapLayerControl aMapLayerControl)
Inserts the given component in the regular action bar (see TLcyMapLayerControl.getActionBar()
) of the given map layer control. Note that this action bar
must be an ILcyToolBar
for this method to be able to insert the component.
aID
- The ID that was used to create the component. Must be
DELETE_COMPONENT
. Subclasses may choose to accept extra
ID's.aComponent
- The component that should be inserted. May be null
.aMapLayerControl
- The map layer control in whose action bar the component should be
inserted. This is never null
.protected void insertComponentInOrderBar(int aID, Component aComponent, TLcyMapLayerControl aMapLayerControl)
Inserts the given component in the order action bar (see TLcyMapLayerControl.getOrderActionBar()
) of the given map layer control. Note that this action
bar must be an ILcyToolBar
for this method to be able to insert the component.
aID
- The ID that was used to create the component. Must be
DELETE_COMPONENT
. Subclasses may choose to accept extra
ID's.aComponent
- The component that should be inserted. May be null
.aMapLayerControl
- The map layer control in whose order action bar the component should be
inserted. This is never null
.protected void insertComponent(int aID, Component aComponent, TLcyMapLayerControl aLayerControlSFCT)
aID
- The id that was used to create aComponent (must end with COMPONENT).aComponent
- The component to insert.aLayerControlSFCT
- The layer control to insert the component into.protected ILcyActionBar createActionBar(TLcyMapLayerControl aLayerControl)
aLayerControl
- The layer control to create the action bar for.protected ILcyActionBar createActionBar(int aID, TLcyMapLayerControl aLayerControl)
aID
- The ID of the action bar. Should be one of ACTION_BAR
or
ORDER_ACTION_BAR
. Subclasses may choose to accept extra
ID's.aLayerControl
- The layer control for which to create the action bar. This is never
null
.null
, but subclasses may
choose to return null
if they want to remove the specified action bar from
the layer control.protected ILcyPopupMenu createPopupMenu(int aID, TLcyMapLayerControl aLayerControl)
aID
- The ID of the requested popup menu. Should be POPUP_ACTION_BAR
.
Subclasses can choose to accept extra ID's.aLayerControl
- The layer control for which to create the popup menu.null
, but subclasses may
choose to return null
if they want to remove the popup menu from the layer
control.protected void insertActionBar(ILcyActionBar aActionBar, TLcyMapLayerControl aLayerControlSFCT)
Insert the given action bar into the given layer control.
Note that this method is here primarily for backwards compatibility reasons. Instead
of overriding this method, you should override
insertActionBar(int, com.luciad.lucy.gui.ILcyActionBar, com.luciad.lucy.map.TLcyMapLayerControl)
which was added in a later release.
aActionBar
- The action bar to insert.aLayerControlSFCT
- The layer control to insert the action bar into.protected void insertActionBar(int aID, ILcyActionBar aActionBar, TLcyMapLayerControl aLayerControlSFCT)
Inserts the given action bar into the given layer control.
In case the ID is ACTION_BAR
, this method delegates the insertion to the
insertActionBar(com.luciad.lucy.gui.ILcyActionBar, TLcyMapLayerControl)
method
for backwards compatibility reasons. Note that subclasses may choose not to do this.
aID
- The ID of the given action bar. Should be one of
ACTION_BAR
or ORDER_ACTION_BAR
.
Subclasses may choose to accept extra ID's.aActionBar
- The action bar to insert. This may be null
.aLayerControlSFCT
- The layer control to insert the action bar into. This is never
null
.protected void insertAction(int aID, ILcdAction aAction, TLcyMapLayerControl aLayerControlSFCT)
insertActionIn...
methods.aID
- The id that was used to create the action. Must be one of the
constants defined in this class that ends with _ACTION
.
Subclasses may choose to accept extra ID's.aAction
- The action to insert. This may be null
.aLayerControlSFCT
- The layer control to insert the action into. This is never
null
insertActionInActionBar
,
insertActionInOrderBar
,
insertActionInPopupMenu
protected void insertActionInActionBar(int aID, ILcdAction aAction, TLcyMapLayerControl aLayerControlSFCT)
aID
- The ID that was used to create the action. Must be one of the
constants defined in this class that ends with _ACTION
.
Subclasses may choose to accept extra ID's.aAction
- The action to insert. This may be null
.aLayerControlSFCT
- The layer control in whose action bar the action should be inserted.
This is never null
.protected void insertActionInOrderBar(int aID, ILcdAction aAction, TLcyMapLayerControl aLayerControlSFCT)
aID
- The ID that was used to create the action. Must be one of the
constants defined in this class that ends with _ACTION
.
Subclasses may choose to accept extra ID's.aAction
- The action to insert. This may be null
.aLayerControlSFCT
- The layer control in whose order bar the action should be inserted.
This is never null
.protected void insertActionInPopupMenu(int aID, ILcdAction aAction, TLcyMapLayerControl aLayerControlSFCT)
aID
- The ID that was used to create the action. Must be one of the
constants defined in this class that ends with _ACTION
.
Subclasses may choose to accept extra ID's.aAction
- The action to insert. This may be null
.aLayerControlSFCT
- The layer control in whose popup menu the action should be inserted.
This is never null
.protected void insertActiveSettable(int aID, ILcyActiveSettable aActiveSettable, TLcyMapLayerControl aLayerControlSFCT)
insertActiveSettableIn...
methodsaID
- The id that was used to create the active settable (must end with ACTIVE_SETTABLE).aActiveSettable
- The active settable to insert.aLayerControlSFCT
- The layer control to insert the active settable into.insertActiveSettableInActionBar
,
insertActiveSettableInOrderBar
,
insertActiveSettableInPopupMenu
protected void insertActiveSettableInActionBar(int aID, ILcyActiveSettable aActiveSettable, TLcyMapLayerControl aLayerControlSFCT)
aID
- The ID that was used to create the active settable. Must be one of the
constants defined in this class that ends with _ACTIVE_SETTABLE
.
Subclasses may choose to accept extra ID's.aActiveSettable
- The active settable to insert. This may be null
.aLayerControlSFCT
- The layer control in whose action bar the active settable should be
inserted. This is never null
.protected void insertActiveSettableInOrderBar(int aID, ILcyActiveSettable aActiveSettable, TLcyMapLayerControl aLayerControlSFCT)
aID
- The ID that was used to create the active settable. Must be one of the
constants defined in this class that ends with _ACTIVE_SETTABLE
.
Subclasses may choose to accept extra ID's.aActiveSettable
- The active settable to insert. This may be null
.aLayerControlSFCT
- The layer control in whose order bar the active settable should be
inserted. This is never null
.protected void insertActiveSettableInPopupMenu(int aID, ILcyActiveSettable aActiveSettable, TLcyMapLayerControl aLayerControlSFCT)
aID
- The ID that was used to create the active settable. Must be one of the
constants defined in this class that ends with _ACTIVE_SETTABLE
.
Subclasses may choose to accept extra ID's.aActiveSettable
- The active settable to insert. This may be null
.aLayerControlSFCT
- The layer control in whose popup menu the active settable should be
inserted. This is never null
.