Package com.bbn.openmap.layer

Examples of com.bbn.openmap.layer.BufferedLayer$VisHelper


        Component[] comps = this.getComponents();
        int ncomponents = comps.length;
        int nBufLayerComponents = 0;

        BufferedLayer bufLayer;
        synchronized (this) {
            bufLayer = getBufferedLayer();
        }

        if (ncomponents == 0 || comps[ncomponents - 1] != bufLayer) {
            super.changeLayers(e);
            return;
        }

        Component[] bufLayers = bufLayer.getLayers();
        nBufLayerComponents = bufLayers.length;

        // Take 1 off for the bufLayer
        Layer[] newLayers = new Layer[ncomponents + nBufLayerComponents - 1];
        System.arraycopy(comps, 0, newLayers, 0, ncomponents - 1);
View Full Code Here


        bufferedLayer = bl;
    }

    public synchronized BufferedLayer getBufferedLayer() {
        if (bufferedLayer == null) {
            bufferedLayer = new BufferedLayer();
            addPropertyChangeListener(bufferedLayer);
            bufferedLayer.setName("Background Layers");
        }

        return bufferedLayer;
View Full Code Here

        }

        boolean oldChange = getDoContainerChange();
        setDoContainerChange(false);

        BufferedLayer bufLayer;

        synchronized (this) {
            bufLayer = getBufferedLayer();
        }

        // use LayerEvent.REPLACE when you want to remove all current
        // layers
        // add a new set
        if (type == LayerEvent.REPLACE) {
            if (DEBUG) {
                debugmsg("Replacing all layers");
            }
            removeAll();
            bufLayer.clearLayers();

            for (int i = 0; i < layers.length; i++) {
                // @HACK is this cool?:
                if (layers[i] == null) {
                    System.err.println("MapBean.setLayers(): layer " + i
                            + " is null");
                    continue;
                }

                if (DEBUG) {
                    debugmsg("Adding layer[" + i + "]= " + layers[i].getName());
                }

                if (layers[i].getAddAsBackground()) {
                    if (DEBUG) {
                        Debug.output("Adding layer[" + i + "]= "
                                + layers[i].getName() + " to background");
                    }

                    bufLayer.addLayer(layers[i]);
                } else {
                    add(layers[i]);
                }

                layers[i].setVisible(true);
            }

            if (bufLayer.hasLayers()) {
                add(bufLayer);
            }
        }

        // use LayerEvent.ADD when adding and/or reshuffling layers
        else if (type == LayerEvent.ADD) {

            remove(bufLayer);

            if (DEBUG) {
                debugmsg("Adding new layers");
            }
            for (int i = 0; i < layers.length; i++) {
                if (DEBUG) {
                    debugmsg("Adding layer[" + i + "]= " + layers[i].getName());
                }

                //              add(layers[i]);
                layers[i].setVisible(true);

                if (layers[i].getAddAsBackground()) {
                    if (DEBUG) {
                        Debug.output("Adding layer[" + i + "]= "
                                + layers[i].getName() + " to background");
                    }
                    bufLayer.addLayer(layers[i]);
                } else {
                    add(layers[i]);
                }
            }

            if (bufLayer.hasLayers()) {
                add(bufLayer);
            }
        }

        // use LayerEvent.REMOVE when you want to delete layers from
        // the map
        else if (type == LayerEvent.REMOVE) {
            if (DEBUG) {
                debugmsg("Removing layers");
            }
            for (int i = 0; i < layers.length; i++) {
                if (DEBUG) {
                    debugmsg("Removing layer[" + i + "]= "
                            + layers[i].getName());
                }
                remove(layers[i]);
                bufLayer.removeLayer(layers[i]);
            }
        }

        if (!layerRemovalDelayed) {
            purgeAndNotifyRemovedLayers();
View Full Code Here

TOP

Related Classes of com.bbn.openmap.layer.BufferedLayer$VisHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.