Package com.bbn.openmap.omGraphics

Examples of com.bbn.openmap.omGraphics.OMBitmap


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

        OMBitmap bitmap = null;
        float lat = 0;
        float lon = 0;
        int x = 0;
        int y = 0;
        int w = 0;
        int h = 0;
        int length;

        int renderType = dis.readByte();

        switch (renderType) {
        case RENDERTYPE_OFFSET:
            lat = dis.readFloat();
            lon = dis.readFloat();
            // Fall through...
        case RENDERTYPE_XY:
            x = dis.readInt();
            y = dis.readInt();
            break;
        case RENDERTYPE_LATLON:
        default:
            lat = dis.readFloat();
            lon = dis.readFloat();
        }

        w = dis.readInt();
        h = dis.readInt();
        length = dis.readInt();

        byte[] bytes = new byte[length];
        dis.readFully(bytes);

        switch (renderType) {
        case RENDERTYPE_OFFSET:
            bitmap = new OMBitmap(lat, lon, x, y, w, h, bytes);
            break;
        case RENDERTYPE_XY:
            bitmap = new OMBitmap(x, y, w, h, bytes);
            break;
        case RENDERTYPE_LATLON:
        default:
            bitmap = new OMBitmap(lat, lon, w, h, bytes);
        }

        if (bitmap != null) {
            LinkProperties properties = LinkProperties.loadPropertiesIntoOMGraphic(dis, bitmap, propertiesBuffer);
            bitmap.setRotationAngle((double) ProjMath.degToRad(PropUtils.floatFromProperties(properties,
                    LPC_LINKROTATION,
                    0.0f)));
        }

        return bitmap;
View Full Code Here


        for (int i = 0; i < bytearr.length; i++) {
            bytearr[i] = (byte) 0xffffffff;
        }

        OMBitmap omb = new OMBitmap(45.3583f, -71.06f, 16, 16, bytearr);
        omb.setLinePaint(Color.red);
        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);
View Full Code Here

TOP

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

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.