Changeset 3232 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2010-05-11T09:25:21+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/projection/Puwg.java
r3083 r3232 123 123 public Collection<String> getPreferencesFromCode(String code) 124 124 { 125 for (P rojectionp : Puwg.Zones)125 for (PuwgData p : Puwg.Zones) 126 126 { 127 127 if(code.equals(p.toCode())) … … 151 151 } 152 152 153 interface PuwgData extends Projection { 154 public double getPuwgCentralMeridianDeg(); 155 public double getPuwgCentralMeridian(); 156 public double getPuwgFalseEasting(); 157 public double getPuwgFalseNorthing(); 158 public double getPuwgScaleFactor(); 153 interface PuwgData { 154 double getPuwgCentralMeridianDeg(); 155 double getPuwgCentralMeridian(); 156 double getPuwgFalseEasting(); 157 double getPuwgFalseNorthing(); 158 double getPuwgScaleFactor(); 159 160 // Projection methods 161 String toCode(); 162 String getCacheDirectoryName(); 163 Bounds getWorldBoundsLatLon(); 159 164 } 160 165 … … 165 170 private static final double Epsg2180ScaleFactor = 0.9993; 166 171 private static final double Epsg2180CentralMeridian = 19.0; 167 private static DecimalFormat decFormatter = new DecimalFormat("###0");168 172 169 173 @Override public String toString() { … … 185 189 new LatLon(54.84, 24.15)); 186 190 } 187 188 /* These two MUST NOT be used. Use Puwg implementation instead. */189 public EastNorth latlon2eastNorth(LatLon p) { return null; }190 public LatLon eastNorth2latlon(EastNorth p) { return null; }191 191 192 192 public double getPuwgCentralMeridianDeg() { return Epsg2180CentralMeridian; } … … 195 195 public double getPuwgFalseNorthing() { return Epsg2180FalseNorthing; } 196 196 public double getPuwgScaleFactor() { return Epsg2180ScaleFactor; } 197 198 public double getDefaultZoomInPPD() {199 // This will set the scale bar to about 100 km200 return 0.009;201 }202 203 public String eastToString(EastNorth p) {204 return decFormatter.format(p.east());205 }206 207 public String northToString(EastNorth p) {208 return decFormatter.format(p.north());209 }210 197 } 211 198 … … 218 205 final private String[] Puwg2000Code = { "EPSG:2176", "EPSG:2177", "EPSG:2178", "EPSG:2179"}; 219 206 final private String[] Puwg2000CDName = { "epsg2176", "epsg2177", "epsg2178", "epsg2179"}; 220 private static DecimalFormat decFormatter = new DecimalFormat("###0.00");221 207 222 208 @Override public String toString() { … … 238 224 new LatLon(54.84, (3 * getZone()) + 1.5)); 239 225 } 240 241 /* These two MUST NOT be used. Use Puwg implementation instead. */242 public EastNorth latlon2eastNorth(LatLon p) { return null; }243 public LatLon eastNorth2latlon(EastNorth p) { return null; }244 226 245 227 public double getPuwgCentralMeridianDeg() { return getZone() * 3.0; } … … 252 234 public int getZoneIndex() { return getZone() - 5; } 253 235 254 public double getDefaultZoomInPPD() { 255 // This will set the scale bar to about 100 km 256 return 0.009; 257 } 258 259 public String eastToString(EastNorth p) { 260 return Integer.toString(getZone()) + decFormatter.format(p.east()); 261 } 262 263 public String northToString(EastNorth p) { 264 return decFormatter.format(p.north()); 265 } 266 267 } 268 269 class Epsg2176 extends Puwg2000 implements Projection { 236 } 237 238 class Epsg2176 extends Puwg2000 { 270 239 private static final int PuwgZone = 5; 271 240 … … 274 243 } 275 244 276 class Epsg2177 extends Puwg2000 implements Projection{245 class Epsg2177 extends Puwg2000 { 277 246 private static final int PuwgZone = 6; 278 247 … … 281 250 } 282 251 283 class Epsg2178 extends Puwg2000 implements Projection{252 class Epsg2178 extends Puwg2000 { 284 253 private static final int PuwgZone = 7; 285 254 … … 288 257 } 289 258 290 class Epsg2179 extends Puwg2000 implements Projection{259 class Epsg2179 extends Puwg2000 { 291 260 private static final int PuwgZone = 8; 292 261 -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r3098 r3232 11 11 import java.net.Authenticator; 12 12 import java.net.ProxySelector; 13 import java.security.AllPermission; 14 import java.security.CodeSource; 15 import java.security.PermissionCollection; 16 import java.security.Permissions; 17 import java.security.Policy; 13 18 import java.util.Collection; 14 19 import java.util.HashMap; … … 130 135 I18n.init(); 131 136 137 Policy.setPolicy(new Policy() { 138 // Permissions for plug-ins loaded when josm is started via webstart 139 private PermissionCollection pc; 140 141 { 142 pc = new Permissions(); 143 pc.add(new AllPermission()); 144 } 145 146 @Override 147 public void refresh() { } 148 149 @Override 150 public PermissionCollection getPermissions(CodeSource codesource) { 151 return pc; 152 } 153 }); 154 132 155 Thread.setDefaultUncaughtExceptionHandler(new BugReportExceptionHandler()); 133 156 // http://stuffthathappens.com/blog/2007/10/15/one-more-note-on-uncaught-exception-handlers/ -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r3131 r3232 63 63 * PluginHandler is basically a collection of static utility functions used to bootstrap 64 64 * and manage the loaded plugins. 65 * 65 * 66 66 */ 67 67 public class PluginHandler { … … 84 84 * Removes deprecated plugins from a collection of plugins. Modifies the 85 85 * collection <code>plugins</code>. 86 * 86 * 87 87 * Also notifies the user about removed deprecated plugins 88 * 88 * 89 89 * @param plugins the collection of plugins 90 90 */ … … 128 128 * collection <code>plugins</code>. Also removes the plugin from the list 129 129 * of plugins in the preferences, if necessary. 130 * 130 * 131 131 * Asks the user for every unmaintained plugin whether it should be removed. 132 * 132 * 133 133 * @param plugins the collection of plugins 134 134 */ … … 153 153 * JOSM was updated to a new version since the last plugin updates or 154 154 * if the plugins were last updated a long time ago. 155 * 155 * 156 156 * @param parent the parent window relative to which the confirmation dialog 157 157 * is to be displayed … … 261 261 /** 262 262 * Alerts the user if a plugin required by another plugin is missing 263 * 263 * 264 264 * @param plugin the the plugin 265 265 * @param missingRequiredPlugin the missing required plugin … … 304 304 * current JOSM version must be compatible with the plugin and no other plugins this plugin 305 305 * depends on should be missing. 306 * 306 * 307 307 * @param plugins the collection of all loaded plugins 308 308 * @param plugin the plugin for which preconditions are checked … … 342 342 /** 343 343 * Creates a class loader for loading plugin code. 344 * 344 * 345 345 * @param plugins the collection of plugins which are going to be loaded with this 346 346 * class loader … … 371 371 * Loads and instantiates the plugin described by <code>plugin</code> using 372 372 * the class loader <code>pluginClassLoader</code>. 373 * 373 * 374 374 * @param plugin the plugin 375 375 * @param pluginClassLoader the plugin class loader … … 383 383 } 384 384 } catch(PluginException e) { 385 e.printStackTrace(); 385 386 if (e.getCause() instanceof ClassNotFoundException) { 386 e.printStackTrace();387 387 String msg = tr("<html>Could not load plugin {0} because the plugin<br>main class ''{1}'' was not found.<br>" 388 388 + "Delete from preferences?", plugin.name, plugin.className); … … 403 403 * Loads the plugin in <code>plugins</code> from locally available jar files into 404 404 * memory. 405 * 405 * 406 406 * @param plugins the list of plugins 407 407 * @param monitor the progress monitor. Defaults to {@see NullProgressMonitor#INSTANCE} if null. … … 452 452 * Loads plugins from <code>plugins</code> which have the flag {@see PluginInformation#early} 453 453 * set to true. 454 * 454 * 455 455 * @param plugins the collection of plugins 456 456 * @param monitor the progress monitor. Defaults to {@see NullProgressMonitor#INSTANCE} if null. … … 469 469 * Loads plugins from <code>plugins</code> which have the flag {@see PluginInformation#early} 470 470 * set to false. 471 * 471 * 472 472 * @param plugins the collection of plugins 473 473 * @param monitor the progress monitor. Defaults to {@see NullProgressMonitor#INSTANCE} if null. … … 489 489 * @param monitor the progress monitor. Defaults to {@see NullProgressMonitor#INSTANCE} if null. 490 490 * @return the list of locally available plugin information 491 * 491 * 492 492 */ 493 493 private static Map<String, PluginInformation> loadLocallyAvailablePluginInformation(ProgressMonitor monitor) { … … 614 614 /** 615 615 * Updates the plugins in <code>plugins</code>. 616 * 616 * 617 617 * @param parent the parent window for message boxes 618 618 * @param plugins the collection of plugins to update. Must not be null. … … 696 696 /** 697 697 * Ask the user for confirmation that a plugin shall be disabled. 698 * 698 * 699 699 * @param reason the reason for disabling the plugin 700 700 * @param name the plugin name … … 731 731 /** 732 732 * Notified loaded plugins about a new map frame 733 * 733 * 734 734 * @param old the old map frame 735 735 * @param map the new map frame … … 763 763 * Installs downloaded plugins. Moves files with the suffix ".jar.new" to the corresponding 764 764 * ".jar" files. 765 * 765 * 766 766 * If {@code dowarn} is true, this methods emits warning messages on the console if a downloaded 767 767 * but not yet installed plugin .jar can't be be installed. If {@code dowarn} is false, the 768 768 * installation of the respective plugin is sillently skipped. 769 * 769 * 770 770 * @param dowarn if true, warning messages are displayed; false otherwise 771 771 */ … … 843 843 /** 844 844 * Replies the plugin which most likely threw the exception <code>ex</code>. 845 * 845 * 846 846 * @param ex the exception 847 847 * @return the plugin; null, if the exception proably wasn't thrown from a plugin … … 864 864 * Checks whether the exception <code>e</code> was thrown by a plugin. If so, 865 865 * conditionally deactivates the plugin, but asks the user first. 866 * 866 * 867 867 * @param e the exception 868 868 */ … … 914 914 String version = pp.getPluginInformation().localversion; 915 915 text += version != null && !version.equals("") ? " (Version: " + version + ")\n" 916 916 : "\n"; 917 917 } 918 918 return text;
Note:
See TracChangeset
for help on using the changeset viewer.