Package com.bbn.openmap.omGraphics

Examples of com.bbn.openmap.omGraphics.OMArc


     * @throws IOException
     * @see com.bbn.openmap.omGraphics.OMArc
     */
    public static OMArc read(DataInputStream dis, LinkProperties propertiesBuffer) throws IOException {

        OMArc arc = null;
        float lat, lon, radius, start, extent;
        int x, y, w, h;

        int renderType = dis.readByte();

        switch (renderType) {
        case RENDERTYPE_LATLON:
            lat = dis.readFloat();
            lon = dis.readFloat();
            radius = dis.readFloat();
            start = dis.readFloat();
            extent = dis.readFloat();
            int units = dis.readByte();
            int nverts = dis.readInt();

            Length unit = Length.DECIMAL_DEGREE;

            switch (units) {
            case 0:
                unit = Length.KM;
                break;
            case 1:
                unit = Length.MILE;
                break;
            case 2:
                unit = Length.NM;
                break;
            default:
            }

            arc = new OMArc(new LatLonPoint(lat, lon), radius, unit, nverts, start, extent);
            break;
        case RENDERTYPE_XY:
            x = dis.readInt();
            y = dis.readInt();
            w = dis.readInt();
            h = dis.readInt();
            start = dis.readFloat();
            extent = dis.readFloat();

            arc = new OMArc(x, y, w, h, start, extent);
            break;
        case RENDERTYPE_OFFSET:
            lat = dis.readFloat();
            lon = dis.readFloat();
            x = dis.readInt();
            y = dis.readInt();
            w = dis.readInt();
            h = dis.readInt();
            start = dis.readFloat();
            extent = dis.readFloat();
            arc = new OMArc(lat, lon, x, y, w, h, start, extent);
            break;
        default:
        }

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


        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);
View Full Code Here

TOP

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

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.