Search in sources :

Example 1 with BaseMapLayerGroup

use of com.revolsys.swing.map.layer.BaseMapLayerGroup in project com.revolsys.open by revolsys.

the class LayerRendererOverlay method setLayer.

public void setLayer(final Layer layer) {
    final Layer old = this.layer;
    if (old != layer) {
        if (old != null) {
            if (old.getParent() instanceof BaseMapLayerGroup) {
                old.setVisible(false);
            }
            Property.removeListener(old, this);
        }
        this.layer = layer;
        if (layer != null) {
            Property.addListener(layer, this);
            if (layer.getParent() instanceof BaseMapLayerGroup) {
                layer.setVisible(true);
            }
            if (layer.isInitialized()) {
                layer.refresh();
            }
        }
        this.image = null;
        redraw();
        firePropertyChange("layer", old, layer);
    }
}
Also used : BaseMapLayerGroup(com.revolsys.swing.map.layer.BaseMapLayerGroup) Layer(com.revolsys.swing.map.layer.Layer) NullLayer(com.revolsys.swing.map.layer.NullLayer)

Aggregations

BaseMapLayerGroup (com.revolsys.swing.map.layer.BaseMapLayerGroup)1 Layer (com.revolsys.swing.map.layer.Layer)1 NullLayer (com.revolsys.swing.map.layer.NullLayer)1