Package com.bbn.openmap

Examples of com.bbn.openmap.Layer


            }
            try {
                // Create it if you do...
                Object obj = java.beans.Beans.instantiate(null, className);
                if (obj instanceof Layer) {
                    Layer l = (Layer) obj;
                    // All layers have a setProperties method, and
                    // should intialize themselves with proper
                    // settings here. If a property is not set, a
                    // default should be used, or a big, graceful
                    // complaint should be issued.
                    l.setProperties(layerName, p);
                    layers.addElement(l);
                }
            } catch (java.lang.ClassNotFoundException e) {
                System.err.println("Layer class not found: \"" + className
                        + "\"");
View Full Code Here


                BorderFactory.createEmptyBorder(2, 2, 2, 2));

        Enumeration keys = layers.keys();
        while (keys.hasMoreElements()) {
            String layerName = keys.nextElement().toString();
            Layer omlayer = (Layer) layers.get(layerName);

            if (omlayer.isVisible()) {
                JMenuItem menuItem = new JMenuItem(layerName);
                menuItem.setHorizontalTextPosition(SwingConstants.CENTER);
                menuItem.setBorder(compoundborder);
                menuItem.addActionListener(this);
                popup.add(menuItem);
View Full Code Here

        if (!(source instanceof JMenuItem))
            return;

        JMenuItem mi = (JMenuItem) source;
        String name = mi.getText();
        Layer targetLayer = (Layer) layers.get(name);

        if (targetLayer == null) {
            System.out.println("ERROR> BBDnDC::actionPerformed: "
                    + "no layer found with name " + name);
            return;
        }

        BeanBox targetBeanBox = ((BeanBoxHandler) targetLayer).getBeanBox();

        Object bean = transferData.get(0);
        BeanInfo beanInfo = (BeanInfo) transferData.get(1);
        Boolean wasBeanMoved = (Boolean) transferData.get(2);

        if (wasBeanMoved.booleanValue()) {

            String sourceLayerName = (String) transferData.get(3);
            if (sourceLayerName.equals(targetLayer.getName())) {
                targetBeanBox.relocateBean(bean, beanInfo, dropLocation);
            } else {
                Layer sourceLayer = (Layer) layers.get(sourceLayerName);
                BeanBox sourceBeanBox = ((BeanBoxHandler) sourceLayer).getBeanBox();
                sourceBeanBox.removeBean(bean);
                Vector object = new Vector();
                object.add(bean);
                object.add(beanInfo);
View Full Code Here

        if (Debug.debugging("beanbox"))
            Debug.output("Enter> startDragAction");

        Object selectedBean = null;
        BeanBox selectedBeanBox = null;
        Layer selectedLayer = null;

        Point srcLocation = dge.getDragOrigin();

        Enumeration keys = layers.keys();
        while (keys.hasMoreElements()) {
            String layerName = keys.nextElement().toString();
            Layer omLayer = (Layer) layers.get(layerName);
            BeanBox beanBox = ((BeanBoxHandler) omLayer).getBeanBox();
            selectedBean = beanBox.getBeanAtLocation(srcLocation);
            if (selectedBean != null) {
                selectedBeanBox = beanBox;
                selectedLayer = omLayer;
View Full Code Here

        // Build marker list
        StringBuffer layerList = new StringBuffer();
        Component[] comps = map.getComponents();
        int ncomponents = comps.length;
        for (int i = 0; i < ncomponents; i++) {
            Layer layer = (Layer) comps[i];
            if (layer != statusLayer) { // Take care of the
                // statusLayer later.
                layerList.append(" " + layer.getPropertyPrefix());
                layer.getProperties(props);
            }
        }
        props.put(prefix + OverviewMapHandlerLayerProperty,
                layerList.toString());
View Full Code Here

        if (showLayers != null) {
            for (int j = size - 1; j >= 0; j--) {
                for (int i = layers.length - 1; i >= 0; i--) {
                    String layerName = (String) showLayers.get(j);
                    Layer layer = layers[i];
                    if (layerName.equals(layer.getPropertyPrefix())) {
                        layer.renderDataForProjection(proj, graphics);
                        if (Debug.debugging("imageserver")) {
                            Debug.output("ImageServer: image request adding layer graphics from : "
                                    + layer.getName());
                        }
                    }
                }
            }
        } else if (Debug.debugging("imageserver")) {
View Full Code Here

            String layerName = (String) layerNames.elementAt(i);

            // Check to see if some other ImageServer has used this
            // layer, and reuse it.
            if (instantiatedLayers != null) {
                Layer iLayer = (Layer) instantiatedLayers.get(layerName);
                if (iLayer != null) {

                    // We might want to consider adding this:
                    // iLayer.setProperties(layerName, p);

                    layers.add(iLayer);
                    if (Debug.debugging("imageserver")) {
                        Debug.output("ImageServer: adding instantiated layer /"
                                + layerName + "/");
                    }
                    continue;
                }
            }

            // Brand new layer, so instantiate it.
            String classProperty = layerName + ".class";
            String className = p.getProperty(classProperty);
            if (className == null) {
                Debug.error("Failed to locate property \"" + classProperty
                        + "\"");
                Debug.error("Skipping layer \"" + layerName + "\"");
                continue;
            }

            Object obj = ComponentFactory.create(className, layerName, p);
            if (obj instanceof Layer || obj instanceof PlugIn) {
                Layer l = null;

                if (obj instanceof PlugIn) {
                    PlugIn pi = (PlugIn) obj;
                    PlugInLayer pil = new PlugInLayer();
                    pil.setPlugIn(pi);
View Full Code Here

     */
    protected void createWmsLayers() {
        wmsLayerByName.clear();
        wmsLayers.clear();
        for (int i = 0; i < layers.length; i++) {
            Layer layer = layers[i];
            createWmsLayers(wmsLayerFactory.createWmsLayer(layer));
        }
    }
View Full Code Here

       
        for(Iterator it = parameters.queryLayerNames.iterator(); it.hasNext();){
            String queryLayerName = (String)it.next();
           
            IWmsLayer wmslayer = (IWmsLayer) wmsLayerByName.get(queryLayerName);
            Layer layer = getTopLayerByName(queryLayerName);
           
            layer.setProjection(new ProjectionEvent(this, projection));
           
            LayerFeatureInfoResponse layerResponse = wmslayer.query(parameters.x, parameters.y);
            featureInfoResponse.add(layerResponse);
        }
       
View Full Code Here

            break;
        }
    }

    public void cleanup() {
        Layer l = getLayer();
        if (l != null) {
            l.removeLayerStatusListener(this);
        }
        super.cleanup();
    }
View Full Code Here

TOP

Related Classes of com.bbn.openmap.Layer

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.