Package com.bbn.openmap.omGraphics

Examples of com.bbn.openmap.omGraphics.OMPoint


     * feature.
     */
    public void createNode(CoverageTable c, NodeTable t, List nodeprim,
                           float latitude, float longitude,
                           boolean isEntityNode, String featureType) {
        OMPoint pt = createOMPoint(latitude, longitude);
        int id = ((Integer) nodeprim.get(0)).intValue();
        setAttributesForFeature(pt, c, featureType, id);
        //        getAttributesForFeature(featureType).setTo(pt);
        addPoint(pt);
    }
View Full Code Here


            Geo g1 = new Geo(ll[0], ll[1]);
            Geo g2 = new Geo(ll[2], ll[3]);

            Geo gc = g1.crossNormalize(g2);

            OMPoint p = new OMPoint((float) gc.getLatitude(), (float) gc.getLongitude(), 3);
            p.setLinePaint(line.getLinePaint());
            p.setFillPaint(line.getFillPaint());
            p.setStroke(line.getStroke());

            line.addArrowHead(true);

            list.add(line);
            list.add(p);

            if (oldLine != null) {

                float[] ll2 = oldLine.getLL();
                Geo g3 = new Geo(ll2[0], ll2[1]);
                Geo g4 = new Geo(ll2[2], ll2[3]);

                OMLine line2 = new OMLine((float) ogc.getLatitude(), (float) ogc.getLongitude(), (float) gc.getLatitude(), (float) gc.getLongitude(), OMGraphic.LINETYPE_GREATCIRCLE);
                line2.setLinePaint(line.getLinePaint());
                line2.setStroke(new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0f, new float[] {
                        10, 10 }, 0f));
                line2.addArrowHead(true);
                list.add(line2);

                Geo i = gc.crossNormalize(ogc);

                if (!(Intersection.isOnSegment(g1, g2, i) || Intersection.isOnSegment(g3,
                        g4,
                        i))) {
                    i = i.antipode();
                }

                p = new OMPoint((float) i.getLatitude(), (float) i.getLongitude(), 3);
                p.setOval(true);
                p.setLinePaint(line.getLinePaint());
                p.setFillPaint(Color.white);
                p.setStroke(line.getStroke());

                list.add(p);
            }

            oldLine = line;
