Package com.bbn.openmap.omGraphics

Examples of com.bbn.openmap.omGraphics.GraphicAttributes


    public OMDrawingTool() {
        super();
        setBorder(BorderFactory.createEmptyBorder());
        DEBUG = Debug.debugging("drawingtool");
        selectionSupport = new SelectionSupport(this);
        setAttributes(new GraphicAttributes());
        setMouseMode(createMouseMode());

        // Shouldn't assume that the drawing tool is a tool. This can
        // be set in the properties if it should be. Otherwise, the
        // default action is to appear on a right click called from
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",
                                ga,
                                layer);
                        if (circle == null) {
View Full Code Here

            if (dt != null && currentCreation != null
                    && currentRequestor != null) {
                // Copy the default GraphicAttributes into another
                // copy...
                GraphicAttributes ga = (GraphicAttributes) defaultGraphicAttributes.clone();

                // fire it up!
                dt.setBehaviorMask(OMDrawingTool.DEFAULT_BEHAVIOR_MASK);
                dt.create(currentCreation, ga, currentRequestor);
            } else {
View Full Code Here

        return list;
    }

    protected GraphicAttributes getFilterGA() {
        if (filterGA == null) {
            filterGA = new GraphicAttributes();
            filterGA.setLinePaint(Color.red);
            filterGA.setRenderType(OMGraphic.RENDERTYPE_LATLON);
            filterGA.setLineType(OMGraphic.LINETYPE_GREATCIRCLE);
            BasicStroke filterStroke = new BasicStroke(1f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER, 10f, new float[] {
                    3, 3 }, 0f);
View Full Code Here

        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",
                            fga,
                            layer,
                            false);
View Full Code Here

TOP

Related Classes of com.bbn.openmap.omGraphics.GraphicAttributes

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.