- Timestamp:
- 2006-03-28T17:45:45+02:00 (18 years ago)
- Location:
- src/org/openstreetmap/josm
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/Main.java
r71 r73 35 35 import org.openstreetmap.josm.data.Preferences.PreferencesException; 36 36 import org.openstreetmap.josm.data.osm.DataSet; 37 import org.openstreetmap.josm.data.projection.Projection; 37 38 import org.openstreetmap.josm.gui.MapFrame; 38 39 import org.openstreetmap.josm.gui.ShowModifiers; … … 53 54 */ 54 55 public static Main main; 56 57 public static Projection proj; 55 58 56 59 /** … … 183 186 }); 184 187 setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); 188 189 proj = pref.getProjection(); 185 190 } 186 191 -
src/org/openstreetmap/josm/actions/DownloadAction.java
r71 r73 58 58 private enum DownloadStatus {FINISHED, REDISPLAY} 59 59 60 /** 61 * minlat, minlon, maxlat, maxlon 62 */ 60 63 JTextField[] latlon = new JTextField[]{ 61 64 new JTextField(9), … … 68 71 super("Download from OSM", "download", "Download map data from the OSM server.", "Ctrl-Shift-D", 69 72 KeyStroke.getKeyStroke(KeyEvent.VK_D, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK)); 73 // TODO remove when bug in Java6 is fixed 74 for (JTextField f : latlon) 75 f.setMinimumSize(new Dimension(100,new JTextField().getMinimumSize().height)); 70 76 } 71 77 -
src/org/openstreetmap/josm/command/MoveCommand.java
r71 r73 78 78 for (Node n : objects) { 79 79 n.eastNorth = new EastNorth(n.eastNorth.east()+x, n.eastNorth.north()+y); 80 n.coor = Main.pr ef.getProjection().eastNorth2latlon(n.eastNorth);80 n.coor = Main.proj.eastNorth2latlon(n.eastNorth); 81 81 } 82 82 this.x += x; … … 87 87 for (Node n : objects) { 88 88 n.eastNorth = new EastNorth(n.eastNorth.east()+x, n.eastNorth.north()+y); 89 n.coor = Main.pr ef.getProjection().eastNorth2latlon(n.eastNorth);89 n.coor = Main.proj.eastNorth2latlon(n.eastNorth); 90 90 n.modified = true; 91 91 } -
src/org/openstreetmap/josm/data/Bounds.java
r71 r73 34 34 max = new LatLon(Projection.MAX_LAT, Projection.MAX_LON); 35 35 } 36 37 @Override 38 public String toString() { 39 return "Bounds["+min.lat()+","+min.lon()+","+max.lat()+","+max.lon()+"]"; 40 } 36 41 } -
src/org/openstreetmap/josm/data/osm/Node.java
r71 r73 19 19 public Node(LatLon latlon) { 20 20 this.coor = latlon; 21 eastNorth = Main.pr ef.getProjection().latlon2eastNorth(latlon);21 eastNorth = Main.proj.latlon2eastNorth(latlon); 22 22 } 23 23 -
src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java
r71 r73 53 53 if (min == null || max == null) 54 54 return null; 55 return new Bounds(Main.pr ef.getProjection().eastNorth2latlon(min), Main.pref.getProjection().eastNorth2latlon(max));55 return new Bounds(Main.proj.eastNorth2latlon(min), Main.proj.eastNorth2latlon(max)); 56 56 } 57 57 } -
src/org/openstreetmap/josm/data/projection/Mercator.java
r71 r73 23 23 public LatLon eastNorth2latlon(EastNorth p) { 24 24 return new LatLon( 25 p.east()*180/Math.PI,26 Math.atan(Math.sinh(p.north()))*180/Math.PI);25 Math.atan(Math.sinh(p.north()))*180/Math.PI, 26 p.east()*180/Math.PI); 27 27 } 28 28 -
src/org/openstreetmap/josm/gui/BookmarkList.java
r71 r73 32 32 public static class Bookmark { 33 33 public String name; 34 public double[] latlon = new double[4]; 34 public double[] latlon = new double[4]; // minlat, minlon, maxlat, maxlon 35 35 public boolean rawgps; 36 36 @Override public String toString() { -
src/org/openstreetmap/josm/gui/MapView.java
r71 r73 19 19 import org.openstreetmap.josm.data.Bounds; 20 20 import org.openstreetmap.josm.data.coor.EastNorth; 21 import org.openstreetmap.josm.data.coor.LatLon; 21 22 import org.openstreetmap.josm.data.osm.DataSet; 22 23 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; … … 228 229 if (v.min == null || v.max == null) { 229 230 // no bounds means standard scale and center 230 center = new EastNorth(51.526447, -0.14746371);231 center = Main.proj.latlon2eastNorth(new LatLon(51.526447, -0.14746371)); 231 232 scale = 10; 232 233 } else { -
src/org/openstreetmap/josm/gui/NavigatableComponent.java
r72 r73 248 248 */ 249 249 protected Projection getProjection() { 250 return Main.pr ef.getProjection();250 return Main.proj; 251 251 } 252 252 } -
src/org/openstreetmap/josm/gui/PreferenceDialog.java
r71 r73 90 90 * Indicate, that the application has to be restarted for the settings to take effect. 91 91 */ 92 boolean requiresRestart = false;92 private boolean requiresRestart = false; 93 93 /** 94 94 * ComboBox with all look and feels. … … 149 149 lafCombo.addActionListener(new ActionListener(){ 150 150 public void actionPerformed(ActionEvent e) { 151 setRequiresRestart();151 requiresRestart = true; 152 152 }}); 153 153 … … 159 159 } 160 160 } 161 projectionCombo.addActionListener(new ActionListener(){ 162 public void actionPerformed(ActionEvent e) { 163 requiresRestart = true; 164 } 165 }); 161 166 162 167 // drawRawGpsLines … … 265 270 return p; 266 271 } 267 268 /**269 * Remember, that the settings made requires a restart of the application.270 * Called from various actionListener - classes271 */272 protected void setRequiresRestart() {273 requiresRestart = true;274 }275 272 } -
src/org/openstreetmap/josm/gui/WorldChooser.java
r71 r73 69 69 public LatLon eastNorth2latlon(EastNorth p) { 70 70 return new LatLon( 71 p. east()*360/world.getIconWidth() - 180,72 p. north()*180/world.getIconHeight() - 90);71 p.north()*180/world.getIconHeight() - 90, 72 p.east()*360/world.getIconWidth() - 180); 73 73 } 74 74 @Override … … 77 77 } 78 78 }; 79 setMinimumSize(new Dimension(350, 350/2)); 79 80 } 80 81 … … 120 121 @Override 121 122 public void zoomTo(EastNorth newCenter, double scale) { 122 if (getWidth() != 0 && scale > scaleMax) 123 if (getWidth() != 0 && scale > scaleMax) { 123 124 scale = scaleMax; 125 newCenter = center; 126 } 124 127 super.zoomTo(newCenter, scale); 125 128 } … … 202 205 } 203 206 } 204 markerMin = new EastNorth(v[0], v[1]);205 markerMax = new EastNorth(v[2], v[3]);207 markerMin = getProjection().latlon2eastNorth(new LatLon(v[0], v[1])); 208 markerMax = getProjection().latlon2eastNorth(new LatLon(v[2], v[3])); 206 209 repaint(); 207 210 } -
src/org/openstreetmap/josm/gui/layer/RawGpsDataLayer.java
r71 r73 112 112 Collection<EastNorth> eastNorthList = new LinkedList<EastNorth>(); 113 113 for (LatLon ll : c) 114 eastNorthList.add(Main.pr ef.getProjection().latlon2eastNorth(ll));114 eastNorthList.add(Main.proj.latlon2eastNorth(ll)); 115 115 this.eastNorth.add(eastNorthList); 116 116 } -
src/org/openstreetmap/josm/io/OsmServerReader.java
r71 r73 101 101 HttpURLConnection con = (HttpURLConnection)url.openConnection(); 102 102 con.setConnectTimeout(20000); 103 System.out.println("response: "+con.getResponseCode());104 103 if (con.getResponseCode() == 401 && isCancelled()) 105 104 return null;
Note:
See TracChangeset
for help on using the changeset viewer.