Package com.bbn.openmap

Examples of com.bbn.openmap.MapHandler


                if (loc != null) {
                    x = (int) loc.getX();
                    y = (int) loc.getY();
                }

                MapHandler mh = (MapHandler) getBeanContext();
                Frame frame = null;
                if (mh != null) {
                    frame = (Frame) mh.get(java.awt.Frame.class);
                }

                ws.displayInWindow(frame, x, y, w, h);
            }
        };
View Full Code Here


                ws = new ScrollPaneWindowSupport(ccp, i18n.get(CoordsMenuItem.class,
                        "combinedCoordDialog.title",
                        "Go To Coordinates..."));
            }

            MapHandler mh = getMapHandler();
            Frame frame = null;
            if (mh != null) {
                frame = (Frame) mh.get(java.awt.Frame.class);
            }

            ws.displayInWindow(frame);
        }
    }
View Full Code Here

        // Store the given properties for later use.
        properties = props;

        // Create the MapHandler, which allows all the components to
        // find each other if they are added to it.
        MapHandler mapHandler = new MapHandler();
        // Create the MapBean.
        MapBean map = new MapBean();
        // Set the map's center property
        map.setCenter(new LatLonPoint(43.0f, -95.0f));
        // Add the MapBean to the MapHandler.
        mapHandler.add(map);

        // Add the map to the JFrame
        getContentPane().add(map, BorderLayout.CENTER);

        // Create a mouse delegator to handle mouse events on the map
        mapHandler.add(new MouseDelegator());
        // Create and add the MouseMode that the RouteLayer wants
        // events from. The MouseDelegator asks all layers which
        // MouseMode they listen to, and hooks them up. When that
        // MouseMode is active, events flow to the top layer, then
        // down to lower layers if the event is not consumed along the
        // way.
        mapHandler.add(new SelectMouseMode());

        // Add a LayerHandler, which manages all layers, on or off.
        mapHandler.add(new LayerHandler());

        // Create and add a Political Background
        Layer layer = createPoliticalLayer();
        if (layer != null)
            mapHandler.add(layer);

        // Create and add a Route Layer. The LayerHandler will find
        // it via the LayerHandler, and then the LayerHandler will add
        // it to the map because layer.isVisible() == true;
        layer = createRouteLayer();
        if (layer != null) {
            layer.setName("Routes");
            mapHandler.add(layer);
        }

        // Add some navigation tools. The ToolPanel will find the
        // OMToolSet (a Tool) in the MapHandler.
        ToolPanel toolPanel = new ToolPanel();
        mapHandler.add(toolPanel);
        mapHandler.add(new OMToolSet());
        // Add the ToolPanel to the JFrame.
        getContentPane().add(toolPanel, BorderLayout.NORTH);

        // Oh, for fun, lets add a GUI to control the layers. A
        // button to launch it will get added to the ToolPanel.
        mapHandler.add(new LayersPanel());

        // You can add other components from the com.bbn.openmap.gui
        // package...
    }
View Full Code Here

     *
     * @param selectedTiles2
     */
    protected void goTo(ImageTile[] selectedTiles2) {
        if (mapBean == null) {
            MapHandler bc = (MapHandler) getBeanContext();
            if (bc != null) {
                mapBean = (MapBean) bc.get(com.bbn.openmap.MapBean.class);
            }
        }

        if (mapBean != null) {
            if (selectedTiles != null && selectedTiles.length > 0) {
View Full Code Here

TOP

Related Classes of com.bbn.openmap.MapHandler

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.