Package com.bbn.openmap.omGraphics

Examples of com.bbn.openmap.omGraphics.OMGraphic


        intersectionResultList.clear();
        ExtentIndex rIndex = getRegionIndex(true);

        for (Iterator it = drawnList.iterator(); it.hasNext();) {

            OMGraphic omg = (OMGraphic) it.next();

            if (omg instanceof OMLine
                    || (omg instanceof OMPoly && !((OMPoly) omg).isPolygon())) {

                if (DEBUG) {
View Full Code Here


    }

    public void select(OMGraphicList omgl) {
        for (Iterator it = omgl.iterator(); it.hasNext();) {

            OMGraphic omg = (OMGraphic) it.next();
            if (drawnList != null && drawnList.contains(omg)) {
                super.select(omgl);
            } else if (createPointCheck) {
                intersectionResultList.add(getPointIntersectionImage(omg));
            }
View Full Code Here

            long endTime = System.currentTimeMillis();
            if (countThisIteration) {
                results[0] += endTime - startTime;
            }

            OMGraphic omg = new OMLine(20f, -125f, 30f, -70f, OMGraphic.LINETYPE_GREATCIRCLE);
            getDrawnIntersectorList().add(omg);
            startTime = System.currentTimeMillis();
            calculateIntersectionsWithDrawnList();
            endTime = System.currentTimeMillis();
            if (countThisIteration) {
                results[1] += endTime - startTime;
            }

            setShowCrossingPoints(true);
            startTime = System.currentTimeMillis();
            calculateIntersectionsWithDrawnList();
            endTime = System.currentTimeMillis();
            if (countThisIteration) {
                results[2] += endTime - startTime;
            }

            getDrawnIntersectorList().clear();
            setShowCrossingPoints(false);
            float[] coords = new float[] { 33.4f, -77.2f, 34f, -79.5f, 35f,
                    -90f, 40f, -100f, 45f, -101f, 50f, -83.2f, 35f, -65.7f,
                    -34f, -70.5f, 33.4f, -77.2f };

            omg = new OMPoly(coords, OMPoly.DECIMAL_DEGREES, OMGraphic.LINETYPE_GREATCIRCLE);
            getDrawnIntersectorList().add(omg);
            startTime = System.currentTimeMillis();
            calculateIntersectionsWithDrawnList();
            endTime = System.currentTimeMillis();
            if (countThisIteration) {
                results[3] += endTime - startTime;
            }

            setShowCrossingPoints(true);
            startTime = System.currentTimeMillis();
            calculateIntersectionsWithDrawnList();
            endTime = System.currentTimeMillis();
            if (countThisIteration) {
                results[4] += endTime - startTime;
            }

            omg.setFillPaint(Color.red);
            setShowCrossingPoints(false);
            startTime = System.currentTimeMillis();
            calculateIntersectionsWithDrawnList();
            endTime = System.currentTimeMillis();
            if (countThisIteration) {
View Full Code Here

     * @param list the list containing the lines to change.
     * @param lineType the line type to cahnge the lines to.
     */
    protected void setLineTypeAndProject(OMGraphicList list, int lineType) {
        int size = list.size();
        OMGraphic graphic;
        for (int i = 0; i < size; i++) {
            graphic = list.getOMGraphicAt(i);
            graphic.setLineType(lineType);
            graphic.generate(getProjection());
        }
    }
View Full Code Here

                Debug.message("link",
                        "LinkLayer.handleLinkActionList: null GraphicUpdate, skipping...");
                continue;
            }

            OMGraphic gug = gu.graphic;
            OMGraphic reactionGraphic = null;
            int reactionGraphicIndex = Link.UNKNOWN;

            if (LinkUtil.isMask(gu.action, UPDATE_ADD_GRAPHIC_MASK)) {
                if (Debug.debugging("link")) {
                    Debug.output("LinkLayer.handleLinkActionList: adding graphic, id:"
                            + gu.id);
                }
                if (gug != null) {
                    gug.generate(proj);
                    graphics.add(gug);
                    reactionGraphic = gug;
                } else {
                    Debug.message("link",
                            "LinkLayer.handleLinkActionList: trying to add null OMGraphic, id: "
                                    + gu.id);
                }
            } else if (gu.id != null) {
                reactionGraphicIndex = graphics.getOMGraphicIndexWithId(gu.id);
                if (reactionGraphicIndex == Link.UNKNOWN) {
                    // Must be an addition/new graphic
                    if (LinkUtil.isMask(gu.action, UPDATE_ADD_GRAPHIC_MASK)) {
                        // If gu.graphic is null, this will throw an
                        // exception
                        if (Debug.debugging("link")) {
                            Debug.output("LinkLayer.handleLinkActionList: adding graphic "
                                    + gu.id);
                        }
                        if (gug != null) {
                            gug.generate(proj);
                            graphics.add(gug);
                            reactionGraphic = gug;
                        } else {
                            Debug.message("link",
                                    "LinkLayer.handleLinkActionList: trying to add null OMGraphic, id: "
                                            + gu.id);
                        }
                    } else {
                        gu.action = 0; // No action...
                        Debug.error("LinkLayer.handleLinkActionList: Gesture Response on an unknown graphic.");
                    }
                } else if (LinkUtil.isMask(gu.action, UPDATE_GRAPHIC_MASK)) {
                    if (gug != null) {
                        gug.generate(proj);
                        reactionGraphic = gug;
                    } else {
                        Debug.message("link",
                                "LinkLayer.handleLinkActionList: trying to update null OMGraphic, id: "
                                        + gu.id);
                    }
                } else {
                    reactionGraphic = graphics.getOMGraphicWithId(gu.id);
                }
            } else {
                Debug.error("LinkLayer.handleLinkActionList:  null ID for graphic");
            }

            // Now, perform the appropriate action on the graphic...

            // Delete a graphic... If you do this, nothing else
            // gets done on the graphic...
            if (LinkUtil.isMask(gu.action, MODIFY_DELETE_GRAPHIC_MASK)) {
                Debug.message("link", "LinkLayer: deleting graphic");
                graphics.removeOMGraphicAt(reactionGraphicIndex);
            } else {

                // For properties updating, or graphic replacement
                if (LinkUtil.isMask(gu.action, UPDATE_GRAPHIC_MASK)) {
                    Debug.message("link", "LinkLayer: updating graphic");
                    graphics.setOMGraphicAt(reactionGraphic,
                            reactionGraphicIndex);
                }

                // For graphic selection and deselection
                if (LinkUtil.isMask(gu.action, MODIFY_SELECT_GRAPHIC_MASK)) {
                    Debug.message("link", "LinkLayer: selecting graphic");
                    reactionGraphic.select();
                } else if (LinkUtil.isMask(gu.action,
                        MODIFY_DESELECT_GRAPHIC_MASK)) {
                    Debug.message("link", "LinkLayer: deselecting graphic");
                    reactionGraphic.deselect();
                }

                // Now, raising or lowering the graphic...
                if (LinkUtil.isMask(gu.action, MODIFY_RAISE_GRAPHIC_MASK)) {
                    Debug.message("link", "LinkLayer: raising graphic");
View Full Code Here

        try {
            LinkOMGraphicList graphics = getGraphicList(); // Get old
            // list

            OMGraphic gesGraphic = null;
            if (graphics == null) {
                // Nothing to search on - this condition occurs when
                // the layer is already busy getting new graphics as a
                // result of a changed projection.
                // It also occurs when the layer does not have any graphics
                // in it.
                Debug.message("link", "LinkLayer: null graphics list.");
            } else {
                if (e == null) {
                    graphics.deselectAll();
                    return false;
                }

                // Find out if a graphic is closeby...
                // int gesGraphicIndex = graphics.findIndexOfClosest(e.getX(),
                // e.getY(),
                // distanceLimit);

                // We need to do this to deselect everything else too.
                gesGraphic = graphics.selectClosest(e.getX(),
                        e.getY(),
                        distanceLimit);
            }

            String id = null;

            // If there was a graphic, set the mask to indicate that,
            // and keep track of the graphic and the list index of the
            // graphic for the response. If a graphic modify command
            // comes back without an ID, then we'll assume the server
            // was refering to this graphic.
            if (gesGraphic != null) {

                boolean tellServer = graphicGestureReaction(gesGraphic,
                        descriptor,
                        e);

                if (!tellServer) {
                    repaint();
                    return true;
                }

                // needRepaint = true; // Why? At this point, we
                // should wait to see what the server wants us to do,
                // we should only repaint if a graphic update comes
                // back.

                descriptor = LinkUtil.setMask(descriptor, GRAPHIC_ID_MASK);
                id = ((LinkProperties) gesGraphic.getAppObject()).getProperty(LPC_GRAPHICID);
            } else {
                // clear out info line
                fireRequestInfoLine("");
            }
View Full Code Here

                if (lsm2.isSelectionEmpty()) {
                    //no rows are selected
                } else {
                    int index = lsm2.getMinSelectionIndex();
                    EsriGraphicList list = layer.getEsriGraphicList();
                    OMGraphic graphic = list.getOMGraphicAt(index);
                    graphic.select();
                    list.generate(_mapBean.getProjection());
                    layer.repaint();
                }
            }
        });
View Full Code Here

            if (Debug.debugging("drawingtool")) {
                Debug.output("DTRL.drawingComplete(list)");
            }

            for (Iterator it = ((OMGraphicList) omg).iterator(); it.hasNext();) {
                OMGraphic omgi = (OMGraphic) it.next();
                dtr = (DrawingToolRequestor) table.get(omgi);
                if (dtr != null) {
                    if (Debug.debugging("drawingtool")) {
                        Debug.output("  notifying requestor for list member "
                                + omgi.getClass().getName());
                    }
                    dtr.drawingComplete(omgi, action);
                }
            }
        } else {
View Full Code Here

                                 boolean MouseDown) {

        boolean got_info = false;
        boolean got_the_stuff = false;
        boolean updated_graphics = false;
        OMGraphic moused = null;
        JGraphicList jjGraphics = (JGraphicList) getList();

        // Do this, so when there was a one-liner about a graphic (or
        // something) sent, and now there isn't a graphic associated
        // with the layer, to reset the message window to nothing, so
View Full Code Here

     * OMGraphic. A list is used in case underlying code is written to handle
     * 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

TOP

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

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.