Package org.openstreetmap.josm.data

Examples of org.openstreetmap.josm.data.ProjectionBounds


    }

    public void visit(EastNorth eastNorth) {
        if (eastNorth != null) {
            if (bounds == null) {
                bounds = new ProjectionBounds(eastNorth);
            } else {
                bounds.extend(eastNorth);
            }
        }
    }
View Full Code Here


    public void enlargeBoundingBox(double enlargeDegree) {
        if (bounds == null)
            return;
        LatLon minLatlon = Main.getProjection().eastNorth2latlon(bounds.getMin());
        LatLon maxLatlon = Main.getProjection().eastNorth2latlon(bounds.getMax());
        bounds = new ProjectionBounds(
                Main.getProjection().latlon2eastNorth(new LatLon(minLatlon.lat() - enlargeDegree, minLatlon.lon() - enlargeDegree)),
                Main.getProjection().latlon2eastNorth(new LatLon(maxLatlon.lat() + enlargeDegree, maxLatlon.lon() + enlargeDegree)));
    }
View Full Code Here

                center.east() + (x - getWidth()/2.0)*scale,
                center.north() - (y - getHeight()/2.0)*scale);
    }

    public ProjectionBounds getProjectionBounds() {
        return new ProjectionBounds(
                new EastNorth(
                        center.east() - getWidth()/2.0*scale,
                        center.north() - getHeight()/2.0*scale),
                        new EastNorth(
                                center.east() + getWidth()/2.0*scale,
 
View Full Code Here

    }

    /* FIXME: replace with better method - used by MapSlider */
    public ProjectionBounds getMaxProjectionBounds() {
        Bounds b = getProjection().getWorldBoundsLatLon();
        return new ProjectionBounds(getProjection().latlon2eastNorth(b.getMin()),
                getProjection().latlon2eastNorth(b.getMax()));
    }
View Full Code Here

        zoomTo(box.getCenter(), newScale);
    }

    public void zoomTo(Bounds box) {
        zoomTo(new ProjectionBounds(getProjection().latlon2eastNorth(box.getMin()),
                getProjection().latlon2eastNorth(box.getMax())));
    }
View Full Code Here

    @Override
    public void propertyChange(PropertyChangeEvent evt) {
        if (getModel().getValueIsAdjusting()) return;

        ProjectionBounds world = this.mv.getMaxProjectionBounds();
        ProjectionBounds current = this.mv.getProjectionBounds();

        double cur_e = current.maxEast-current.minEast;
        double cur_n = current.maxNorth-current.minNorth;
        double e = world.maxEast-world.minEast;
        double n = world.maxNorth-world.minNorth;
View Full Code Here

    @Override
    public void stateChanged(ChangeEvent e) {
        if (preventChange) return;

        ProjectionBounds world = this.mv.getMaxProjectionBounds();
        double fact = Math.pow(1.1, getValue());
        double es = world.maxEast-world.minEast;
        double n = world.maxNorth-world.minNorth;

        this.mv.zoomTo(new ProjectionBounds(this.mv.getCenter(), es/fact, n/fact));
    }
View Full Code Here

        this.sharpenLevel = PROP_SHARPEN_LEVEL.get();
    }

    public double getPPD(){
        if (!Main.isDisplayingMapView()) return Main.getProjection().getDefaultZoomInPPD();
        ProjectionBounds bounds = Main.map.mapView.getProjectionBounds();
        return Main.map.mapView.getWidth() / (bounds.maxEast - bounds.minEast);
    }
View Full Code Here

            changeResolution(this, true);
        }

        settingsChanged = false;

        ProjectionBounds bounds = mv.getProjectionBounds();
        bminx= getImageXIndex(bounds.minEast);
        bminy= getImageYIndex(bounds.minNorth);
        bmaxx= getImageXIndex(bounds.maxEast);
        bmaxy= getImageYIndex(bounds.maxNorth);
View Full Code Here

        for(int x = bminx; x<=bmaxx; ++x) {
            for(int y = bminy; y<=bmaxy; ++y){
                GeorefImage img = images[modulo(x,dax)][modulo(y,day)];
                if (!img.paint(g, mv, x, y, leftEdge, bottomEdge)) {
                    addRequest(new WMSRequest(x, y, info.getPixelPerDegree(), real, true));
                    areaToCache.add(new ProjectionBounds(getEastNorth(x, y), getEastNorth(x + 1, y + 1)));
                } else if (img.getState() == State.PARTLY_IN_CACHE && autoDownloadEnabled) {
                    addRequest(new WMSRequest(x, y, info.getPixelPerDegree(), real, false));
                    areaToCache.add(new ProjectionBounds(getEastNorth(x, y), getEastNorth(x + 1, y + 1)));
                }
            }
        }
        if (cache != null) {
            cache.setAreaToCache(areaToCache);
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.data.ProjectionBounds

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.