Class TLcyMapLayerControl

All Implemented Interfaces:
ILcyMapLayerControl, ImageObserver, MenuContainer, Serializable, Accessible

public class TLcyMapLayerControl extends JPanel implements ILcyMapLayerControl
This is an implementation of ILcyMapLayerControl that does not contain any user interface elements. It just keeps track of layer selection and it can contain an ILcyActionBar. It is up to the user of this class however to set such an ILcyActionBar and to add user interface components to this TLcyMapLayerControl. The accelerator keys registered to the actions of that ILcyActionBar are automatically respected.

TLcyMapLayerControl instances are typically created by a TLcyMapLayerControlFactory. The creation process can be modified by extending this factory.

See Also:
  • Constructor Details

    • TLcyMapLayerControl

      public TLcyMapLayerControl(TLcyMapComponent aMapComponent)
      Creates a new TLcyMapLayerControl according to the given construction options.
      Parameters:
      aMapComponent - The TLcyMapComponent this layer control works with.
  • Method Details

    • setClassTraceOn

      @Deprecated public static void setClassTraceOn(boolean aClassTraceOn)
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Enables tracing for all instances of this class. If the argument is true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
      Parameters:
      aClassTraceOn - if true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
    • setTraceOn

      @Deprecated public void setTraceOn(boolean aTraceOn)
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Enables tracing for this class instance. Calling this method with either true or false as argument automatically turns off tracing for all other class instances for which setTraceOn has not been called. If the argument is false then only the informative, warning and error log messages are recorded.
      Parameters:
      aTraceOn - if true then all log messages are recorded for this instance. If false, then only the informative, warning and error log messages are recorded.
    • isTraceOn

      @Deprecated public boolean isTraceOn()
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Returns true if tracing is enabled for this class.
      Returns:
      true if tracing is enabled for this class, false otherwise.
    • getComponent

      public Component getComponent()
      Description copied from interface: ILcyMapLayerControl
      Returns the visual representation of the map layer control. Can never return null.
      Specified by:
      getComponent in interface ILcyMapLayerControl
      Returns:
      the visual representation of the map layer control.
    • getActionBar

      public ILcyActionBar getActionBar()
      Description copied from interface: ILcyMapLayerControl
      Returns the action bar containing the layer actions.
      Specified by:
      getActionBar in interface ILcyMapLayerControl
      Returns:
      the action bar containing the layer actions.
    • getOrderActionBar

      public ILcyActionBar getOrderActionBar()
    • getPopupMenu

      public ILcyPopupMenu getPopupMenu()
    • setActionBar

      public void setActionBar(ILcyActionBar aActionBar)
      Sets the action bar that is associated with this layer control.
      Parameters:
      aActionBar - The action bar
      See Also:
    • setOrderActionBar

      public void setOrderActionBar(ILcyActionBar aOrderActionBar)
    • setPopupMenu

      public void setPopupMenu(ILcyPopupMenu aPopupMenu)
    • getMapComponent

      public TLcyMapComponent getMapComponent()
      Returns the map component this layer control operates on.
      Returns:
      the map component this layer control operates on.
    • setMapComponent

      public void setMapComponent(TLcyMapComponent aMapComponent)
      Sets the map component this layer control operates on.
      Parameters:
      aMapComponent - The map component this layer control operates on.
    • getSelectedLayer

      @Deprecated public ILcdGXYLayer getSelectedLayer()
      Deprecated.
      Please use the methods getSelectedLayers and setSelectedLayers. These have the ability to work with multiple selection.

      Returns the selected layer. This layer is always contained in the view, unlike the layers returned by getSelectedLayers().

      Returns:
      the selected layer.
      See Also:
    • setSelectedLayer

      @Deprecated public void setSelectedLayer(ILcdGXYLayer aLayer)
      Deprecated.
      Please use the methods getSelectedLayers and setSelectedLayers. These have the ability to work with multiple selection.

      Sets the selected layer. Note that this layer has to be contained in the view.

      If you override this method, do not forget to keep the selected layer(s) in sync with those on the map component (see ILcyMapComponent.setSelectedLayers(com.luciad.view.gxy.ILcdGXYLayer[]).

      Parameters:
      aLayer - The selected layer.
    • getSelectedLayers

      public ILcdGXYLayer[] getSelectedLayers()

      Returns the selected layers. These are the layers that the user has selected in the user interface, or the layers that has been set by calling setSelectedLayers. All these layers are part of the view.

      When a layerlist, which has been inserted by calling ILcyMapComponent.insertGXYLayer(com.luciad.view.gxy.ILcdGXYLayer) insertGXYLayer}, is selected by calling setSelectedLayers, calling this method afterwards will not return the layerlist but the corresponding ILcdLayerTreeNode

      Returns:
      The selected layers.
      See Also:
    • setSelectedLayers

      public void setSelectedLayers(ILcdGXYLayer[] aSelectedLayers)

      Sets the selected layers to the layers contained in aSelectedLayers. A property change event will be fired when the selection has changed.

      All the layers of aSelectedLayers should be contained in the view, or should be ILcdLayerLists which were inserted in the view by calling ILcyMapComponent#insertGXYLayer. Notice that calling this method with such a layerlist and afterwards calling getSelectedLayers() will not return this layerlist, but the corresponding layer node.

      If you override this method, do not forget to keep the selected layer(s) in sync with those on the map component (see ILcyMapComponent.setSelectedLayers(com.luciad.view.gxy.ILcdGXYLayer[]).

      Parameters:
      aSelectedLayers - The layers in this array will be selected.
      See Also: