Package com.bbn.openmap.proj

Examples of com.bbn.openmap.proj.Projection


                + HeightProperty, defaultHeight);
    }

    public synchronized OMGraphicList prepare() {
        int w, h, left_x = 0, right_x = 0, lower_y = 0, upper_y = 0;
        Projection projection = getProjection();
        OMGraphicList graphics = new OMGraphicList();

        w = projection.getWidth();
        h = projection.getHeight();
        if (locationXoffset < 0) {
            left_x = w + locationXoffset - width;
            right_x = w + locationXoffset;
        } else if (locationXoffset >= 0) {
            left_x = locationXoffset;
            right_x = locationXoffset + width;
        }
        if (locationYoffset < 0) {
            upper_y = h + locationYoffset - height;
            lower_y = h + locationYoffset;
        } else if (locationYoffset >= 0) {
            upper_y = locationYoffset;
            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);

        float dist = GreatCircle.spherical_distance(loc1.radlat_,
                loc1.radlon_,
                loc2.radlat_,
                loc2.radlon_);
View Full Code Here


    public void manageGraphics() {
        if (Debug.debugging("animationtester")) {
            Debug.output("AnimationTester.manageGraphics with " + nodes.size()
                    + " node(s).");
        }
        Projection p = getProjection();

        Iterator it = nodes.iterator();
        while (it.hasNext()) {
            GLPoint point = (GLPoint) it.next();
            point.moveRandomly(factor);
View Full Code Here

     * Part of the Layer/ProjectionListener thing. The internal MapBean's
     * projection gets set here, which forces the group layers to receive it as
     * well.
     */
    public void projectionChanged(com.bbn.openmap.event.ProjectionEvent pe) {
        Projection proj = setProjection(pe);

        if (proj != null && mapBean instanceof BLMapBean
                && hasTransparentBackground) {
            ((BLMapBean) mapBean).wipeImage();
        }
        mapBean.setProjection(proj == null ? proj : proj.makeClone());
    }
View Full Code Here

        if (isCancelled()) {
            Debug.message("dted", getName() + "|DTEDLayer.prepare(): aborted.");
            return null;
        }

        Projection projection = getProjection();

        if (projection == null) {
            Debug.error("DTED Layer needs to be added to the MapBean before it can draw images!");
            return new OMGraphicList();
        }

        if (cache == null) {
            Debug.output("DTEDLayer: Creating cache! (This is a one-time operation!)");
            cache = new DTEDCacheManager(paths, paths2, numColors, opaqueness);
            cache.setCacheSize(cacheSize);
            DTEDFrameSubframeInfo dfsi = new DTEDFrameSubframeInfo(viewType, bandHeight, dtedLevel, slopeAdjust);
            cache.setSubframeInfo(dfsi);
        }

        // Check to make sure the projection is EqualArc
        if (!(projection instanceof EqualArc)) {
            if (viewType != DTEDFrameSubframe.NOSHADING) {
                fireRequestInfoLine("  DTED requires an Equal Arc projection (CADRG/LLXY) to view images.");
                Debug.error("DTEDLayer: DTED requires an Equal Arc projection (CADRG/LLXY) to view images.");
            }
            return new OMGraphicList();
        }

        Debug.message("basic", getName() + "|DTEDLayer.prepare(): doing it");

        // Setting the OMGraphicsList for this layer. Remember, the
        // OMGraphicList is made up of OMGraphics, which are generated
        // (projected) when the graphics are added to the list. So,
        // after this call, the list is ready for painting.

        // call getRectangle();
        if (Debug.debugging("dted")) {
            Debug.output(getName() + "|DTEDLayer.prepare(): "
                    + "calling getRectangle " + " with projection: "
                    + projection + " ul = " + projection.getUpperLeft()
                    + " lr = " + projection.getLowerRight());
        }

        OMGraphicList omGraphicList;

        if (projection.getScale() < maxScale) {
            omGraphicList = cache.getRectangle((EqualArc) projection);
        } else {
            fireRequestInfoLine("  The scale is too small for DTED viewing.");
            Debug.error("DTEDLayer: scale (1:" + projection.getScale()
                    + ") is smaller than minimum (1:" + maxScale + ") allowed.");
            omGraphicList = new OMGraphicList();
        }
        /////////////////////
        // safe quit
View Full Code Here

    public boolean mousePressed(MouseEvent e) {
        return false;
    }

    public boolean mouseReleased(MouseEvent e) {
        Projection projection = getProjection();
        LatLonPoint ll = projection.inverse(e.getX(), e.getY());
        location = new DTEDLocation(e.getX(), e.getY());
        location.setElevation(cache.getElevation(ll.getLatitude(),
                ll.getLongitude()));
        location.generate(projection);
        repaint();
View Full Code Here

        return props;
    }

    public OMGraphicList prepare() {
        OMGraphicList list = getList();
        Projection proj = getProjection();
        if (list == null) {
            list = load();
        }
        if (list != null && proj != null) {
            list.generate(proj);
View Full Code Here

    }

    public synchronized OMGraphicList prepare() {

        OMGraphicList ret = null;
        Projection proj = getProjection();

        if (proj == null) {
            return ret;
        }
View Full Code Here

     *        attribute
     */
    protected void addMapContent(MapHandler mapHandler, BranchGroup worldGroup,
                                 int contentMask) {

        Projection projection = null;

        if (mapHandler != null) {

            MapBean mapBean = (MapBean) mapHandler.get("com.bbn.openmap.MapBean");

View Full Code Here

TOP

Related Classes of com.bbn.openmap.proj.Projection

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.