Class MapLayerTable

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class MapLayerTable extends JPanel
Displays a list of the map layers in an associated MapPane and provides controls to set the visibility, selection and style of each layer.

Implementation note: MapContent stores its list of Layer objects in rendering order, ie. the layer at index 0 is rendererd first, followed by index 1 etc. MapLayerTable stores its layers in the reverse order since it is more intuitive for the user to think of a layer being 'on top' of other layers.

Since:
2.6
Author:
Michael Bedward
See Also:
  • Constructor Details

    • MapLayerTable

      public MapLayerTable()
      Default constructor. A subsequent call to setMapPane(org.geotools.swing.MapPane) will be required.
    • MapLayerTable

      public MapLayerTable(MapPane mapPane)
      Constructor.
      Parameters:
      mapPane - the map pane this MapLayerTable will service.
  • Method Details

    • setMapPane

      public void setMapPane(MapPane mapPane)
      Set the map pane that this MapLayerTable will service.
      Parameters:
      mapPane - the map pane
    • onAddLayer

      public void onAddLayer(Layer layer)
      Add a new layer to those listed in the table. This method will be called by the associated map pane automatically as part of the event sequence when a new MapLayer is added to the pane's MapContext.
      Parameters:
      layer - the map layer
    • onRemoveLayer

      public void onRemoveLayer(Layer layer)
      Remove a layer from those listed in the table. This method will be called by the associated map pane automatically as part of the event sequence when a new MapLayer is removed from the pane's MapContext.
      Parameters:
      layer - the map layer
    • onMoveLayer

      public void onMoveLayer(Layer layer)
      Move a layer from those listed in the table. This method will be called by the associated map pane automatically as part of the event sequence when a new MapLayer isremoved from the pane's MapContext.
      Parameters:
      layer - the map layer
    • repaint

      public void repaint(Layer layer)
      Repaint the list item associated with the specified MapLayer object
      Parameters:
      layer - the map layer
    • clear

      public void clear()
      Removes all items from the table. This is called by the MapPane or other clients and is not intended for general use.