Examples of OMGraphic


Examples of com.bbn.openmap.omGraphics.OMGraphic

        if (list != null && dbfModel.getRowCount() > 0) {
            int numgraphics = list.size();

            for (int i = 0; i < numgraphics; i++) {
                try {
                    OMGraphic omg = list.getOMGraphicAt(i);
                    Integer recnum = (Integer) (omg.getAttribute(ShapeConstants.SHAPE_INDEX_ATTRIBUTE));
                    // OFF BY ONE!!! The shape record numbers
                    // assigned to the records start with 1, while
                    // everything else we do starts with 0...
                    Object inforec = dbfModel.getRecord(recnum.intValue() - 1);
                    omg.putAttribute(ShapeConstants.SHAPE_DBF_INFO_ATTRIBUTE,
                            inforec);
                } catch (ClassCastException cce) {
                    if (Debug.debugging("shape")) {
                        cce.printStackTrace();
                    }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGraphic

        String key = null;

        if (graphicList != null) {
            int size = graphicList.size();
            for (int i = 0; i < size; i++) {
                OMGraphic graphic = graphicList.getOMGraphicAt(i);
                // below should be a vector like [ "Massachusetts",
                // "MA" ];

                Object obj = graphic.getAttribute(ShapeConstants.SHAPE_DBF_INFO_ATTRIBUTE);
                if (obj == null) {
                    if (Debug.debugging("areas")) {
                        Debug.error("AreaHandler: No attributes for graphic #"
                                + i);
                    }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGraphic

     * @param n record number to read
     * @exception IOException
     * @since
     */
    void readAAT(E00Record r, int n) throws IOException {
        OMGraphic og;
        int type = Integer.MIN_VALUE;
        int val = Integer.MIN_VALUE;
        int itype = r.getItemIndex(prefix.substring(0, 2) + "LNTYPE");
        int ival = r.getItemIndex(prefix.substring(0, 2) + "LNVAL");
        int iID = r.getItemIndex(prefix.substring(0, 2) + "NET-ID");
        int ID = -1;
        for (int i = 0; i < n; i++) {
            r.read(isr);
            if ((itype == -1) && (ival == -1))
                continue;
            og = arcs.getOMGraphicAt(i);
            if (itype != -1) {
                type = r.getIntField(itype);
                og.setLinePaint(getArcPaint(type));
            }
            if (ival != -1)
                val = r.getIntField(ival);

            if (iID != -1)
                ID = r.getIntField(iID);

            E00Data data = (E00Data) og.getAppObject();
            data.type = type;
            data.valeur = val;
            data.valeur2 = val;
            data.ID = ID;
        }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGraphic

            if (entry.intersects(xmin, ymin, xmax, ymax)) {

                try {

                    OMGraphic omg = (OMGraphic) factory.makeEsriGraphicFromRecord(entry.getByteOffset(),
                            shp,
                            drawingAttributes,
                            pointIcon,
                            byteTracker);

                    if (omg != null) {

                        if (dbf != null) {
                            omg = dbf.evaluate(omg, labels, mapProj);

                            if (omg == null) {
                                // Failed dbf test, should be ignored.
                                continue;
                            }
                        }

                        if (mapProj != null) {
                            omg.generate(mapProj);
                        }
                        list.add(omg);
                    }

                } catch (IOException ioe) {
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGraphic

            OMGraphicList labels = new OMGraphicList();
            retList.add(labels);

            OMGraphicList testList = new OMGraphicList();
            for (Iterator it = retList.iterator(); it.hasNext();) {
                OMGraphic omg = (OMGraphic) it.next();

                if (omg != null) {

                    omg = dbf.evaluate(omg, labels, mapProj);

                    if (mapProj != null) {
                        omg.generate(mapProj);
                    }
                    testList.add(omg);
                }
            }
            retList = testList;
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGraphic

            graphics = new LinkOMGraphicList();
            setGraphicList(graphics);
        }

        Debug.message("link", "DrawLinkLayer mouseClicked");
        OMGraphic gesGraphic = null;

        LinkOMGraphicList selectableList = new LinkOMGraphicList();
        OMGraphic g;
        Properties p;
        String selectable;
        for (Iterator it = graphics.iterator(); it.hasNext();) {
            g = (OMGraphic) it.next();
            p = (Properties) g.getAppObject();
            selectable = p.getProperty(LPC_SELECTABLE);
            if (selectable.equals("true")) {
                selectableList.add(g);
            }
        }

        gesGraphic = selectableList.findClosest(e.getX(),
                e.getY(),
                distanceLimit);

        try {

            if (e == null) {
                graphics.deselectAll();
                return false;
            }

            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) {
                Debug.message("link", "LinkLayer: found gesture graphic");

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

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

                descriptor = LinkUtil.setMask(descriptor, GRAPHIC_ID_MASK);
                id = ((LinkProperties) gesGraphic.getAppObject()).getProperty(LPC_GRAPHICID);
            } else {
                Debug.message("link", "LinkLayer: gesture graphic NOT FOUND");
                // clear out info line
                fireRequestInfoLine("");
            }

            // server inform
            if (!LinkUtil.isMask(getGestureDescriptor(),
                    SERVER_NOTIFICATION_MASK)) {
                return false;
            }

            // Get the lat/lon point of the event
            LatLonPoint llpoint = getProjection().inverse(e.getX(), e.getY());

            // Don't need these anymore, look below for explaination
            // for asynchronous operation.
            // LinkActionList lal;
            // LinkActionRequest lar;

            ClientLink l = linkManager.getLink(false);

            // We'll check this here because we don't want to wait if
            // it is not available - it could be used for another
            // graphics or gui fetch.
            if (l == null) {
                Debug.message("link",
                        "LinkLayer: unable to get link in handleGesture().");
                return false;
            }

            // Using the link - carefully prevent others from using it
            // too!
            synchronized (l) {
                if (id != null) {
                    args.setProperty(LPC_GRAPHICID, id);
                } else {
                    // Reset this to prevent sending the id of a graphic
                    // that is not being clicked on.
                    args.remove(LPC_GRAPHICID);
                }

                // Send the query
                LinkActionRequest.write(descriptor,
                        e,
                        llpoint.getLatitude(),
                        llpoint.getLongitude(),
                        args,
                        l);

            }

            linkManager.finLink();

        } catch (IOException ioe) {
            System.err.println("LinkLayer: IOException contacting server during gesture handling!");
            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);
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGraphic

     * tool for modification if desired.
     */
    public boolean mouseClicked(MouseEvent e) {
        Debug.message("link", "AmpLinkLayer mouseClicked");
        LinkOMGraphicList graphics = getGraphicList(); // Get old list
        OMGraphic gesGraphic = null;

        gesGraphic = graphics.findClosest(e.getX(), e.getY(), distanceLimit);
        if (gesGraphic == null) {
            gesGraphic = extraGraphics.findClosest(e.getX(),
                    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) {
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGraphic

    /**
     * Extendable method to create specific subclasses of OMPolys.
     */
    public OMGraphic createGraphic(int renderType, int lineType) {
        OMGraphic g = null;
        switch (renderType) {
        case (OMGraphic.RENDERTYPE_LATLON):
            g = new OMDecoratedSpline(new float[0], OMGraphic.RADIANS, lineType);
            break;
        case (OMGraphic.RENDERTYPE_OFFSET):
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGraphic

    private void processPenWord(StringTokenizer st, Vector vals) {
        int width = Integer.parseInt(st.nextToken());
        /* int pattern = */Integer.parseInt(st.nextToken());
        Color col = convertColor(Integer.parseInt(st.nextToken()));
        int len = vals.size();
        OMGraphic omg = null;
        for (int i = 0; i < len; i++) {
            omg = (OMGraphic) vals.elementAt(i);
            omg.setLinePaint(col);
            omg.setStroke(new BasicStroke(width));
        }
    }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGraphic

//        if (st.hasMoreTokens()) {
//            background = convertColor(Integer.parseInt(st.nextToken()));
//        }
 
        int len = vals.size();
        OMGraphic omg;
        for (int i = 0; i < len; i++) {
            omg = (OMGraphic) vals.elementAt(i);
            omg.setLinePaint(foreground);

            switch (pattern) {
            case 1:
                break; // No fill so do nothing
            case 2:
                omg.setFillPaint(foreground);
                break;
            }
        }
    }
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.