View Full Code Here

        _leos.writeDouble(0.0);
        _leos.writeDouble(0.0);
        _leos.writeDouble(0.0);

        for (int i = 0; i < list.size(); i++) {
            OMPoint point = (OMPoint) list.getOMGraphicAt(i);
            LatLonPoint pt = new LatLonPoint(point.getLat(), point.getLon());

            // Record header...
            _leos.writeInt(i + 1); // Record numbers start with 1
            _leos.writeInt(indexData[1][i]);
View Full Code Here

    /**
     * Create the graphics.
     */
    protected OMGraphicList generateGraphics() {
        OMGraphicList omgraphics = new OMGraphicList();
        OMPoint circ;
        OMText text;

        int circle_r = 2;
        int circle_h = 5;

        for (int i = 0, j = 0; i < llData.length; i += 2, j++) {

            // grouping
            OMGraphicList group = new OMGraphicList(2);

            // XY-Circle at LatLonPoint
            circ = new OMPoint(llData[i], llData[i + 1], circle_r);
            circ.setOval(true);
            circ.setFillPaint(lineColor);
            group.add(circ);

            // Info
            text = new OMText(llData[i], llData[i + 1], 0, circle_h + 10, infoData[j], java.awt.Font.decode("SansSerif"), OMText.JUSTIFY_CENTER);
            text.setLinePaint(lineColor);
View Full Code Here

            logger.info("road # " + roadsMade + " " + road + " has " + nPoints
                    + " points");
        }

        if (!showLines && drawIntersections) {
            OMPoint point = new YellowPoint(xpoints[0], ypoints[0], 10);
            toDraw.add(point);
        }

        for (int i = 1; i < nPoints - 1; i++) {
            roadPoints[i - 1] = new RoadPoint(road, createLatLonPoint(xpoints[i],
                    ypoints[i]), this);
            if (drawIntersections) {
                if (showLines) {
                    OMLine line = new YellowLine(xpoints[i - 1], ypoints[i - 1], xpoints[i], ypoints[i], width);
                    toDraw.add(line);
                    toDraw.add(new OMText((xpoints[i - 1] - xpoints[i]) / 2
                            + xpoints[i - 1], (ypoints[i - 1] - ypoints[i]) / 2
                            + ypoints[i - 1] - 5, "" + roadsMade, 0));
                } else {
                    OMPoint point = new YellowPoint(xpoints[i], ypoints[i], 10);
                    toDraw.add(point);
                }
            }
        }

        if (drawIntersections) {
            if (showLines) {
                OMLine line = new YellowLine(xpoints[nPoints - 2], ypoints[nPoints - 2], xpoints[nPoints - 1], ypoints[nPoints - 1], width);
                toDraw.add(line);
                toDraw.add(new OMText((xpoints[nPoints - 2] - xpoints[nPoints - 1])
                        / 2 + xpoints[nPoints - 2], (ypoints[nPoints - 2] - ypoints[nPoints - 1])
                        / 2 + ypoints[nPoints - 2] - 5, "" + roadsMade, 0));
                line.addArrowHead(true);
            } else {
                OMPoint point = new YellowPoint(xpoints[nPoints - 1], ypoints[nPoints - 1], 10);
                toDraw.add(point);
            }
        }

        if (to == from && nPoints == 2) {
View Full Code Here

    public List displayPathOnRoad(Point start, Point end, Route route,
                                  List segments) {
        List newPoints;
        try {
            if (route == null) {
                OMPoint point = new RedPoint(start.x, start.y, 5);
                toDraw.add(point);
                point = new RedPoint(end.x, end.y, 5);
                toDraw.add(point);

                return null;
            }

            if (drawResults) {
                OMPoint point = new YellowPoint(start.x, start.y, 10);
                toDraw.add(point);
                point = new YellowPoint(end.x, end.y, 10);
                toDraw.add(point);
            }
View Full Code Here

                while (crssngs != null && crssngs.hasNext()) {
                    BoundaryCrossing bc = (BoundaryCrossing) crssngs.next();
                    Geo geo = bc.getGeo();

                    OMPoint pgeo = new OMPoint((float) geo.getLatitude(), (float) geo.getLongitude());
                    pgeo.setFillPaint(Color.WHITE);
                    pgeo.putAttribute(OMGraphic.LABEL,
                            new OMTextLabeler(Integer.toString(num++)));
                    intersectionResultList.add(pgeo);
                }

            } else if (omg instanceof OMPoly) {
                for (Iterator hits = Intersection.intersect(new OMPolyRegion((OMPoly) omg),
                        rIndex); hits.hasNext();) {
                    setRegionAsSelected((OMPolyRegion) hits.next());

                    if (DEBUG) {
                        Debug.output("GeoIntersectLayer(" + getName()
                                + "): Set Poly for hit");
                    }
                }
            } else if (omg instanceof OMPoint) {
                OMPoint omp = (OMPoint) omg;
                for (Iterator hits = Intersection.intersect(new GeoPoint.Impl(omp.getLat(), omp.getLon()),
                        rIndex); hits.hasNext();) {
                    setRegionAsSelected((OMPolyRegion) hits.next());

                    if (DEBUG) {
                        Debug.output("GeoIntersectLayer(" + getName()
View Full Code Here

     * @see com.bbn.openmap.omGraphics.OMPoint
     */
    public static OMPoint read(DataInputStream dis,
                               LinkProperties propertiesBuffer)
            throws IOException {
        OMPoint point = null;
        int x1, y1, radius;
        float lt, ln;

        int renderType = dis.readByte();

        switch (renderType) {
        case RENDERTYPE_LATLON:
            lt = dis.readFloat();
            ln = dis.readFloat();
            radius = dis.readInt();

            point = new OMPoint(lt, ln, radius);
            break;
        case RENDERTYPE_XY:
            x1 = dis.readInt();
            y1 = dis.readInt();
            radius = dis.readInt();

            point = new OMPoint(x1, y1, radius);
            break;
        case RENDERTYPE_OFFSET:
            lt = dis.readFloat();
            ln = dis.readFloat();

            x1 = dis.readInt();
            y1 = dis.readInt();
            radius = dis.readInt();

            point = new OMPoint(lt, ln, x1, y1, radius);
            break;
        default:
        }

        if (point != null) {
            propertiesBuffer = LinkProperties.loadPropertiesIntoOMGraphic(dis,
                    point,
                    propertiesBuffer);

            if (propertiesBuffer != null) {
                point.setOval(PropUtils.booleanFromProperties(propertiesBuffer,
                        LPC_POINT_OVAL,
                        OMPoint.DEFAULT_ISOVAL));
            }
        }

View Full Code Here

        omb.setFillPaint(null);
        omb.setSelectPaint(Color.blue);
        omb.setRotationAngle(Math.PI / 2);
        omList.add(omb);

        OMPoint point = new OMPoint(42f, -72f, 14);
        point.setFillPaint(Color.green);
        point.setOval(true);
        omList.add(point);

        OMCircle circle = new OMCircle(40f, -70f, 50, 200);
        circle.setRotationAngle(com.bbn.openmap.MoreMath.HALF_PI / 2f);
        circle.putAttribute(OMGraphicConstants.LABEL,
                new OMTextLabeler("Circle Label", OMText.JUSTIFY_CENTER));
        omList.add(circle);

        int[] llPointsx = new int[5];
        int[] llPointsy = new int[5];
        llPointsy[0] = 10;
        llPointsx[0] = 170;
        llPointsy[1] = 42;
        llPointsx[1] = 273;
        llPointsy[2] = 38;
        llPointsx[2] = 374;
        llPointsy[3] = 78;
        llPointsx[3] = 468;
        llPointsy[4] = 84;
        llPointsx[4] = 369;

        LabeledOMSpline spline = new LabeledOMSpline(40f, -72, llPointsx, llPointsy, OMPoly.COORDMODE_ORIGIN);
        spline.setText("Testing");
        spline.setLocateAtCenter(true);
        // spline.setIndex(2);
        omList.add(spline);

        OMSpline spline2 = new OMSpline(llPointsx, llPointsy);
        spline2.putAttribute(OMGraphicConstants.LABEL,
                new OMTextLabeler("Spline Label"));
        spline2.setLinePaint(Color.green);
        omList.add(spline2);

        float[] llPoints = { 55.0f, -10.0f, 50.0f, -5.0f, 45.0f, -7.0f, 43.0f,
                -12.0f, 55.0f, -10.0f };
        OMDecoratedSpline omds = new OMDecoratedSpline(llPoints, OMSpline.DECIMAL_DEGREES, OMSpline.LINETYPE_STRAIGHT);
        ShapeDecorator sd = new ShapeDecorator();
        sd.addDecoration(new LineShapeDecoration(5, com.bbn.openmap.omGraphics.OMColor.clear));
        sd.addDecoration(new IceAreaShapeDecoration(7, 7, IceAreaShapeDecoration.RIGHT));
        omds.setDecorator(sd);
        omList.add(omds);

        llPoints = new float[] { 56.0f, -11.0f, 51.0f, -6.0f, 46.0f, -8.0f,
                44.0f, -13.0f, 56.0f, -11.0f };
        omds = new OMDecoratedSpline(llPoints, OMSpline.DECIMAL_DEGREES, OMSpline.LINETYPE_STRAIGHT);
        sd = new ShapeDecorator();
        sd.addDecoration(new LineShapeDecoration(3, com.bbn.openmap.omGraphics.OMColor.clear));
        sd.addDecoration(new CircleShapeDecoration(5, 5, Color.blue));
        omds.setDecorator(sd);
        omList.add(omds);

        llPoints = new float[] { 57.0f, -12.0f, 52.0f, -7.0f, 47.0f, -9.0f,
                45.0f, -14.0f, 57.0f, -12.0f };
        omds = new OMDecoratedSpline(llPoints, OMSpline.DECIMAL_DEGREES, OMSpline.LINETYPE_STRAIGHT);
        sd = new ShapeDecorator();
        sd.addDecoration(new LineShapeDecoration(2, com.bbn.openmap.omGraphics.OMColor.clear));
        sd.addDecoration(new CircleShapeDecoration(5, 5, Color.red));
        sd.addDecoration(new LineShapeDecoration(2, com.bbn.openmap.omGraphics.OMColor.clear));
        sd.addDecoration(new LineShapeDecoration(15, Color.red));
        omds.setDecorator(sd);
        omList.add(omds);

        float[] llPoints2 = { 55.0f, -12.0f, 50.0f, -7.0f, 45.0f, -9.0f, 43.0f,
                -14.0f };
        OMHotSurfaceFront hf = new OMHotSurfaceFront(llPoints2, OMSpline.DECIMAL_DEGREES, OMSpline.LINETYPE_STRAIGHT);
        omList.add(hf);
        float[] llPoints3 = { 55.0f, -14.0f, 50.0f, -9.0f, 45.0f, -11.0f,
                43.0f, -16.0f };
        OMOcclusion oc = new OMOcclusion(llPoints3, OMSpline.DECIMAL_DEGREES, OMSpline.LINETYPE_STRAIGHT);
        omList.add(oc);

        // float[] llPoints4 = { 55.0f, -16.0f, 50.0f, -11.0f, 45.0f,
        // -13.0f,
        // 43.0f, -18.0f };
        // OMSpline spline3 = new OMDecoratedSpline(llPoints4,
        // OMSpline.DECIMAL_DEGREES, OMSpline.LINETYPE_STRAIGHT) {
        // protected void initDecorations() {
        //
        // getDecorator().addDecoration(new TextShapeDecoration(" This
        // one has a text ", new Font("arial", Font.PLAIN, 10),
        // TextShapeDecoration.LEFT_TO_RIGHT
        // + TextShapeDecoration.FOLLOW_POLY,
        // TextShapeDecoration.CENTER));
        // }
        // };
        // omList.add(spline3);

        OMLine line = new OMLine(40f, -75f, 42f, -70f, OMGraphic.LINETYPE_GREATCIRCLE);
        // line.addArrowHead(true);
        line.addArrowHead(OMArrowHead.ARROWHEAD_DIRECTION_BOTH);
        line.setStroke(new BasicStroke(2));
        line.putAttribute(OMGraphicConstants.LABEL,
                new OMTextLabeler("Line Label"));

        omList.add(line);

        OMGraphicList pointList = new OMGraphicList();
        for (int i = 0; i < 100; i++) {
            point = new OMPoint((float) (Math.random() * 89f), (float) (Math.random() * -179f), 3);
            point.setSelectPaint(Color.yellow);
            pointList.add(point);
        }
        omList.add(pointList);

        OMEllipse ell = new OMEllipse(new LatLonPoint(60f, -110), 1000, 300, Length.NM, com.bbn.openmap.MoreMath.HALF_PI / 2.0);
View Full Code Here

            Debug.output("Location Lat/Lon(" + latitude + ", " + longitude
                    + ", " + name + ")");
        }

        if (locationMarker == null) {
            location = new OMPoint(lat, lon);
        } else {
            location = locationMarker;
        }

        // We can do the x offset off the location here, we'll do the
View Full Code Here

TOP

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

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.