Ignore:
Timestamp:
2008-08-05T02:14:58+02:00 (16 years ago)
Author:
framm
Message:
  • changed AutoScaleAction to leave some margin around selected objects when zooming to selection
  • added code to support the new RemoteControl plugin
Location:
trunk/src/org/openstreetmap/josm/data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/Bounds.java

    r655 r746  
    11// License: GPL. Copyright 2007 by Immanuel Scholz and others
    22package org.openstreetmap.josm.data;
     3
     4import java.awt.geom.Rectangle2D;
     5import java.awt.geom.RectangularShape;
    36
    47import org.openstreetmap.josm.data.coor.LatLon;
     
    6669                return true;
    6770        }
     71       
     72        /**
     73         * Returns the lat/lon bounding box as an object of type Rectangle2D.Double
     74         * @return
     75         */
     76        public Rectangle2D.Double asRect() {
     77                return new Rectangle2D.Double(min.lon(), min.lat(), max.lon()-min.lon(), max.lat()-min.lat());
     78        }
     79
    6880}
  • trunk/src/org/openstreetmap/josm/data/osm/DataSet.java

    r655 r746  
    22package org.openstreetmap.josm.data.osm;
    33
     4import java.awt.Polygon;
     5import java.awt.Shape;
     6import java.awt.geom.Area;
    47import java.util.Arrays;
    58import java.util.Collection;
     
    204207            return ds;
    205208    }
     209       
     210        /**
     211         * Returns the total area of downloaded data (the "yellow rectangles").
     212         * @return Area object encompassing downloaded data.
     213         */
     214        public Area getDataSourceArea()
     215        {
     216                Area a = new Area();
     217                for (DataSource source : dataSources) {
     218                        // create area from data bounds
     219                        a.add(new Area(source.bounds.asRect()));
     220                }
     221                return a;
     222               
     223        }
    206224}
Note: See TracChangeset for help on using the changeset viewer.