Examples of OMLine


Examples of com.bbn.openmap.omGraphics.OMLine

     */
    public static OMLine read(DataInputStream dis,
                              LinkProperties propertiesBuffer)
            throws IOException {

        OMLine line = null;

        float lat_1 = 0.0f;
        float lon_1 = 0.0f;
        float lat_2 = 0.0f;
        float lon_2 = 0.0f;

        int x1 = 0;
        int y1 = 0;
        int x2 = 0;
        int y2 = 0;
        int nsegs = -1;

        int renderType = dis.readByte();

        switch (renderType) {
        case RENDERTYPE_LATLON:
            int lineType = dis.readByte();
            lat_1 = dis.readFloat();
            lon_1 = dis.readFloat();
            lat_2 = dis.readFloat();
            lon_2 = dis.readFloat();
            nsegs = dis.readInt();

            line = new OMLine(lat_1, lon_1, lat_2, lon_2, lineType, nsegs);
            break;
        case RENDERTYPE_XY:
            x1 = dis.readInt();
            y1 = dis.readInt();
            x2 = dis.readInt();
            y2 = dis.readInt();

            line = new OMLine(x1, y1, x2, y2);
            break;
        case RENDERTYPE_OFFSET:
            lat_1 = dis.readFloat();
            lon_1 = dis.readFloat();
            x1 = dis.readInt();
            y1 = dis.readInt();
            x2 = dis.readInt();
            y2 = dis.readInt();

            line = new OMLine(lat_1, lon_1, x1, y1, x2, y2);
            break;
        default:
        }

        if (line != null) {
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMLine

            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

Examples of com.bbn.openmap.omGraphics.OMLine

        // Used to calculate the pieces of the vertical lines.
        UTMPoint utmp = new UTMPoint(utm);
        LatLonPoint llp = new LatLonPoint();

        int i;
        OMLine line;
        BasicGeometry poly;

        float lat2;
        int endNorthing = (int) Math.floor(utm.northing / INTERVAL_100K) + 10;
        int startNorthing = (int) Math.floor(utm.northing / INTERVAL_100K) - 10;

        int numVertLines = 9;
        int numHorLines = endNorthing - startNorthing;

        float[][] vertPoints = new float[numVertLines][numHorLines * 2];

        if (UTM_DEBUG_VERBOSE) {
            Debug.output("Array is [" + vertPoints.length + "]["
                    + vertPoints[0].length + "]");
        }

        int coordCount = 0;
        boolean doPolys = true;

        utm1.easting = INTERVAL_100K;
        utm2.easting = 9 * INTERVAL_100K;

        // Horizontal lines
        for (i = startNorthing; i < endNorthing; i++) {
            utm1.northing = (float) i * gridLineInterval;
            utm2.northing = utm1.northing;
            utmp.northing = utm1.northing;

            if (doPolys) {
                for (int j = 0; j < numVertLines; j++) {
                    utmp.easting = (float) (j + 1) * gridLineInterval;
                    llp = utmp.toLatLonPoint(Ellipsoid.WGS_84, llp);

                    vertPoints[j][coordCount] = llp.getLatitude();
                    vertPoints[j][coordCount + 1] = llp.getLongitude();

                    if (UTM_DEBUG_VERBOSE) {
                        Debug.output("for vline " + j + ", point " + i
                                + ", easting: " + utmp.easting + ", northing: "
                                + utmp.northing + ", lat:"
                                + vertPoints[j][coordCount] + ", lon:"
                                + vertPoints[j][coordCount + 1]);
                    }
                }
                coordCount += 2;
            }

            point1 = utm1.toLatLonPoint(Ellipsoid.WGS_84, point1);
            point2 = utm2.toLatLonPoint(Ellipsoid.WGS_84, point2);

            lat2 = point1.getLatitude();

            if (lat2 < 84f) {
                line = new OMLine(point1.getLatitude(), point1.getLongitude(), point2.getLatitude(), point2.getLongitude(), OMGraphic.LINETYPE_GREATCIRCLE);
                line.setLinePaint(distanceGridPaint);
                list.add(line);
            }
        }

        if (doPolys) {
            OMGeometryList polys = new OMGeometryList();
            for (i = 0; i < vertPoints.length; i++) {
                if (UTM_DEBUG_VERBOSE) {
                    for (int k = 0; k < vertPoints[i].length; k += 2) {
                        System.out.println(" for poly " + i + ": lat = "
                                + vertPoints[i][k] + ", lon = "
                                + vertPoints[i][k + 1]);
                    }
                }
                poly = new PolylineGeometry.LL(vertPoints[i], OMGraphic.DECIMAL_DEGREES, OMGraphic.LINETYPE_GREATCIRCLE);
                polys.add(poly);
            }
            polys.setLinePaint(distanceGridPaint);
            list.add(polys);
        } else {

            // This doesn't seem to calculate the right
            // lines, although it looks like it should.

            if (UTM_DEBUG) {
                Debug.output("Doing vertical lines");
            }

            utm1.northing = startNorthing;
            utm2.northing = endNorthing;

            // Vertical lines
            for (i = 1; i <= 9; i++) {
                utm1.easting = i * 100000f;
                utm2.easting = i * 100000f;

                point1 = utm1.toLatLonPoint(Ellipsoid.WGS_84, point1);
                point2 = utm2.toLatLonPoint(Ellipsoid.WGS_84, point2);

                line = new OMLine(point1.getLatitude(), point1.getLongitude(), point2.getLatitude(), point2.getLongitude(), OMGraphic.LINETYPE_GREATCIRCLE);
                line.setLinePaint(distanceGridPaint);
                list.add(line);
            }
        }

        return list;
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMLine

            this.details = details;
        } else {
            this.details = "";
        }

        OMLine link = new OMLine(lat1, lon1, lat2, lon2, linetype);
        setLinkDrawingParameters(link, paint, thickness, dashed);
        setLocationMarker(link);
    }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMLine

            this.details = details;
        } else {
            this.details = "";
        }

        OMLine link = new OMLine(x1, y1, x2, y2);
        setLinkDrawingParameters(link, paint, thickness, dashed);
        setLocationMarker(link);
    }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMLine

        this.lat = lat1;
        this.lon = lon1;
        this.lat2 = lat2;
        this.lon2 = lon2;

        OMLine line = (OMLine) getLocationMarker();
        float[] locs = { lat1, lon1, lat2, lon2 };
        line.setLL(locs);
    }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMLine

        int xy[] = new int[4];
        xy[0] = this.x = x1;
        xy[1] = this.y = y1;
        xy[2] = this.x2 = x2;
        xy[3] = this.y2 = y2;
        OMLine link = getLink();
        link.setPts(xy);
        link.setRenderType(RENDERTYPE_XY);
    }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMLine

        // 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);

        ell.setLinePaint(Color.blue);
        // ell.setFillPaint(Color.yellow);
        omList.add(ell);

        ell = new OMEllipse(new LatLonPoint(40f, -75), 800, 250, Length.MILE, 0);

        ell.setFillPaint(Color.yellow);
        omList.add(ell);

        float[] llp2 = new float[] { 0.41789755f, -1.435303f, 0.41813868f,
                -1.3967744f };

        OMPoly p2 = new OMPoly(llp2, OMGraphic.RADIANS, OMGraphic.LINETYPE_RHUMB);
        p2.setLinePaint(Color.yellow);
        omList.add(p2);

        // OMArc arc = new OMArc(40f, 65f, 750f, Length.MILE, 20f,
        // 95f);
        OMArc arc = new OMArc((float) 40.0, (float) 65.0, (float) 750.0, Length.MILE, (float) 20.0, (float) 95.0);
        arc.setLinePaint(Color.red);
        arc.setFillPaint(new Color(120, 0, 0, 128));
        arc.setArcType(java.awt.geom.Arc2D.PIE);
        arc.putAttribute(OMGraphicConstants.LABEL,
                new OMTextLabeler("Arc Label", OMText.JUSTIFY_CENTER));
        omList.add(arc);

        OMAreaList combo = new OMAreaList();

        combo.addOMGraphic(new OMLine((float) 50.453333, (float) 5.223889, (float) 50.375278, (float) 4.873889, 2));
        combo.addOMGraphic(new OMLine((float) 50.375278, (float) 4.873889, (float) 50.436944, (float) 4.860556, 2));
        // combo.addOMGraphic(new OMLine((float) 50.436944, (float)
        // 4.860556, (float) 50.436667, (float) 4.860833, 2));
        // combo.addOMGraphic(new OMLine((float) 50.436667, (float)
        // 4.860833, (float) 50.490833, (float) 4.847778, 2));
        // combo.addOMGraphic(new OMLine((float) 50.491269, (float)
        // 4.704239, (float) 50.490833, (float) 4.847778, 3));
        combo.addOMGraphic(new OMArc((float) 50.491269, (float) 4.704239, (float) 0.09168520552327833, (float) (28.201865385183652 + 90.21758717585848), (float) -90.21758717585848));
        combo.addOMGraphic(new OMLine((float) 50.534167, (float) 4.831111, (float) 50.640833, (float) 4.832222, 2));
        combo.addOMGraphic(new OMLine((float) 50.640833, (float) 4.832222, (float) 50.547778, (float) 5.223889, 2));
        combo.addOMGraphic(new OMLine((float) 50.547778, (float) 5.223889, (float) 50.453333, (float) 5.223889, 2));

        // combo.setConnectParts(true);
        // combo.addOMGraphic(new OMLine(30f, -125f, 30f, -100f,
        // OMGraphic.LINETYPE_RHUMB));
        // combo.addOMGraphic(new OMLine(30f, -100f, 40f, -95f,
        // OMGraphic.LINETYPE_GREATCIRCLE));
        // combo.addOMGraphic(new OMLine(40f, -95f, 50f, -145f,
        // OMGraphic.LINETYPE_GREATCIRCLE));
        // combo.addOMGraphic(new OMLine(50f, -145f, 30f, -125f,
        // OMGraphic.LINETYPE_STRAIGHT));
        combo.setLinePaint(Color.blue);
        combo.setFillPaint(Color.green);
        omList.add(combo);

        OMAreaList combo1 = new OMAreaList();
        combo1.addOMGraphic(new OMLine(66.618519f, 141.563497f, 66.028244f, 140.193964f, OMGraphic.LINETYPE_GREATCIRCLE));
        combo1.addOMGraphic(new OMLine(66.028244f, 140.193964f, 66.968058f, 137.611042f, OMGraphic.LINETYPE_RHUMB));
        combo1.addOMGraphic(new OMLine(66.968058f, 137.611042f, 67.558261f, 139.033958f, OMGraphic.LINETYPE_GREATCIRCLE));
        combo1.addOMGraphic(new OMLine(67.558261f, 139.033958f, 66.618519f, 141.563497f, OMGraphic.LINETYPE_RHUMB));
        combo1.setLinePaint(Color.red);
        combo1.setFillPaint(Color.blue);
        omList.add(combo1);

        combo1 = new OMAreaList();
        combo1.addOMGraphic(new OMLine(65.495278f, 55.488889f, 65.022778f, 55.749167f, OMGraphic.LINETYPE_GREATCIRCLE));
        combo1.addOMGraphic(new OMLine(65.022778f, 55.749167f, 64.970278f, 55.208611f, OMGraphic.LINETYPE_RHUMB));
        combo1.addOMGraphic(new OMLine(64.970278f, 55.208611f, 65.442778f, 54.948889f, OMGraphic.LINETYPE_GREATCIRCLE));
        combo1.addOMGraphic(new OMLine(65.442778f, 54.948889f, 65.495278f, 55.488889f, OMGraphic.LINETYPE_RHUMB));
        combo1.setLinePaint(Color.blue);
        combo1.setFillPaint(Color.red);
        omList.add(combo1);

        // OMArc arc1 = new OMArc(100, 100, 200, 200, 0f, -45f);
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMLine

            lower_y = locationYoffset + height;
        }

        graphics.clear();

        OMLine line = new OMLine(left_x, lower_y, right_x, lower_y);
        line.setLinePaint(lineColor);
        graphics.add(line);

        line = new OMLine(left_x, lower_y, left_x, upper_y);
        line.setLinePaint(lineColor);
        graphics.add(line);

        line = new OMLine(right_x, lower_y, right_x, upper_y);
        line.setLinePaint(lineColor);
        graphics.add(line);

        LatLonPoint loc1 = projection.inverse(left_x, lower_y);
        LatLonPoint loc2 = projection.inverse(right_x, lower_y);
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMLine

         */

        OMGraphicList omList = new OMGraphicList();

        // Add an OMLine
        OMLine line = new OMLine(40f, -75f, 42f, -70f, OMGraphic.LINETYPE_GREATCIRCLE);
        line.setStroke(new BasicStroke(2));
        line.putAttribute(OMGraphicConstants.LABEL,
                new OMTextLabeler("Line Label"));
        line.setLinePaint(Color.red);
        line.setSelectPaint(Color.blue);
        line.putAttribute(OMGraphicConstants.TOOLTIP, "This is an OMLine.");

        omList.add(line);

        // Add a list of OMPoints.
        OMGraphicList pointList = new OMGraphicList();
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.