Examples of OMDrawingTool


Examples of com.bbn.openmap.tools.drawing.OMDrawingTool

            System.err.println(ioe);
            linkManager.resetLink();
            return false;
        }

        OMDrawingTool dt = getDrawingTool();
        if (dt != null) {
            // Stop editing any graphic currently being edited
            dt.setMask(OMDrawingTool.DEACTIVATE_ASAP_BEHAVIOR_MASK);
            EditableOMGraphic egraphic = dt.getCurrentEditable();
            if (egraphic != null) {
                OMGraphic graphic = egraphic.getGraphic();

                OMAction action = new OMAction(UPDATE_GRAPHIC_MASK);
                drawingComplete(graphic, action);
                dt.setCurrentEditable(null);
            }
        }

        // FIXME - we could operate on a subset of graphics by either having
        // multiple graphics lists or by filtering the graphics list
        // to only detect/edit the graphics we want.
        if (gesGraphic != null && drawingTool != null) {
            OMGraphic graphic = null;
            if (dt != null) {

                Properties prop = (Properties) gesGraphic.getAppObject();
                String editable = prop.getProperty(LPC_EDITABLE);
                Debug.message("link", "DrawLinkLayer: editable: " + editable);
                if (editable.equals("false")) {
                    Debug.message("link",
                            "DrawLinkLayer not editing graphic.  editable = false");
                } else {
                    Debug.message("link",
                            "DrawLinkLayer trying to edit graphic");
                    graphic = dt.edit(gesGraphic, layer);
                }
            } else {
                Debug.message("link",
                        "Error: DrawLinkLayer has not drawing tool");
            }
View Full Code Here

Examples of com.bbn.openmap.tools.drawing.OMDrawingTool

        ga.setRenderType(OMGraphic.RENDERTYPE_LATLON);
        ga.setLineType(OMGraphic.LINETYPE_GREATCIRCLE);
    }

    protected OMDrawingTool createDrawingTool() {
        return new OMDrawingTool();
    }
View Full Code Here

Examples of com.bbn.openmap.tools.drawing.OMDrawingTool

     * If the DrawingToolLayer is using a hidden OMDrawingTool, release the
     * proxy lock on the active MapMouseMode.
     */
    public void releaseProxyMouseMode() {
        MapMouseMode pmmm = getProxyMouseMode();
        OMDrawingTool dt = getDrawingTool();
        if (pmmm != null && dt != null) {
            if (pmmm.isProxyFor(dt.getMouseMode())) {
                if (DTL_DEBUG) {
                    Debug.output("DTL: releasing proxy on " + pmmm.getID());
                }

                pmmm.releaseProxy();
                setProxyMouseMode(null);
                fireRequestInfoLine(""); // hidden drawing tool put up
                // coordinates, clean up.
            }

            if (dt.isActivated()) {
                dt.deactivate();
            }
        }
    }
View Full Code Here

Examples of com.bbn.openmap.tools.drawing.OMDrawingTool

    /**
     * Query for what tooltip to display for an OMGraphic when the mouse is over
     * it.
     */
    public String getToolTipTextFor(OMGraphic omgr) {
        OMDrawingTool dt = getDrawingTool();
        if (shouldEdit(omgr) && dt.canEdit(omgr.getClass())
                && !dt.isActivated()) {
            return editInstruction;
        } else {
            return null;
        }
    }
View Full Code Here

Examples of com.bbn.openmap.tools.drawing.OMDrawingTool

        }
    }

    public void edit(OMGraphic omg) {

        OMDrawingTool dt = getDrawingTool();

        if (dt != null && dt.canEdit(omg.getClass())) {

            // if (dt.isEditing(omg)) {
            // dt.deselect(omg);
            // return;
            // }

            dt.resetBehaviorMask();

            MapMouseMode omdtmm = dt.getMouseMode();
            if (!omdtmm.isVisible()) {
                dt.setMask(OMDrawingTool.PASSIVE_MOUSE_EVENT_BEHAVIOR_MASK);
            }

            MapMouseInterpreter mmi = (MapMouseInterpreter) getMapMouseListener();

            MouseEvent mevent = null;
            if (mmi != null) {
                mevent = mmi.getCurrentMouseEvent();
            }

            if (omg.isSelected()) {
                omg.deselect();
            }

            if (dt.select(omg, this, mevent)) {
                // OK, means we're editing - let's lock up the
                // MouseMode
                if (DTL_DEBUG) {
                    Debug.output("DTL: starting edit of OMGraphic...");
                }

                // Check to see if the DrawingToolMouseMode wants to
                // be invisible. If it does, ask the current
                // active MouseMode to be the proxy for it...
                if (!omdtmm.isVisible() && mevent instanceof MapMouseEvent) {
                    MapMouseMode mmm = ((MapMouseEvent) mevent).getMapMouseMode();
                    if (mmm.actAsProxyFor(omdtmm,
                            MapMouseSupport.PROXY_DISTRIB_MOUSE_MOVED
                                    & MapMouseSupport.PROXY_DISTRIB_MOUSE_DRAGGED)) {
                        if (DTL_DEBUG) {
                            Debug.output("DTL: Setting " + mmm.getID()
                                    + " as proxy for drawing tool");
                        }
                        setProxyMouseMode(mmm);
                    } else {
                        // WHOA, couldn't get proxy lock - bail
                        if (DTL_DEBUG) {
                            Debug.output("DTL: couldn't get proxy lock on "
                                    + mmm.getID()
                                    + " deactivating internal drawing tool");
                        }
                        dt.deactivate();
                    }
                } else {
                    if (DTL_DEBUG) {
                        Debug.output("DTL: MouseMode wants to be visible("
                                + (omdtmm.isVisible())
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.