Changeset 6453 in josm
- Timestamp:
- 2013-12-07T15:19:55+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r6443 r6453 105 105 /** 106 106 * The JOSM website URL. 107 * @since 6143 107 * @since 6143 108 108 */ 109 109 public static final String JOSM_WEBSITE = "http://josm.openstreetmap.de"; 110 110 111 /** 112 * The OSM website URL. 113 * @since 6453 114 */ 115 public static final String OSM_WEBSITE = "http://www.openstreetmap.org"; 116 111 117 /** 112 118 * Replies true if JOSM currently displays a map view. False, if it doesn't, i.e. if -
trunk/src/org/openstreetmap/josm/actions/AbstractInfoAction.java
r6316 r6453 48 48 if (ret.startsWith("http://api.openstreetmap.org/")) { 49 49 ret = ret.substring("http://api.openstreetmap.org/".length()); 50 ret = "http://www.openstreetmap.org/" + ret;50 ret = Main.OSM_WEBSITE + "/" + ret; 51 51 } 52 52 return ret; … … 67 67 if (ret.startsWith("http://api.openstreetmap.org/")) { 68 68 ret = ret.substring("http://api.openstreetmap.org/".length()); 69 ret = "http://www.openstreetmap.org/" + ret;69 ret = Main.OSM_WEBSITE + "/" + ret; 70 70 } 71 71 return ret; -
trunk/src/org/openstreetmap/josm/actions/JumpToAction.java
r6398 r6453 174 174 zoomLvl = (int)Math.round((-1) * Math.log(m/10000000)/Math.log(2)); 175 175 176 int decimals = (int) Math.pow(10, (zoomLvl / 3)); 177 dlat = Math.round(dlat * decimals); 178 dlat /= decimals; 179 dlon = Math.round(dlon * decimals); 180 dlon /= decimals; 181 url.setText("http://www.openstreetmap.org/#map="+zoomLvl+"/"+dlat+"/"+dlon); 182 } catch (NumberFormatException x) {} 176 url.setText(OsmUrlToBounds.getURL(dlat, dlon, zoomLvl)); 177 } catch (NumberFormatException x) { 178 Main.debug(x.getMessage()); 179 } 183 180 } 184 181 -
trunk/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java
r6243 r6453 10 10 import oauth.signpost.basic.DefaultOAuthProvider; 11 11 12 import org.openstreetmap.josm.Main; 12 13 import org.openstreetmap.josm.data.Preferences; 13 14 import org.openstreetmap.josm.io.OsmApi; … … 31 32 * The default OSM OAuth request token URL. 32 33 */ 33 static public final String DEFAULT_REQUEST_TOKEN_URL = "http://www.openstreetmap.org/oauth/request_token";34 static public final String DEFAULT_REQUEST_TOKEN_URL = Main.OSM_WEBSITE + "/oauth/request_token"; 34 35 /** 35 36 * The default OSM OAuth access token URL. 36 37 */ 37 static public final String DEFAULT_ACCESS_TOKEN_URL = "http://www.openstreetmap.org/oauth/access_token";38 static public final String DEFAULT_ACCESS_TOKEN_URL = Main.OSM_WEBSITE + "/oauth/access_token"; 38 39 /** 39 40 * The default OSM OAuth authorize URL. 40 41 */ 41 static public final String DEFAULT_AUTHORISE_URL = "http://www.openstreetmap.org/oauth/authorize";42 static public final String DEFAULT_AUTHORISE_URL = Main.OSM_WEBSITE + "/oauth/authorize"; 42 43 43 44 -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r6380 r6453 51 51 import org.openstreetmap.josm.tools.I18n; 52 52 import org.openstreetmap.josm.tools.ImageProvider; 53 import org.openstreetmap.josm.tools.OsmUrlToBounds; 53 54 import org.openstreetmap.josm.tools.Utils; 54 55 … … 122 123 tr("examples")+":\n"+ 123 124 "\tjava -jar josm.jar track1.gpx track2.gpx london.osm\n"+ 124 "\tjava -jar josm.jar http://www.openstreetmap.org/index.html?lat=43.2&lon=11.1&zoom=13\n"+125 "\tjava -jar josm.jar "+OsmUrlToBounds.getURL(43.2, 11.1, 13)+"\n"+ 125 126 "\tjava -jar josm.jar london.osm --selection=http://www.ostertag.name/osm/OSM_errors_node-duplicate.xml\n"+ 126 127 "\tjava -jar josm.jar 43.2,11.1,43.4,11.4\n"+ 127 128 "\tjava -Djosm.home=/home/user/.josm_dev -jar josm.jar\n"+ 128 "\tjava -Xmx 400m -jar josm.jar\n\n"+129 "\tjava -Xmx1024m -jar josm.jar\n\n"+ 129 130 tr("Parameters --download, --downloadgps, and --selection are processed in this order.")+"\n"+ 130 131 tr("Make sure you load some data if you use --selection.")+"\n" -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java
r6087 r6453 21 21 import javax.swing.event.HyperlinkListener; 22 22 23 import org.openstreetmap.josm.Main; 23 24 import org.openstreetmap.josm.gui.widgets.HtmlPanel; 24 25 import org.openstreetmap.josm.io.ChangesetQuery; … … 71 72 + "<p><strong>" + tr("Examples") + "</strong></p>" 72 73 + "<ul>" 73 + "<li><a href=\" http://www.openstreetmap.org/browse/changesets?open=true\">http://www.openstreetmap.org/browse/changesets?open=true</a></li>"74 + "<li><a href=\""+Main.OSM_WEBSITE+"/browse/changesets?open=true\">"+Main.OSM_WEBSITE+"/browse/changesets?open=true</a></li>" 74 75 + "<li><a href=\"http://api.openstreetmap.org/api/0.6/changesets?open=true\">http://api.openstreetmap.org/api/0.6/changesets?open=true</a></li>" 75 76 + "</ul>" -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerAction.java
r6340 r6453 43 43 JPanel msg = new JPanel(new GridBagLayout()); 44 44 msg.add(new JLabel(tr("<html>Upload of unprocessed GPS data as map data is considered harmful.<br>If you want to upload traces, look here:</html>")), GBC.eol()); 45 msg.add(new UrlLabel( tr("http://www.openstreetmap.org/traces"), 2), GBC.eop());45 msg.add(new UrlLabel(Main.OSM_WEBSITE + "/traces", 2), GBC.eop()); 46 46 if (!ConditionalOptionPaneUtil.showConfirmationDialog("convert_to_data", Main.parent, msg, tr("Warning"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE, JOptionPane.OK_OPTION)) { 47 47 return; -
trunk/src/org/openstreetmap/josm/io/MessageNotifier.java
r6365 r6453 67 67 JPanel panel = new JPanel(new GridBagLayout()); 68 68 panel.add(new JLabel(trn("You have {0} unread message.", "You have {0} unread messages.", unread, unread)), GBC.eol()); 69 panel.add(new UrlLabel( "http://www.openstreetmap.org/user/"+userInfo.getDisplayName()+"/inbox", tr("Click here to see your inbox.")), GBC.eol());69 panel.add(new UrlLabel(Main.OSM_WEBSITE + "/user/"+userInfo.getDisplayName()+"/inbox", tr("Click here to see your inbox.")), GBC.eol()); 70 70 panel.setOpaque(false); 71 71 new Notification().setContent(panel) -
trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
r6394 r6453 249 249 250 250 /** 251 * Return OSM URL for given area 251 * Return OSM URL for given area. 252 252 * 253 253 * @param b bounds of the area 254 254 * @return link to display that area in OSM map 255 255 */ 256 static public String getURL(Bounds b) {256 public static String getURL(Bounds b) { 257 257 return getURL(b.getCenter(), getZoom(b)); 258 258 } 259 259 260 260 /** 261 * Return OSM URL for given position and zoom 261 * Return OSM URL for given position and zoom. 262 262 * 263 263 * @param pos center position of area … … 265 265 * @return link to display that area in OSM map 266 266 */ 267 static public String getURL(LatLon pos, int zoom) { 267 public static String getURL(LatLon pos, int zoom) { 268 return getURL(pos.lat(), pos.lon(), zoom); 269 } 270 271 /** 272 * Return OSM URL for given lat/lon and zoom. 273 * 274 * @param dlat center latitude of area 275 * @param dlon center longitude of area 276 * @param zoom zoom depth of display 277 * @return link to display that area in OSM map 278 * 279 * @since 6453 280 */ 281 public static String getURL(double dlat, double dlon, int zoom) { 268 282 // Truncate lat and lon to something more sensible 269 283 int decimals = (int) Math.pow(10, (zoom / 3)); 270 double lat = (Math.round( pos.lat()* decimals));284 double lat = (Math.round(dlat * decimals)); 271 285 lat /= decimals; 272 double lon = (Math.round( pos.lon()* decimals));286 double lon = (Math.round(dlon * decimals)); 273 287 lon /= decimals; 274 return "http://www.openstreetmap.org/?lat="+lat+"&lon="+lon+"&zoom="+zoom;288 return Main.OSM_WEBSITE + "/#map="+zoom+"/"+lat+"/"+lon; 275 289 } 276 290 }
Note:
See TracChangeset
for help on using the changeset viewer.