Package com.bbn.openmap.tools.drawing

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


                    e.getY(),
                    distanceLimit);
        }

        if (gesGraphic != null && drawingTool != null) {
            DrawingTool dt = getDrawingTool();
            OMGraphic graphic = null;
            if (dt != null) {
                graphic = dt.edit(gesGraphic, layer);
            }

            if (graphic != null) {
                Debug.message("link", "AmpLinkLayer editing graphic");
                return true;
View Full Code Here


            rrButton = new JButton("RR");
            rrButton.setToolTipText("Create Range Ring");
            rrButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent event) {
                    DrawingTool dt = getDrawingTool();
                    GraphicAttributes ga = new GraphicAttributes();
                    ga.setLinePaint(Color.yellow);
                    if (dt != null) {
                        OMRangeRings rr = (OMRangeRings) getDrawingTool().create("com.bbn.openmap.omGraphics.OMRangeRings",
                                ga,
                                layer);
                        if (rr != null) {
                            //                          rr.setInterval(25, Length.MILE);
                        } else {
                            Debug.error("AmpLinkLayer: Drawing tool can't create OMRangeRings");
                        }
                    } else {
                        Debug.output("AmpLinkLayer can't find a drawing tool");
                    }
                }
            });

            eZone = new JButton("EZ");
            eZone.setToolTipText("Create Exclusion Zone");
            eZone.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent event) {
                    DrawingTool dt = getDrawingTool();
                    GraphicAttributes ga = new GraphicAttributes();
                    ga.setRenderType(OMGraphic.RENDERTYPE_LATLON);
                    ga.setLinePaint(Color.red);
                    if (dt != null) {
                        OMCircle circle = (OMCircle) getDrawingTool().create("com.bbn.openmap.omGraphics.OMCircle",
View Full Code Here

        // box.add(button);

        JButton button = new JButton("Create Containing Rectangle Filter");
        button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                DrawingTool dt = getDrawingTool();
                if (dt != null) {
                    GraphicAttributes fga = getFilterGA();

                    OMRect rect = (OMRect) getDrawingTool().create("com.bbn.openmap.omGraphics.OMRect",
                            fga,
                            layer,
                            false);
                    if (rect != null) {
                        rect.setAppObject(internalKey);
                    } else {
                        Debug.error("DemoLayer: Drawing tool can't create OMRect");
                    }
                } else {
                    Debug.output("DemoLayer can't find a drawing tool");
                }
            }
        });
        box.add(button);

        button = new JButton("Create Containing Polygon Filter");
        button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                DrawingTool dt = getDrawingTool();
                if (dt != null) {
                    GraphicAttributes fga = getFilterGA();
                    fga.setFillPaint(OMColor.clear);

                    EditableOMPoly eomp = new EditableOMPoly(fga);
                    eomp.setEnclosed(true);
                    eomp.setShowGUI(false);

                    dt.setBehaviorMask(OMDrawingTool.QUICK_CHANGE_BEHAVIOR_MASK);
                    OMPoly poly = (OMPoly) getDrawingTool().edit(eomp, layer);

                    if (poly != null) {
                        poly.setIsPolygon(true);
                        poly.setAppObject(internalKey);
                    } else {
                        Debug.error("DemoLayer: Drawing tool can't create OMPoly");
                    }
                } else {
                    Debug.output("DemoLayer can't find a drawing tool");
                }
            }
        });
        box.add(button);

        button = new JButton("Create Excluding Rectangle Filter");
        button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                DrawingTool dt = getDrawingTool();
                if (dt != null) {
                    GraphicAttributes fga = getFilterGA();
                    fga.setFillPaint(OMColor.clear);

                    OMRect rect = (OMRect) getDrawingTool().create("com.bbn.openmap.omGraphics.OMRect",
View Full Code Here

    /**
     * Query that an OMGraphic is selectable.
     */
    public boolean isSelectable(OMGraphic omg) {
        DrawingTool dt = getDrawingTool();
        return (dt != null && dt.canEdit(omg.getClass()));
    }
View Full Code Here

    /**
     * Query for what text should be placed over the information bar when the
     * mouse is over a particular OMGraphic.
     */
    public String getInfoText(OMGraphic omg) {
        DrawingTool dt = getDrawingTool();
        if (dt != null && dt.canEdit(omg.getClass())) {
            return "Click to edit graphic.";
        } else {
            return null;
        }
    }
View Full Code Here

     * more than one OMGraphic being selected at a time.
     */
    public void select(OMGraphicList list) {
        if (list != null && list.size() > 0) {
            OMGraphic omg = list.getOMGraphicAt(0);
            DrawingTool dt = getDrawingTool();

            if (dt != null && dt.canEdit(omg.getClass())) {
                dt.setBehaviorMask(OMDrawingTool.QUICK_CHANGE_BEHAVIOR_MASK);
                if (dt.edit(omg, this) == null) {
                    // Shouldn't see this because we checked, but ...
                    fireRequestInfoLine("Can't figure out how to modify this object.");
                }
            }
        }
View Full Code Here

    /**
     * Query that an OMGraphic is selectable.
     */
    public boolean isSelectable(OMGraphic omg) {
        DrawingTool dt = getDrawingTool();
        return (shouldEdit(omg) && dt != null && dt.canEdit(omg.getClass()));
    }
View Full Code Here

    /**
     * Query for what text should be placed over the information bar when the
     * mouse is over a particular OMGraphic.
     */
    public String getInfoText(OMGraphic omg) {
        DrawingTool dt = getDrawingTool();
        if (dt != null && dt.canEdit(omg.getClass())) {
            return editInstruction;
        } else {
            return null;
        }
    }
View Full Code Here

TOP

Related Classes of com.bbn.openmap.tools.drawing.DrawingTool

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.