Changeset 6248 in josm for trunk/src/org
- Timestamp:
- 2013-09-23T16:47:50+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 137 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r6143 r6248 41 41 import javax.swing.KeyStroke; 42 42 import javax.swing.UIManager; 43 import javax.swing.UnsupportedLookAndFeelException; 43 44 44 45 import org.openstreetmap.gui.jmapviewer.FeatureAdapter; … … 199 200 200 201 /** 201 * Logging level (3 = debug, 2 = info, 1 = warn, 0 = none). 202 */ 203 static public int log_level = 2; 204 /** 205 * Print a warning message if logging is on. 202 * Logging level (4 = debug, 3 = info, 2 = warn, 1 = error, 0 = none). 203 * @since 6248 204 */ 205 public static int logLevel = 3; 206 207 /** 208 * Prints an error message if logging is on. 206 209 * @param msg The message to print. 207 */ 208 static public void warn(String msg) { 209 if (log_level < 1) 210 * @since 6248 211 */ 212 public static void error(String msg) { 213 if (logLevel < 1) 214 return; 215 System.err.println(tr("ERROR: {0}", msg)); 216 } 217 218 /** 219 * Prints a warning message if logging is on. 220 * @param msg The message to print. 221 */ 222 public static void warn(String msg) { 223 if (logLevel < 2) 210 224 return; 211 225 System.err.println(tr("WARNING: {0}", msg)); 212 226 } 213 /** 214 * Print an informational message if logging is on. 227 228 /** 229 * Prints an informational message if logging is on. 215 230 * @param msg The message to print. 216 231 */ 217 static public void info(String msg) {218 if (log _level < 2)232 public static void info(String msg) { 233 if (logLevel < 3) 219 234 return; 220 System.err.println(tr("INFO: {0}", msg)); 221 } 222 /** 223 * Print an debug message if logging is on. 235 System.out.println(tr("INFO: {0}", msg)); 236 } 237 238 /** 239 * Prints a debug message if logging is on. 224 240 * @param msg The message to print. 225 241 */ 226 static public void debug(String msg) {227 if (log _level < 3)242 public static void debug(String msg) { 243 if (logLevel < 4) 228 244 return; 229 System.err.println(tr("DEBUG: {0}", msg)); 230 } 231 /** 232 * Print a formated warning message if logging is on. Calls {@link MessageFormat#format} 245 System.out.println(tr("DEBUG: {0}", msg)); 246 } 247 248 /** 249 * Prints a formated error message if logging is on. Calls {@link MessageFormat#format} 233 250 * function to format text. 234 251 * @param msg The formated message to print. 235 252 * @param objects The objects to insert into format string. 236 */ 237 static public void warn(String msg, Object... objects) { 238 warn(MessageFormat.format(msg, objects)); 239 } 240 /** 241 * Print a formated informational message if logging is on. Calls {@link MessageFormat#format} 253 * @since 6248 254 */ 255 public static void error(String msg, Object... objects) { 256 error(MessageFormat.format(msg, objects)); 257 } 258 259 /** 260 * Prints a formated warning message if logging is on. Calls {@link MessageFormat#format} 242 261 * function to format text. 243 262 * @param msg The formated message to print. 244 263 * @param objects The objects to insert into format string. 245 264 */ 246 static public void info(String msg, Object... objects) { 247 info(MessageFormat.format(msg, objects)); 248 } 249 /** 250 * Print a formated debug message if logging is on. Calls {@link MessageFormat#format} 265 public static void warn(String msg, Object... objects) { 266 warn(MessageFormat.format(msg, objects)); 267 } 268 269 /** 270 * Prints a formated informational message if logging is on. Calls {@link MessageFormat#format} 251 271 * function to format text. 252 272 * @param msg The formated message to print. 253 273 * @param objects The objects to insert into format string. 254 274 */ 255 static public void debug(String msg, Object... objects) { 275 public static void info(String msg, Object... objects) { 276 info(MessageFormat.format(msg, objects)); 277 } 278 279 /** 280 * Prints a formated debug message if logging is on. Calls {@link MessageFormat#format} 281 * function to format text. 282 * @param msg The formated message to print. 283 * @param objects The objects to insert into format string. 284 */ 285 public static void debug(String msg, Object... objects) { 256 286 debug(MessageFormat.format(msg, objects)); 287 } 288 289 /** 290 * Prints an error message for the given Throwable. 291 * @param t The throwable object causing the error 292 * @since 6248 293 */ 294 public static void error(Throwable t) { 295 error(t.getClass().getName()+": "+t.getMessage()); 296 } 297 298 /** 299 * Prints a warning message for the given Throwable. 300 * @param t The throwable object causing the error 301 * @since 6248 302 */ 303 public static void warn(Throwable t) { 304 warn(t.getClass().getName()+": "+t.getMessage()); 257 305 } 258 306 … … 531 579 Object existing = inputMap.get(keyStroke); 532 580 if (existing != null && !existing.equals(action)) { 533 System.out.println(String.format("Keystroke %s is already assigned to %s, will be overridden by %s", keyStroke, existing, action));581 info(String.format("Keystroke %s is already assigned to %s, will be overridden by %s", keyStroke, existing, action)); 534 582 } 535 583 inputMap.put(keyStroke, action); … … 600 648 UIManager.setLookAndFeel(laf); 601 649 } 602 catch (final java.lang.ClassNotFoundException e) {603 System.out.println("Look and Feel not found: " + laf);650 catch (final ClassNotFoundException e) { 651 info("Look and Feel not found: " + laf); 604 652 Main.pref.put("laf", defaultlaf); 605 653 } 606 catch (final javax.swing.UnsupportedLookAndFeelException e) {607 System.out.println("Look and Feel not supported: " + laf);654 catch (final UnsupportedLookAndFeelException e) { 655 info("Look and Feel not supported: " + laf); 608 656 Main.pref.put("laf", defaultlaf); 609 657 } … … 853 901 String os = System.getProperty("os.name"); 854 902 if (os == null) { 855 System.err.println("Your operating system has no name, so I'm guessing its some kind of *nix.");903 warn("Your operating system has no name, so I'm guessing its some kind of *nix."); 856 904 platform = new PlatformHookUnixoid(); 857 905 } else if (os.toLowerCase().startsWith("windows")) { … … 864 912 platform = new PlatformHookOsx(); 865 913 } else { 866 System.err.println("I don't know your operating system '"+os+"', so I'm guessing its some kind of *nix.");914 warn("I don't know your operating system '"+os+"', so I'm guessing its some kind of *nix."); 867 915 platform = new PlatformHookUnixoid(); 868 916 } … … 948 996 } 949 997 } 950 System.err.println("Error:Could not recognize Java Version: "+version);998 error("Could not recognize Java Version: "+version); 951 999 } 952 1000 -
trunk/src/org/openstreetmap/josm/actions/AbstractInfoAction.java
r6084 r6248 43 43 String ret = pattern.matcher(baseUrl).replaceAll("/browse"); 44 44 if (ret.equals(baseUrl)) { 45 System.out.println(tr("WARNING: unexpected format of API base URL. Redirection to info or history page for OSM object will probably fail. API base URL is: ''{0}''",baseUrl));45 Main.warn(tr("Unexpected format of API base URL. Redirection to info or history page for OSM object will probably fail. API base URL is: ''{0}''",baseUrl)); 46 46 } 47 47 if (ret.startsWith("http://api.openstreetmap.org/")) { … … 62 62 String ret = pattern.matcher(baseUrl).replaceAll("/user"); 63 63 if (ret.equals(baseUrl)) { 64 System.out.println(tr("WARNING: unexpected format of API base URL. Redirection to user page for OSM user will probably fail. API base URL is: ''{0}''",baseUrl));64 Main.warn(tr("Unexpected format of API base URL. Redirection to user page for OSM user will probably fail. API base URL is: ''{0}''",baseUrl)); 65 65 } 66 66 if (ret.startsWith("http://api.openstreetmap.org/")) { -
trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
r6069 r6248 9 9 import java.io.IOException; 10 10 import java.net.MalformedURLException; 11 11 12 import javax.swing.Action; 12 13 import javax.swing.ImageIcon; … … 15 16 import javax.swing.JPanel; 16 17 import javax.swing.JScrollPane; 18 17 19 import org.openstreetmap.josm.Main; 18 20 import org.openstreetmap.josm.data.imagery.ImageryInfo; … … 21 23 import org.openstreetmap.josm.gui.actionsupport.AlignImageryPanel; 22 24 import org.openstreetmap.josm.gui.layer.ImageryLayer; 25 import org.openstreetmap.josm.gui.preferences.imagery.WMSLayerTree; 23 26 import org.openstreetmap.josm.io.imagery.WMSImagery; 24 import org.openstreetmap.josm.gui.preferences.imagery.WMSLayerTree;25 27 import org.openstreetmap.josm.tools.GBC; 26 28 import org.openstreetmap.josm.tools.ImageProvider; … … 78 80 wms.attemptGetCapabilities(info.getUrl()); 79 81 80 System.out.println(wms.getLayers());81 82 final WMSLayerTree tree = new WMSLayerTree(); 82 83 tree.updateTree(wms); … … 108 109 JOptionPane.showMessageDialog(Main.parent, tr("Could not parse WMS layer list."), 109 110 tr("WMS Error"), JOptionPane.ERROR_MESSAGE); 110 System.err.println("Could not parse WMS layer list. Incoming data:"); 111 System.err.println(ex.getIncomingData()); 111 Main.error("Could not parse WMS layer list. Incoming data:\n"+ex.getIncomingData()); 112 112 } 113 113 return null; -
trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java
r6084 r6248 303 303 Utils.close(reader); 304 304 } catch (Exception e) { 305 System.err.println(e.getMessage());305 Main.error(e); 306 306 } 307 307 } -
trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java
r6131 r6248 33 33 import org.openstreetmap.josm.tools.Shortcut; 34 34 35 /** 36 * Delete unnecessary nodes from a way 37 */ 35 38 public class SimplifyWayAction extends JosmAction { 39 40 /** 41 * Constructs a new {@code SimplifyWayAction}. 42 */ 36 43 public SimplifyWayAction() { 37 44 super(tr("Simplify Way"), "simplify", tr("Delete unnecessary nodes from a way."), Shortcut.registerShortcut("tools:simplify", tr("Tool: {0}", tr("Simplify Way")), … … 41 48 42 49 protected boolean confirmWayWithNodesOutsideBoundingBox(List<? extends OsmPrimitive> primitives) { 43 System.out.println(primitives);44 50 return DeleteCommand.checkAndConfirmOutlyingDelete(Main.map.mapView.getEditLayer(), primitives, null); 45 51 } -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeTask.java
r6031 r6248 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.actions.downloadtasks; 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 3 5 4 6 import java.util.Date; … … 8 10 import java.util.Map; 9 11 import java.util.concurrent.Future; 10 11 import static org.openstreetmap.josm.tools.I18n.tr;12 12 13 13 import org.openstreetmap.josm.Main; … … 184 184 data.setVisible(hp.isVisible()); 185 185 } catch (IllegalStateException e) { 186 System.err.println("Cannot change visibility for "+p+": "+e.getMessage());186 Main.error("Cannot change visibility for "+p+": "+e.getMessage()); 187 187 } 188 188 data.setTimestamp(hp.getTimestamp()); … … 196 196 it.remove(); 197 197 } catch (AssertionError e) { 198 System.err.println("Cannot load "+p + ": " + e.getMessage());198 Main.error("Cannot load "+p + ": " + e.getMessage()); 199 199 } 200 200 } -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
r6069 r6248 206 206 } catch(Exception e) { 207 207 if (isCanceled()) { 208 System.out.println(tr("Ignoring exception because download has been canceled. Exception was: {0}", e.toString()));208 Main.info(tr("Ignoring exception because download has been canceled. Exception was: {0}", e.toString())); 209 209 return; 210 210 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r6084 r6248 116 116 Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK); 117 117 } catch (SecurityException ex) { 118 System.out.println(ex);118 Main.warn(ex); 119 119 } 120 120 } … … 127 127 Toolkit.getDefaultToolkit().removeAWTEventListener(this); 128 128 } catch (SecurityException ex) { 129 System.out.println(ex);129 Main.warn(ex); 130 130 } 131 131 removeHighlighting(); -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r6246 r6248 1365 1365 snapAngles[i] = 360-Double.parseDouble(s); i++; 1366 1366 } catch (NumberFormatException e) { 1367 System.err.println("Warning: incorrect number in draw.anglesnap.angles preferences: "+s);1367 Main.warn("Incorrect number in draw.anglesnap.angles preferences: "+s); 1368 1368 snapAngles[i]=0;i++; 1369 1369 snapAngles[i]=0;i++; -
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r6106 r6248 683 683 break; 684 684 } else { 685 System.out.println("Unknown char in SearchSettings: " + s);685 Main.warn("Unknown char in SearchSettings: " + s); 686 686 break; 687 687 } -
trunk/src/org/openstreetmap/josm/actions/upload/ApiPreconditionCheckerHook.java
r6084 r6248 53 53 for (String key: osmPrimitive.keySet()) { 54 54 String value = osmPrimitive.get(key); 55 if (key.length() > 255) {55 if (key.length() > 255) { 56 56 if (osmPrimitive.isDeleted()) { 57 // if OsmPrimitive is going to be deleted we automatically shorten the 58 // value 59 System.out.println( 60 tr("Warning: automatically truncating value of tag ''{0}'' on deleted object {1}", 57 // if OsmPrimitive is going to be deleted we automatically shorten the value 58 Main.warn( 59 tr("Automatically truncating value of tag ''{0}'' on deleted object {1}", 61 60 key, 62 61 Long.toString(osmPrimitive.getId()) -
trunk/src/org/openstreetmap/josm/command/ConflictAddCommand.java
r5077 r6248 49 49 @Override public void undoCommand() { 50 50 if (! Main.map.mapView.hasLayer(getLayer())) { 51 System.out.println(tr("Warning:Layer ''{0}'' does not exist any more. Cannot remove conflict for object ''{1}''.",51 Main.warn(tr("Layer ''{0}'' does not exist any more. Cannot remove conflict for object ''{1}''.", 52 52 getLayer().getName(), 53 53 conflict.getMy().getDisplayName(DefaultNameFormatter.getInstance()) -
trunk/src/org/openstreetmap/josm/command/ConflictResolveCommand.java
r5816 r6248 61 61 62 62 if (! Main.map.mapView.hasLayer(getLayer())) { 63 System.out.println(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more",63 Main.warn(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more", 64 64 this.toString(), 65 65 getLayer().toString() -
trunk/src/org/openstreetmap/josm/command/RelationMemberConflictResolverCommand.java
r5881 r6248 81 81 public void undoCommand() { 82 82 if (! Main.map.mapView.hasLayer(layer)) { 83 System.out.println(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more",83 Main.warn(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more", 84 84 this.toString(), 85 85 layer.toString() -
trunk/src/org/openstreetmap/josm/command/WayNodesConflictResolverCommand.java
r5903 r6248 9 9 import javax.swing.Icon; 10 10 11 import org.openstreetmap.josm.Main; 11 12 import org.openstreetmap.josm.data.conflict.Conflict; 12 13 import org.openstreetmap.josm.data.osm.Node; … … 54 55 super.executeCommand(); 55 56 56 // replace the list of nodes of 'my' way by the list of merged 57 // nodes 57 // replace the list of nodes of 'my' way by the list of merged nodes 58 58 // 59 59 for (Node n:mergedNodeList) { 60 60 if (! getLayer().data.getNodes().contains(n)) { 61 System.out.println(tr("Main dataset does not include node {0}", n.toString()));61 Main.warn(tr("Main dataset does not include node {0}", n.toString())); 62 62 } 63 63 } -
trunk/src/org/openstreetmap/josm/data/AutosaveTask.java
r6104 r6248 89 89 90 90 if (!autosaveDir.exists() && !autosaveDir.mkdirs()) { 91 System.out.println(tr("Unable to create directory {0}, autosave will be disabled", autosaveDir.getAbsolutePath()));91 Main.warn(tr("Unable to create directory {0}, autosave will be disabled", autosaveDir.getAbsolutePath())); 92 92 return; 93 93 } 94 94 if (!deletedLayersDir.exists() && !deletedLayersDir.mkdirs()) { 95 System.out.println(tr("Unable to create directory {0}, autosave will be disabled", deletedLayersDir.getAbsolutePath()));95 Main.warn(tr("Unable to create directory {0}, autosave will be disabled", deletedLayersDir.getAbsolutePath())); 96 96 return; 97 97 } … … 159 159 Utils.close(ps); 160 160 } catch (Throwable t) { 161 System.err.println(t.getMessage());161 Main.error(t); 162 162 } 163 163 return result; 164 164 } else { 165 System.out.println(tr("Unable to create file {0}, other filename will be used", result.getAbsolutePath()));165 Main.warn(tr("Unable to create file {0}, other filename will be used", result.getAbsolutePath())); 166 166 if (index > PROP_INDEX_LIMIT.get()) 167 167 throw new IOException("index limit exceeded"); 168 168 } 169 169 } catch (IOException e) { 170 System.err.println(tr("IOError while creating file, autosave will be skipped: {0}", e.getMessage()));170 Main.error(tr("IOError while creating file, autosave will be skipped: {0}", e.getMessage())); 171 171 return null; 172 172 } … … 190 190 File oldFile = info.backupFiles.remove(); 191 191 if (!oldFile.delete()) { 192 System.out.println(tr("Unable to delete old backup file {0}", oldFile.getAbsolutePath()));192 Main.warn(tr("Unable to delete old backup file {0}", oldFile.getAbsolutePath())); 193 193 } else { 194 194 getPidFile(oldFile).delete(); … … 207 207 } catch (Throwable t) { 208 208 // Don't let exception stop time thread 209 System.err.println("Autosave failed: "); 209 Main.error("Autosave failed:"); 210 Main.error(t); 210 211 t.printStackTrace(); 211 212 } … … 257 258 } 258 259 } catch (IOException e) { 259 System.err.println(tr("Error while creating backup of removed layer: {0}", e.getMessage()));260 Main.error(tr("Error while creating backup of removed layer: {0}", e.getMessage())); 260 261 } 261 262 … … 300 301 } 301 302 } catch (Throwable t) { 302 System.err.println(t.getClass()+":"+t.getMessage());303 Main.error(t); 303 304 } finally { 304 305 Utils.close(reader); 305 306 } 306 307 } catch (Throwable t) { 307 System.err.println(t.getClass()+":"+t.getMessage());308 Main.error(t); 308 309 } 309 310 } … … 359 360 deletedLayers.remove(backupFile); 360 361 if (!backupFile.delete()) { 361 System.err.println(String.format("Warning:Could not delete old backup file %s", backupFile));362 Main.warn(String.format("Could not delete old backup file %s", backupFile)); 362 363 } 363 364 } … … 366 367 pidFile.delete(); 367 368 } else { 368 System.err.println(String.format("Warning:Could not move autosaved file %s to %s folder", f.getName(), deletedLayersDir.getName()));369 Main.warn(String.format("Could not move autosaved file %s to %s folder", f.getName(), deletedLayersDir.getName())); 369 370 // we cannot move to deleted folder, so just try to delete it directly 370 371 if (!f.delete()) { 371 System.err.println(String.format("Warning:Could not delete backup file %s", f));372 Main.warn(String.format("Could not delete backup file %s", f)); 372 373 } else { 373 374 pidFile.delete(); … … 380 381 } 381 382 if (!next.delete()) { 382 System.err.println(String.format("Warning:Could not delete archived backup file %s", next));383 Main.warn(String.format("Could not delete archived backup file %s", next)); 383 384 } 384 385 } -
trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java
r6235 r6248 236 236 root = document.getDocumentElement(); 237 237 } catch (Exception ex) { 238 System.out.println("Error getting preferences to save:" +ex.getMessage());238 Main.warn("Error getting preferences to save:" +ex.getMessage()); 239 239 } 240 240 if (root==null) return; … … 265 265 ts.transform(new DOMSource(exportDocument), new StreamResult(f.toURI().getPath())); 266 266 } catch (Exception ex) { 267 System.out.println("Error saving preferences part: " +ex.getMessage());267 Main.warn("Error saving preferences part: " +ex.getMessage()); 268 268 ex.printStackTrace(); 269 269 } … … 345 345 List<PluginInformation> toDeletePlugins = new ArrayList<PluginInformation>(); 346 346 for (PluginInformation pi: availablePlugins) { 347 //System.out.print(pi.name+";");348 347 String name = pi.name.toLowerCase(); 349 348 if (installList.contains(name)) toInstallPlugins.add(pi); … … 355 354 Main.worker.submit(pluginDownloadTask); 356 355 } 357 Collection<String> pls = new ArrayList<String>(Main.pref.getCollection("plugins")); 358 for (PluginInformation pi: toInstallPlugins) { 359 if (!pls.contains(pi.name)) pls.add(pi.name); 356 Collection<String> pls = new ArrayList<String>(Main.pref.getCollection("plugins")); 357 for (PluginInformation pi: toInstallPlugins) { 358 if (!pls.contains(pi.name)) { 359 pls.add(pi.name); 360 360 } 361 for (PluginInformation pi: toRemovePlugins) {362 pls.remove(pi.name);363 }364 for (PluginInformation pi: toDeletePlugins) {365 pls.remove(pi.name);366 new File(Main.pref.getPluginsDirectory(),pi.name+".jar").deleteOnExit();367 }368 System.out.println(pls);369 Main.pref.putCollection("plugins",pls);370 361 } 362 for (PluginInformation pi: toRemovePlugins) { 363 pls.remove(pi.name); 364 } 365 for (PluginInformation pi: toDeletePlugins) { 366 pls.remove(pi.name); 367 new File(Main.pref.getPluginsDirectory(), pi.name+".jar").deleteOnExit(); 368 } 369 Main.pref.putCollection("plugins",pls); 370 } 371 371 }); 372 372 } … … 949 949 } 950 950 951 952 953 951 private static void defaultUnknownWarning(String key) { 954 952 log("Warning: Unknown default value of %s , skipped\n", key); … … 961 959 962 960 private static void showPrefs(Preferences tmpPref) { 963 System.out.println("properties: " + tmpPref.properties);964 System.out.println("collections: " + tmpPref.collectionProperties);965 System.out.println("arrays: " + tmpPref.arrayProperties);966 System.out.println("maps: " + tmpPref.listOfStructsProperties);961 Main.info("properties: " + tmpPref.properties); 962 Main.info("collections: " + tmpPref.collectionProperties); 963 Main.info("arrays: " + tmpPref.arrayProperties); 964 Main.info("maps: " + tmpPref.listOfStructsProperties); 967 965 } 968 966 … … 973 971 } 974 972 975 976 /** 973 /** 977 974 * Convert JavaScript preferences object to preferences data structures 978 975 * @param engine - JS engine to put object … … 1059 1056 tmpPref.listOfStructsProperties.put(e.getKey(), e.getValue()); 1060 1057 } 1061 1062 } 1063 1058 } 1064 1059 1065 1060 /** … … 1153 1148 "}\n"; 1154 1149 1155 //System.out.println("map1: "+stringMap );1156 //System.out.println("lists1: "+listMap );1157 //System.out.println("listlist1: "+listlistMap );1158 //System.out.println("listmap1: "+listmapMap );1159 1160 1150 // Execute conversion script 1161 1151 engine.eval(init); 1162 1163 1152 } 1164 1153 } -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r6235 r6248 373 373 } 374 374 if (!cacheDirFile.exists() && !cacheDirFile.mkdirs()) { 375 System.err.println(tr("Warning:Failed to create missing cache directory: {0}", cacheDirFile.getAbsoluteFile()));375 Main.warn(tr("Failed to create missing cache directory: {0}", cacheDirFile.getAbsoluteFile())); 376 376 JOptionPane.showMessageDialog( 377 377 Main.parent, … … 499 499 defaults.put(key, def); 500 500 } else if(def != null && !defaults.get(key).equals(def)) { 501 System.out.println("Defaults for " + key + " differ: " + def + " != " + defaults.get(key));501 Main.info("Defaults for " + key + " differ: " + def + " != " + defaults.get(key)); 502 502 } 503 503 } … … 556 556 try { 557 557 save(); 558 } catch (IOException e){559 System.out.println(tr("Warning: failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile()));558 } catch (IOException e) { 559 Main.warn(tr("Failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile())); 560 560 } 561 561 changed = true; … … 652 652 if (prefDir.exists()) { 653 653 if(!prefDir.isDirectory()) { 654 System.err.println(tr("Warning:Failed to initialize preferences. Preference directory ''{0}'' is not a directory.", prefDir.getAbsoluteFile()));654 Main.warn(tr("Failed to initialize preferences. Preference directory ''{0}'' is not a directory.", prefDir.getAbsoluteFile())); 655 655 JOptionPane.showMessageDialog( 656 656 Main.parent, … … 663 663 } else { 664 664 if (! prefDir.mkdirs()) { 665 System.err.println(tr("Warning:Failed to initialize preferences. Failed to create missing preference directory: {0}", prefDir.getAbsoluteFile()));665 Main.warn(tr("Failed to initialize preferences. Failed to create missing preference directory: {0}", prefDir.getAbsoluteFile())); 666 666 JOptionPane.showMessageDialog( 667 667 Main.parent, … … 677 677 try { 678 678 if (!preferenceFile.exists()) { 679 System.out.println(tr("Info:Missing preference file ''{0}''. Creating a default preference file.", preferenceFile.getAbsoluteFile()));679 Main.info(tr("Missing preference file ''{0}''. Creating a default preference file.", preferenceFile.getAbsoluteFile())); 680 680 resetToDefault(); 681 681 save(); 682 682 } else if (reset) { 683 System.out.println(tr("Warning:Replacing existing preference file ''{0}'' with default preference file.", preferenceFile.getAbsoluteFile()));683 Main.warn(tr("Replacing existing preference file ''{0}'' with default preference file.", preferenceFile.getAbsoluteFile())); 684 684 resetToDefault(); 685 685 save(); … … 712 712 } catch(IOException e1) { 713 713 e1.printStackTrace(); 714 System.err.println(tr("Warning:Failed to initialize preferences. Failed to reset preference file to default: {0}", getPreferenceFile()));714 Main.warn(tr("Failed to initialize preferences. Failed to reset preference file to default: {0}", getPreferenceFile())); 715 715 } 716 716 } … … 906 906 try { 907 907 save(); 908 } catch (IOException e){909 System.out.println(tr("Warning: failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile()));908 } catch (IOException e){ 909 Main.warn(tr("Failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile())); 910 910 } 911 911 } … … 1006 1006 try { 1007 1007 save(); 1008 } catch (IOException e){1009 System.out.println(tr("Warning: failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile()));1008 } catch (IOException e){ 1009 Main.warn(tr("Failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile())); 1010 1010 } 1011 1011 } … … 1075 1075 try { 1076 1076 save(); 1077 } catch (IOException e){1078 System.out.println(tr("Warning: failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile()));1077 } catch (IOException e) { 1078 Main.warn(tr("Failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile())); 1079 1079 } 1080 1080 } … … 1657 1657 for (String key : obsolete) { 1658 1658 boolean removed = false; 1659 if(properties.containsKey(key)) { properties.remove(key); removed = true; } 1660 if(collectionProperties.containsKey(key)) { collectionProperties.remove(key); removed = true; } 1661 if(arrayProperties.containsKey(key)) { arrayProperties.remove(key); removed = true; } 1662 if(listOfStructsProperties.containsKey(key)) { listOfStructsProperties.remove(key); removed = true; } 1663 if(removed) 1664 System.out.println(tr("Preference setting {0} has been removed since it is no longer used.", key)); 1659 if (properties.containsKey(key)) { properties.remove(key); removed = true; } 1660 if (collectionProperties.containsKey(key)) { collectionProperties.remove(key); removed = true; } 1661 if (arrayProperties.containsKey(key)) { arrayProperties.remove(key); removed = true; } 1662 if (listOfStructsProperties.containsKey(key)) { listOfStructsProperties.remove(key); removed = true; } 1663 if (removed) { 1664 Main.info(tr("Preference setting {0} has been removed since it is no longer used.", key)); 1665 } 1665 1666 } 1666 1667 } -
trunk/src/org/openstreetmap/josm/data/ServerSidePreferences.java
r5874 r6248 47 47 public String download() throws MissingPassword { 48 48 try { 49 System.out.println("reading preferences from "+serverUrl);49 Main.info("reading preferences from "+serverUrl); 50 50 URLConnection con = serverUrl.openConnection(); 51 51 String username = get("applet.username"); … … 80 80 try { 81 81 URL u = new URL(getPreferencesDir()); 82 System.out.println("uploading preferences to "+u);82 Main.info("uploading preferences to "+u); 83 83 HttpURLConnection con = (HttpURLConnection)u.openConnection(); 84 84 String username = get("applet.username"); -
trunk/src/org/openstreetmap/josm/data/Version.java
r6246 r6248 48 48 s = sb.toString(); 49 49 } catch (IOException e) { 50 System.err.println(tr("Failed to load resource ''{0}'', error is {1}.", resource.toString(), e.toString()));50 Main.error(tr("Failed to load resource ''{0}'', error is {1}.", resource.toString(), e.toString())); 51 51 e.printStackTrace(); 52 52 } … … 114 114 } catch(NumberFormatException e) { 115 115 version = 0; 116 System.err.println(tr("Warning: unexpected JOSM version number in revision file, value is ''{0}''", value));116 Main.warn(tr("Unexpected JOSM version number in revision file, value is ''{0}''", value)); 117 117 } 118 118 } else { … … 158 158 URL u = Main.class.getResource("/REVISION"); 159 159 if (u == null) { 160 System.err.println(tr("Warning: the revision file ''/REVISION'' is missing."));160 Main.warn(tr("The revision file ''/REVISION'' is missing.")); 161 161 version = 0; 162 162 releaseDescription = ""; -
trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
r6203 r6248 254 254 // (This should almost never happen.) 255 255 if (java.lang.Double.isNaN(d)) { 256 System.err.println("Error:NaN in greatCircleDistance");256 Main.error("NaN in greatCircleDistance"); 257 257 d = PI * R; 258 258 } -
trunk/src/org/openstreetmap/josm/data/imagery/GeorefImage.java
r4065 r6248 148 148 } 149 149 long freeMem = Runtime.getRuntime().maxMemory() - Runtime.getRuntime().totalMemory(); 150 // System.out.println("Free Memory: "+ (freeMem/1024/1024) +" MB");150 //Main.debug("Free Memory: "+ (freeMem/1024/1024) +" MB"); 151 151 // Notice that this value can get negative due to integer overflows 152 // System.out.println("Img Size: "+ (width*height*3/1024/1024) +" MB");152 //Main.debug("Img Size: "+ (width*height*3/1024/1024) +" MB"); 153 153 154 154 int multipl = alphaChannel ? 4 : 3; -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r6069 r6248 229 229 } 230 230 } catch (IllegalArgumentException ex) { 231 Main.warn(ex .toString());231 Main.warn(ex); 232 232 } 233 233 } -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java
r6143 r6248 9 9 import java.util.List; 10 10 11 import org.xml.sax.SAXException;12 13 11 import org.openstreetmap.josm.Main; 14 12 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryPreferenceEntry; … … 16 14 import org.openstreetmap.josm.io.imagery.ImageryReader; 17 15 import org.openstreetmap.josm.tools.Utils; 16 import org.xml.sax.SAXException; 18 17 19 18 /** … … 50 49 add(i); 51 50 } catch (IllegalArgumentException e) { 52 System.err.println("Warning:Unable to load imagery preference entry:"+e);51 Main.warn("Unable to load imagery preference entry:"+e); 53 52 } 54 53 } -
trunk/src/org/openstreetmap/josm/data/imagery/OffsetBookmark.java
r5460 r6248 56 56 } 57 57 if (projectionCode == null) { 58 System.err.println(tr("Projection ''{0}'' is not found, bookmark ''{1}'' is not usable", projectionCode, name));58 Main.error(tr("Projection ''{0}'' is not found, bookmark ''{1}'' is not usable", projectionCode, name)); 59 59 } 60 60 } -
trunk/src/org/openstreetmap/josm/data/imagery/WmsCache.java
r6093 r6248 123 123 layersIndex.load(fis); 124 124 } catch (FileNotFoundException e) { 125 System.out.println("Unable to load layers index for wms cache (file " + layerIndexFile + " not found)");125 Main.error("Unable to load layers index for wms cache (file " + layerIndexFile + " not found)"); 126 126 } catch (IOException e) { 127 System.err.println("Unable to load layers index for wms cache");127 Main.error("Unable to load layers index for wms cache"); 128 128 e.printStackTrace(); 129 129 } … … 151 151 layersIndex.store(fos, ""); 152 152 } catch (IOException e) { 153 System.err.println("Unable to save layer index for wms cache");153 Main.error("Unable to save layer index for wms cache"); 154 154 e.printStackTrace(); 155 155 } … … 187 187 totalFileSize = cacheEntries.getTotalFileSize(); 188 188 if (cacheEntries.getTileSize() != tileSize) { 189 System.out.println("Cache created with different tileSize, cache will be discarded");189 Main.info("Cache created with different tileSize, cache will be discarded"); 190 190 return; 191 191 } … … 202 202 if (indexFile.exists()) { 203 203 e.printStackTrace(); 204 System.out.println("Unable to load index for wms-cache, new file will be created");204 Main.info("Unable to load index for wms-cache, new file will be created"); 205 205 } else { 206 System.out.println("Index for wms-cache doesn't exist, new file will be created");206 Main.info("Index for wms-cache doesn't exist, new file will be created"); 207 207 } 208 208 } … … 297 297 marshaller.marshal(index, new FileOutputStream(new File(cacheDir, INDEX_FILENAME))); 298 298 } catch (Exception e) { 299 System.err.println("Failed to save wms-cache file");299 Main.error("Failed to save wms-cache file"); 300 300 e.printStackTrace(); 301 301 } … … 364 364 return loadImage(projectionEntries, entry); 365 365 } catch (IOException e) { 366 System.err.println("Unable to load file from wms cache");366 Main.error("Unable to load file from wms cache"); 367 367 e.printStackTrace(); 368 368 return null; -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r5881 r6248 799 799 OsmPrimitive result = getPrimitiveById(primitiveId); 800 800 if (result == null) { 801 System.out.println(tr("JOSM expected to find primitive [{0} {1}] in dataset but it is not there. Please report this "801 Main.warn(tr("JOSM expected to find primitive [{0} {1}] in dataset but it is not there. Please report this " 802 802 + "at http://josm.openstreetmap.de/. This is not a critical error, it should be safe to continue in your work.", 803 803 primitiveId.getType(), Long.toString(primitiveId.getUniqueId()))); -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r6233 r6248 745 745 reversedDirectionKeys = SearchCompiler.compile(Main.pref.get("tags.reversed_direction", reversedDirectionDefault), false, false); 746 746 } catch (ParseError e) { 747 System.err.println("Unable to compile pattern for tags.reversed_direction, trying default pattern: " + e.getMessage());747 Main.error("Unable to compile pattern for tags.reversed_direction, trying default pattern: " + e.getMessage()); 748 748 749 749 try { … … 756 756 directionKeys = SearchCompiler.compile(Main.pref.get("tags.direction", directionDefault), false, false); 757 757 } catch (ParseError e) { 758 System.err.println("Unable to compile pattern for tags.direction, trying default pattern: " + e.getMessage());758 Main.error("Unable to compile pattern for tags.direction, trying default pattern: " + e.getMessage()); 759 759 760 760 try { -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapRendererFactory.java
r6069 r6248 106 106 } 107 107 } 108 System.err.println(tr("Error: failed to load map renderer class ''{0}''. The class wasn''t found.", className));108 Main.error(tr("Failed to load map renderer class ''{0}''. The class wasn''t found.", className)); 109 109 return null; 110 110 } … … 126 126 Class<?> c = loadRendererClass(rendererClassName); 127 127 if (c == null){ 128 System.err.println(tr("Can''t activate map renderer class ''{0}'', because the class wasn''t found.", rendererClassName));129 System.err.println(tr("Activating the standard map renderer instead."));128 Main.error(tr("Can''t activate map renderer class ''{0}'', because the class wasn''t found.", rendererClassName)); 129 Main.error(tr("Activating the standard map renderer instead.")); 130 130 activateDefault(); 131 131 } else if (! AbstractMapRenderer.class.isAssignableFrom(c)) { 132 System.err.println(tr("Can''t activate map renderer class ''{0}'', because it isn''t a subclass of ''{1}''.", rendererClassName, AbstractMapRenderer.class.getName()));133 System.err.println(tr("Activating the standard map renderer instead."));132 Main.error(tr("Can''t activate map renderer class ''{0}'', because it isn''t a subclass of ''{1}''.", rendererClassName, AbstractMapRenderer.class.getName())); 133 Main.error(tr("Activating the standard map renderer instead.")); 134 134 activateDefault(); 135 135 } else { 136 136 Class<? extends AbstractMapRenderer> renderer = c.asSubclass(AbstractMapRenderer.class); 137 137 if (! isRegistered(renderer)) { 138 System.err.println(tr("Can''t activate map renderer class ''{0}'', because it isn''t registered as map renderer.", rendererClassName));139 System.err.println(tr("Activating the standard map renderer instead."));138 Main.error(tr("Can''t activate map renderer class ''{0}'', because it isn''t registered as map renderer.", rendererClassName)); 139 Main.error(tr("Activating the standard map renderer instead.")); 140 140 activateDefault(); 141 141 } else { -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r6203 r6248 1403 1403 @Override 1404 1404 public void render(final DataSet data, boolean renderVirtualNodes, Bounds bounds) { 1405 //long start = System.currentTimeMillis();1406 1405 BBox bbox = bounds.toBBox(); 1407 1406 getSettings(renderVirtualNodes); … … 1420 1419 collectWayStyles(data, sc, bbox); 1421 1420 collectRelationStyles(data, sc, bbox); 1422 //long phase1 = System.currentTimeMillis();1423 1421 sc.drawAll(); 1424 1422 sc = null; 1425 1423 drawVirtualNodes(data, bbox); 1426 1427 //long now = System.currentTimeMillis();1428 //System.err.println(String.format("PAINTING TOOK %d [PHASE1 took %d] (at scale %s)", now - start, phase1 - start, circum));1429 1424 } 1430 1425 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java
r6219 r6248 292 292 if (ds == null) { 293 293 // DataSet still not found. This should not happen, but a warning does no harm 294 System.err.println("Warning:DataSet not found while resetting nodes in Multipolygon. This should not happen, you may report it to JOSM developers.");294 Main.warn("DataSet not found while resetting nodes in Multipolygon. This should not happen, you may report it to JOSM developers."); 295 295 } else if (wayIds.size() == 1) { 296 296 Way w = (Way) ds.getPrimitiveById(wayIds.iterator().next(), OsmPrimitiveType.WAY); -
trunk/src/org/openstreetmap/josm/data/projection/AbstractProjection.java
r6135 r6248 104 104 return degree + (minute/60.0) + (second/3600.0); 105 105 } 106 107 public void dump() {108 System.err.println("x_0="+x_0);109 System.err.println("y_0="+y_0);110 System.err.println("lon_0="+lon_0);111 System.err.println("k_0="+k_0);112 System.err.println("ellps="+ellps);113 System.err.println("proj="+proj);114 System.err.println("datum="+datum);115 }116 117 106 } -
trunk/src/org/openstreetmap/josm/data/projection/Projections.java
r6135 r6248 138 138 inits.put("EPSG:" + m.group(1), Pair.create(name, m.group(2).trim())); 139 139 } else { 140 System.err.println("Warning: failed to parse line from the epsgprojection definition: "+line);140 Main.warn("Failed to parse line from the EPSG projection definition: "+line); 141 141 } 142 142 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r6142 r6248 259 259 checkerData.add(d); 260 260 } else { 261 System.err.println(tr("Invalid tagchecker line - {0}: {1}", err, line));261 Main.error(tr("Invalid tagchecker line - {0}: {1}", err, line)); 262 262 } 263 263 } … … 267 267 spellCheckKeyData.put(line.substring(1), okValue); 268 268 } else { 269 System.err.println(tr("Invalid spellcheck line: {0}", line));269 Main.error(tr("Invalid spellcheck line: {0}", line)); 270 270 } 271 271 } … … 310 310 presetsValueData.putAll(ky.key, ky.getValues()); 311 311 } catch (NullPointerException e) { 312 System.err.println(p+": Unable to initialize "+ky);312 Main.error(p+": Unable to initialize "+ky); 313 313 } 314 314 } -
trunk/src/org/openstreetmap/josm/gui/BookmarkList.java
r6203 r6248 112 112 bookmarks.add(new Bookmark(entry)); 113 113 } 114 catch (Exception e) {115 System.err.println(tr("Error reading bookmark entry: %s", e.getMessage()));114 catch (Exception e) { 115 Main.error(tr("Error reading bookmark entry: %s", e.getMessage())); 116 116 } 117 117 } … … 126 126 LinkedList<Bookmark> bookmarks = new LinkedList<Bookmark>(); 127 127 if (bookmarkFile.exists()) { 128 System.out.println("Try loading obsolete bookmarks file");128 Main.info("Try loading obsolete bookmarks file"); 129 129 BufferedReader in = new BufferedReader(new InputStreamReader( 130 130 new FileInputStream(bookmarkFile), "utf-8")); … … 133 133 Matcher m = Pattern.compile("^(.+)[,\u001e](-?\\d+.\\d+)[,\u001e](-?\\d+.\\d+)[,\u001e](-?\\d+.\\d+)[,\u001e](-?\\d+.\\d+)$").matcher(line); 134 134 if (!m.matches() || m.groupCount() != 5) { 135 System.err.println(tr("Error:Unexpected line ''{0}'' in bookmark file ''{1}''",line, bookmarkFile.toString()));135 Main.error(tr("Unexpected line ''{0}'' in bookmark file ''{1}''",line, bookmarkFile.toString())); 136 136 continue; 137 137 } … … 142 142 try { 143 143 values[i] = Double.parseDouble(m.group(i+2)); 144 } catch (NumberFormatException e) {145 System.err.println(tr("Error:Illegal double value ''{0}'' on line ''{1}'' in bookmark file ''{2}''",m.group(i+2),line, bookmarkFile.toString()));144 } catch (NumberFormatException e) { 145 Main.error(tr("Illegal double value ''{0}'' on line ''{1}'' in bookmark file ''{2}''",m.group(i+2),line, bookmarkFile.toString())); 146 146 continue; 147 147 } … … 156 156 } 157 157 save(); 158 System.out.println("Removing obsolete bookmarks file");158 Main.info("Removing obsolete bookmarks file"); 159 159 bookmarkFile.delete(); 160 160 } -
trunk/src/org/openstreetmap/josm/gui/GettingStarted.java
r6143 r6248 130 130 content = new MotdContent().updateIfRequiredString(); 131 131 } catch (IOException ex) { 132 System.out.println(tr("Warning: failed to read MOTD. Exception was: {0}", ex.toString()));132 Main.warn(tr("Failed to read MOTD. Exception was: {0}", ex.toString())); 133 133 content = "<html>" + STYLE + "<h1>" + "JOSM - " + tr("Java OpenStreetMap Editor") 134 134 + "</h1>\n<h2 align=\"center\">(" + tr("Message of the day not available") + ")</h2></html>"; -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r6246 r6248 320 320 CustomConfigurator.XMLCommandProcessor config = new CustomConfigurator.XMLCommandProcessor(Main.pref); 321 321 for (String i : args.get(Option.LOAD_PREFERENCES)) { 322 System.out.println("Reading preferences from " + i);322 info("Reading preferences from " + i); 323 323 try { 324 324 config.openAndReadXML(Utils.openURL(new URL(i))); … … 446 446 if (Main.pref.getBoolean("debug.edt-checker.enable", Version.getInstance().isLocalBuild())) { 447 447 // Repaint manager is registered so late for a reason - there is lots of violation during startup process but they don't seem to break anything and are difficult to fix 448 System.out.println("Enabled EDT checker, wrongful access to gui from non EDT thread will be printed to console");448 info("Enabled EDT checker, wrongful access to gui from non EDT thread will be printed to console"); 449 449 RepaintManager.setCurrentManager(new CheckThreadViolationRepaintManager()); 450 450 } -
trunk/src/org/openstreetmap/josm/gui/MapStatus.java
r6106 r6248 130 130 public void appendLogMessage(String message) { 131 131 if (message != null && !message.isEmpty()) { 132 System.out.println("appendLogMessage not implemented for background tasks. Message was: " + message);132 Main.info("appendLogMessage not implemented for background tasks. Message was: " + message); 133 133 } 134 134 } -
trunk/src/org/openstreetmap/josm/gui/MultiSplitLayout.java
r6093 r6248 31 31 import java.beans.PropertyChangeListener; 32 32 import java.beans.PropertyChangeSupport; 33 import java.io.IOException;34 33 import java.io.Reader; 35 34 import java.io.StreamTokenizer; … … 45 44 import javax.swing.UIManager; 46 45 46 import org.openstreetmap.josm.Main; 47 47 import org.openstreetmap.josm.tools.Utils; 48 48 … … 1263 1263 } 1264 1264 catch (Exception e) { 1265 System.err.println(e);1265 Main.error(e); 1266 1266 } 1267 1267 finally { … … 1320 1320 return parseModel(new StringReader(s)); 1321 1321 } 1322 1323 private static void printModel(String indent, Node root) {1324 if (root instanceof Split) {1325 Split split = (Split)root;1326 System.out.println(indent + split);1327 for(Node child : split.getChildren()) {1328 printModel(indent + " ", child);1329 }1330 }1331 else {1332 System.out.println(indent + root);1333 }1334 }1335 1336 /**1337 * Print the tree with enough detail for simple debugging.1338 */1339 public static void printModel(Node root) {1340 printModel("", root);1341 }1342 1322 } -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r6203 r6248 860 860 861 861 if (perDistSq < snapDistanceSq && a < c + snapDistanceSq && b < c + snapDistanceSq) { 862 //System.err.println(Double.toHexString(perDistSq));863 864 862 List<WaySegment> wslist; 865 863 if (nearestMap.containsKey(perDistSq)) { -
trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java
r6246 r6248 69 69 * // listen for BBOX events 70 70 * if (evt.getPropertyName().equals(BBoxChooser.BBOX_PROP)) { 71 * System.out.println("new bbox based on OSM tiles selected: " + (Bounds)evt.getNewValue());71 * Main.info("new bbox based on OSM tiles selected: " + (Bounds)evt.getNewValue()); 72 72 * } 73 73 * } -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMergeModel.java
r6084 r6248 719 719 return ((RelationMember)value).getMember(); 720 720 } else { 721 System.err.println("Unknown object type: "+value);721 Main.error("Unknown object type: "+value); 722 722 return null; 723 723 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
r6104 r6248 317 317 @Override 318 318 public void onConflictsRemoved(ConflictCollection conflicts) { 319 System.err.println("1 conflict has been resolved.");319 Main.info("1 conflict has been resolved."); 320 320 refreshView(); 321 321 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
r6084 r6248 204 204 } 205 205 if (!toReload.isEmpty()) { 206 System.out.println(trn("Reloading {0} map style.", "Reloading {0} map styles.", toReload.size(), toReload.size()));206 Main.info(trn("Reloading {0} map style.", "Reloading {0} map styles.", toReload.size(), toReload.size())); 207 207 Main.worker.submit(new MapPaintStyleLoader(toReload)); 208 208 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
r6246 r6248 846 846 buttonActions.add(action); 847 847 } else { 848 System.err.println("Button " + button + " doesn't have action defined");848 Main.warn("Button " + button + " doesn't have action defined"); 849 849 new Exception().printStackTrace(); 850 850 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
r6085 r6248 203 203 if (users.isEmpty()) return; 204 204 if (users.size() > 10) { 205 System.out.println(tr("Warning: only launching info browsers for the first {0} of {1} selected users", 10, users.size()));205 Main.warn(tr("Only launching info browsers for the first {0} of {1} selected users", 10, users.size())); 206 206 } 207 207 int num = Math.min(10, users.size()); -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/BasicChangesetQueryPanel.java
r6084 r6248 191 191 q = BasicQuery.valueOf(BasicQuery.class, value); 192 192 } catch(IllegalArgumentException e) { 193 System.err.println(tr("Warning: unexpected value for preference ''{0}'', got ''{1}''. Resetting to default query.","changeset-query.basic.query", value));193 Main.warn(tr("Unexpected value for preference ''{0}'', got ''{1}''. Resetting to default query.","changeset-query.basic.query", value)); 194 194 q = BasicQuery.MOST_RECENT_CHANGESETS; 195 195 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java
r6084 r6248 428 428 } catch (Exception e) { 429 429 if (canceled) { 430 System.out.println(tr("Warning: Ignoring exception because task was canceled. Exception: {0}", e 431 .toString())); 430 Main.warn(tr("Ignoring exception because task was canceled. Exception: {0}", e.toString())); 432 431 return; 433 432 } … … 521 520 } catch (Exception e) { 522 521 if (canceled) { 523 System.out.println(tr("Warning: Ignoring exception because task was canceled. Exception: {0}", e 524 .toString())); 522 Main.warn(tr("Ignoring exception because task was canceled. Exception: {0}", e.toString())); 525 523 return; 526 524 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationMemberTask.java
r6093 r6248 145 145 } catch (Exception e) { 146 146 if (canceled) { 147 System.out.println(tr("Warning: Ignoring exception because task was canceled. Exception: {0}", e 148 .toString())); 147 Main.warn(tr("Ignoring exception because task was canceled. Exception: {0}", e.toString())); 149 148 return; 150 149 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationTask.java
r6084 r6248 108 108 } catch (Exception e) { 109 109 if (canceled) { 110 System.out.println(tr("Warning: Ignoring exception because task was canceled. Exception: {0}", e 111 .toString())); 110 Main.warn(tr("Ignoring exception because task was canceled. Exception: {0}", e.toString())); 112 111 return; 113 112 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java
r6084 r6248 193 193 } catch(Exception e) { 194 194 if (canceled) { 195 System.out.println(tr("Warning:Ignoring exception because task was canceled. Exception: {0}", e.toString()));195 Main.warn(tr("Ignoring exception because task was canceled. Exception: {0}", e.toString())); 196 196 return; 197 197 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTree.java
r6084 r6248 159 159 } catch(Exception e) { 160 160 if (canceled) { 161 System.out.println(tr("Warning:Ignoring exception because task was canceled. Exception: {0}", e.toString()));161 Main.warn(tr("Ignoring exception because task was canceled. Exception: {0}", e.toString())); 162 162 return; 163 163 } -
trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java
r6105 r6248 145 145 } 146 146 } catch(Exception e) { 147 System.err.println(tr("Failed to read CSS file ''help-browser.css''. Exception is: {0}", e.toString()));147 Main.error(tr("Failed to read CSS file ''help-browser.css''. Exception is: {0}", e.toString())); 148 148 e.printStackTrace(); 149 149 return ss; … … 499 499 @Override 500 500 public void update(Observable o, Object arg) { 501 //System.out.println("BackAction: canGoBoack=" + history.canGoBack() );502 501 setEnabled(history.canGoBack()); 503 502 } … … 559 558 return true; 560 559 } 561 } catch (BadLocationException e) {562 System.err.println(tr("Warning: bad location in HTML document. Exception was: {0}", e.toString()));560 } catch (BadLocationException e) { 561 Main.warn(tr("Bad location in HTML document. Exception was: {0}", e.toString())); 563 562 e.printStackTrace(); 564 563 } -
trunk/src/org/openstreetmap/josm/gui/io/AbstractUploadTask.java
r6199 r6248 265 265 } 266 266 } 267 System.out.println(tr("Warning: error header \"{0}\" did not match with an expected pattern", errorHeader));267 Main.warn(tr("Error header \"{0}\" did not match with an expected pattern", errorHeader)); 268 268 handleUploadConflictForUnknownConflict(); 269 269 } … … 280 280 handleUploadPreconditionFailedConflict(e, conflict); 281 281 } else { 282 System.out.println(tr("Warning: error header \"{0}\" did not match with an expected pattern", e.getErrorHeader()));282 Main.warn(tr("Error header \"{0}\" did not match with an expected pattern", e.getErrorHeader())); 283 283 ExceptionDialogUtil.explainPreconditionFailed(e); 284 284 } -
trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java
r6087 r6248 106 106 setAlwaysOnTop(true); 107 107 } catch(SecurityException e) { 108 System.out.println(tr("Warning: failed to put Credential Dialog always on top. Caught security exception."));108 Main.warn(tr("Failed to put Credential Dialog always on top. Caught security exception.")); 109 109 } 110 110 build(); -
trunk/src/org/openstreetmap/josm/gui/io/DownloadFileTask.java
r6070 r6248 18 18 import java.util.zip.ZipFile; 19 19 20 import org.openstreetmap.josm.Main; 20 21 import org.openstreetmap.josm.gui.PleaseWaitDialog; 21 22 import org.openstreetmap.josm.gui.PleaseWaitRunnable; … … 121 122 Utils.close(out); 122 123 if (!canceled) { 123 System.out.println(tr("Download finished"));124 Main.info(tr("Download finished")); 124 125 if (unpack) { 125 System.out.println(tr("Unpacking {0} into {1}", file.getAbsolutePath(), file.getParent()));126 Main.info(tr("Unpacking {0} into {1}", file.getAbsolutePath(), file.getParent())); 126 127 unzipFileRecursively(file, file.getParent()); 127 128 file.delete(); … … 129 130 } 130 131 } catch(MalformedURLException e) { 131 String msg = tr(" Warning:Cannot download file ''{0}''. Its download link ''{1}'' is not a valid URL. Skipping download.", file.getName(), address);132 System.err.println(msg);132 String msg = tr("Cannot download file ''{0}''. Its download link ''{1}'' is not a valid URL. Skipping download.", file.getName(), address); 133 Main.warn(msg); 133 134 throw new DownloadException(msg); 134 135 } catch (IOException e) { -
trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java
r5890 r6248 117 117 im.setPartiallyIdentified(im.getUserName()); 118 118 } 119 System.err.println(tr("Warning:Failed to retrieve user infos for the current JOSM user. Exception was: {0}", e.toString()));119 Main.warn(tr("Failed to retrieve user infos for the current JOSM user. Exception was: {0}", e.toString())); 120 120 } 121 121 } -
trunk/src/org/openstreetmap/josm/gui/io/UploadLayerTask.java
r5266 r6248 7 7 import java.util.HashSet; 8 8 9 import org.openstreetmap.josm.Main; 9 10 import org.openstreetmap.josm.actions.upload.CyclicUploadDependencyException; 10 11 import org.openstreetmap.josm.data.APIDataSet; … … 93 94 // we tried to delete an already deleted primitive. 94 95 // 95 System.out.println(tr("Warning: object ''{0}'' is already deleted on the server. Skipping this object and retrying to upload.", p.getDisplayName(DefaultNameFormatter.getInstance())));96 Main.warn(tr("Object ''{0}'' is already deleted on the server. Skipping this object and retrying to upload.", p.getDisplayName(DefaultNameFormatter.getInstance()))); 96 97 processedPrimitives.addAll(writer.getProcessedPrimitives()); 97 98 processedPrimitives.add(p); … … 138 139 } catch (Exception sxe) { 139 140 if (isCanceled()) { 140 System.out.println("Ignoring exception caught because upload is canceled. Exception is: " + sxe.toString());141 Main.info("Ignoring exception caught because upload is canceled. Exception is: " + sxe.toString()); 141 142 return; 142 143 } -
trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java
r6132 r6248 26 26 import org.openstreetmap.josm.gui.HelpAwareOptionPane; 27 27 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec; 28 import org.openstreetmap.josm.gui.Notification; 28 29 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 29 30 import org.openstreetmap.josm.gui.progress.ProgressMonitor; … … 37 38 import org.openstreetmap.josm.tools.ImageProvider; 38 39 import org.xml.sax.SAXException; 39 40 import org.openstreetmap.josm.gui.Notification;41 40 42 41 /** … … 206 205 } 207 206 monitor.appendLogMessage(msg); 208 System.out.println(tr("Warning: {0}", msg));207 Main.warn(msg); 209 208 processedPrimitives.addAll(writer.getProcessedPrimitives()); 210 209 processedPrimitives.add(p); … … 301 300 } catch (Exception e) { 302 301 if (uploadCanceled) { 303 System.out.println(tr("Ignoring caught exception because upload is canceled. Exception is: {0}", e.toString()));302 Main.info(tr("Ignoring caught exception because upload is canceled. Exception is: {0}", e.toString())); 304 303 } else { 305 304 lastException = e; -
trunk/src/org/openstreetmap/josm/gui/io/UploadSelectionDialog.java
r6084 r6248 151 151 public List<OsmPrimitive> getSelectedPrimitives() { 152 152 ArrayList<OsmPrimitive> ret = new ArrayList<OsmPrimitive>(); 153 System.out.println("selected length:" +lstSelectedPrimitives.getSelectedIndices().length);154 for (int i=0; i< lstSelectedPrimitives.getSelectedIndices().length;i++) {155 System.out.println("selected:" +lstSelectedPrimitives.getSelectedIndices()[i]);156 }157 153 ret.addAll(lstSelectedPrimitives.getOsmPrimitiveListModel().getPrimitives(lstSelectedPrimitives.getSelectedIndices())); 158 154 ret.addAll(lstDeletedPrimitives.getOsmPrimitiveListModel().getPrimitives(lstDeletedPrimitives.getSelectedIndices())); -
trunk/src/org/openstreetmap/josm/gui/io/UploadStrategy.java
r5266 r6248 86 86 UploadStrategy strategy = fromPreference(v); 87 87 if (strategy == null) { 88 System.err.println(tr("Warning: unexpected value for key ''{0}'' in preferences, got ''{1}''", "osm-server.upload-strategy", v ));88 Main.warn(tr("Unexpected value for key ''{0}'' in preferences, got ''{1}''", "osm-server.upload-strategy", v )); 89 89 return DEFAULT_UPLOAD_STRATEGY; 90 90 } -
trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
r6232 r6248 135 135 } 136 136 } 137 //System.out.println("scanning "+data.tracks.size()+" tracks, found min,max"+min+"--"+max);138 137 if (min==1e100 || max==-1e100) return null; 139 138 return new Date[]{new Date((long) (min * 1000)), new Date((long) (max * 1000)), }; … … 425 424 ********** STEP 1 - GET CONFIG VALUES ************************** 426 425 ****************************************************************/ 427 // Long startTime = System.currentTimeMillis();428 426 Color neutralColor = getColor(true); 429 427 String spec="layer "+getName(); … … 788 786 g.setStroke(storedStroke); 789 787 } 790 // Long duration = System.currentTimeMillis() - startTime;791 // System.out.println(duration);792 788 } // end paint 793 789 -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r6084 r6248 396 396 data.setVersion(from.getVersion()); 397 397 } else if ("0.5".equals(data.getVersion()) ^ "0.5".equals(from.getVersion())) { 398 System.err.println(tr("Warning: mixing 0.6 and 0.5 data results in version 0.5"));398 Main.warn(tr("Mixing 0.6 and 0.5 data results in version 0.5")); 399 399 data.setVersion("0.5"); 400 400 } -
trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
r6093 r6248 329 329 String r = new Scanner(in).useDelimiter("\\A").next(); 330 330 Utils.close(in); 331 System.out.println("Successfully loaded Bing attribution data.");331 Main.info("Successfully loaded Bing attribution data."); 332 332 return r.getBytes("utf-8"); 333 333 } … … 347 347 return parseAttributionText(new InputSource(new StringReader((xml)))); 348 348 } catch (IOException ex) { 349 System.err.println("Could not connect to Bing API. Will retry in " + waitTimeSec + " seconds.");349 Main.warn("Could not connect to Bing API. Will retry in " + waitTimeSec + " seconds."); 350 350 Thread.sleep(waitTimeSec * 1000L); 351 351 waitTimeSec *= 2; -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r6246 r6248 1052 1052 delta = Math.round(diff - timezone*60*60); // seconds 1053 1053 1054 /* System.out.println("phto " + firstExifDate);1055 System.out.println("gpx " + firstGPXDate);1056 System.out.println("diff " + diff);1057 System.out.println("difh " + diffInH);1058 System.out.println("days " + dayOffset);1059 System.out.println("time " + tz);1060 System.out.println("fix " + timezone);1061 System.out.println("offt " + delta);*/1054 /*Main.debug("phto " + firstExifDate); 1055 Main.debug("gpx " + firstGPXDate); 1056 Main.debug("diff " + diff); 1057 Main.debug("difh " + diffInH); 1058 Main.debug("days " + dayOffset); 1059 Main.debug("time " + tz); 1060 Main.debug("fix " + timezone); 1061 Main.debug("offt " + delta);*/ 1062 1062 1063 1063 tfTimezone.getDocument().removeDocumentListener(statusBarUpdater); … … 1160 1160 1161 1161 } catch(ParseException e) { 1162 System.err.println("Error while parsing date \"" + curWpTimeStr + '"');1162 Main.error("Error while parsing date \"" + curWpTimeStr + '"'); 1163 1163 e.printStackTrace(); 1164 1164 prevWp = null; -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r6209 r6248 558 558 559 559 } catch (Exception ex) { // (other exceptions, e.g. #5271) 560 System.err.println("Error reading EXIF from file: "+ex);560 Main.error("Error reading EXIF from file: "+ex); 561 561 e.setExifCoor(null); 562 562 e.setPos(null); … … 651 651 652 652 if (toDelete.getFile().delete()) { 653 System.out.println("File "+toDelete.getFile().toString()+" deleted. ");653 Main.info("File "+toDelete.getFile().toString()+" deleted. "); 654 654 } else { 655 655 JOptionPane.showMessageDialog( -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoader.java
r6084 r6248 37 37 @Override 38 38 public void run() { 39 System.err.println("Load Thumbnails");39 Main.debug("Load Thumbnails"); 40 40 tracker = new MediaTracker(Main.map.mapView); 41 41 for (int i = 0; i < data.size(); i++) { … … 71 71 if (!cacheOff) { 72 72 BufferedImage cached = cache.getImg(cacheIdent); 73 if (cached != null) {74 System.err.println(" from cache");73 if (cached != null) { 74 Main.debug(" from cache"); 75 75 return cached; 76 76 } … … 82 82 tracker.waitForID(0); 83 83 } catch (InterruptedException e) { 84 System.err.println(" InterruptedException");84 Main.error(" InterruptedException"); 85 85 return null; 86 86 } 87 87 if (tracker.isErrorID(1) || img.getWidth(null) <= 0 || img.getHeight(null) <= 0) { 88 System.err.println(" Invalid image");88 Main.error(" Invalid image"); 89 89 return null; 90 90 } … … 104 104 105 105 if (scaledBI.getWidth() <= 0 || scaledBI.getHeight() <= 0) { 106 System.err.println(" Invalid image");106 Main.error(" Invalid image"); 107 107 return null; 108 108 } … … 112 112 } 113 113 114 System.err.println("");115 114 return scaledBI; 116 115 } -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java
r6104 r6248 131 131 url = wavFile.toURI().toURL(); 132 132 } catch (MalformedURLException e) { 133 System.err.println("Unable to convert filename " + wavFile.getAbsolutePath() + " to URL");133 Main.error("Unable to convert filename " + wavFile.getAbsolutePath() + " to URL"); 134 134 } 135 135 Collection<WayPoint> waypoints = new ArrayList<WayPoint>(); -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
r6242 r6248 291 291 } 292 292 } catch (URISyntaxException e) { 293 Main.warn( "URISyntaxException: "+e.getMessage());293 Main.warn(e); 294 294 } 295 295 return true; -
trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java
r6142 r6248 11 11 import java.util.regex.Pattern; 12 12 13 import org.openstreetmap.josm.Main; 13 14 import org.openstreetmap.josm.gui.mappaint.mapcss.CSSColors; 14 15 import org.openstreetmap.josm.tools.Utils; … … 49 50 if (res == null) { 50 51 if (!suppressWarnings) { 51 System.err.println(String.format("Warning: unable to convert property %s to type %s: found %s of type %s!", key, klass, o, o.getClass()));52 Main.warn(String.format("Unable to convert property %s to type %s: found %s of type %s!", key, klass, o, o.getClass())); 52 53 } 53 54 return def; -
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
r6174 r6248 100 100 .setHeight(height) 101 101 .setOptional(true).get(); 102 if(i == null) 103 { 104 System.out.println("Mappaint style \""+namespace+"\" ("+ref.source.getDisplayString()+") icon \"" + ref.iconName + "\" not found."); 102 if (i == null) { 103 Main.warn("Mappaint style \""+namespace+"\" ("+ref.source.getDisplayString()+") icon \"" + ref.iconName + "\" not found."); 105 104 return null; 106 105 } … … 243 242 } 244 243 } 245 System.err.println("Warning:Could not detect style type. Using default (xml).");244 Main.warn("Could not detect style type. Using default (xml)."); 246 245 return new XmlStyleSource(entry); 247 246 } 248 247 } catch (IOException e) { 249 System.err.println(tr("Warning: failed to load Mappaint styles from ''{0}''. Exception was: {1}", entry.url, e.toString()));248 Main.warn(tr("Failed to load Mappaint styles from ''{0}''. Exception was: {1}", entry.url, e.toString())); 250 249 e.printStackTrace(); 251 250 } finally { -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
r6142 r6248 525 525 throw new RuntimeException(ex); 526 526 } catch (InvocationTargetException ex) { 527 System.err.println(ex);527 Main.error(ex); 528 528 return null; 529 529 } … … 574 574 throw new RuntimeException(ex); 575 575 } catch (InvocationTargetException ex) { 576 System.err.println(ex);576 Main.error(ex); 577 577 return null; 578 578 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj
r5705 r6248 27 27 import org.openstreetmap.josm.tools.Pair; 28 28 import org.openstreetmap.josm.tools.Utils; 29 import org.openstreetmap.josm.Main; 29 30 30 31 public class MapCSSParser { … … 573 574 } 574 575 575 System.err.println("Skipping to the next rule, because of an error:");576 System.err.println(e);576 Main.error("Skipping to the next rule, because of an error:"); 577 Main.error(e); 577 578 if (sheet != null) { 578 579 sheet.logError(e); … … 598 599 t.image.contains("\n")) { 599 600 ParseException e = new ParseException(String.format("Warning: end of line while reading an unquoted string at line %s column %s.", t.beginLine, t.beginColumn)); 600 System.err.println(e);601 Main.error(e); 601 602 if (sheet != null) { 602 603 sheet.logError(e); -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
r6175 r6248 15 15 import java.util.zip.ZipFile; 16 16 17 import org.openstreetmap.josm.Main; 17 18 import org.openstreetmap.josm.data.osm.Node; 18 19 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 70 71 loadMeta(); 71 72 loadCanvas(); 72 } catch (IOException e) {73 System.err.println(tr("Warning: failed to load Mappaint styles from ''{0}''. Exception was: {1}", url, e.toString()));73 } catch (IOException e) { 74 Main.warn(tr("Failed to load Mappaint styles from ''{0}''. Exception was: {1}", url, e.toString())); 74 75 e.printStackTrace(); 75 76 logError(e); 76 77 } catch (TokenMgrError e) { 77 System.err.println(tr("Warning: failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage()));78 Main.warn(tr("Failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage())); 78 79 e.printStackTrace(); 79 80 logError(e); 80 81 } catch (ParseException e) { 81 System.err.println(tr("Warning: failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage()));82 Main.warn(tr("Failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage())); 82 83 e.printStackTrace(); 83 84 logError(new ParseException(e.getMessage())); // allow e to be garbage collected, it links to the entire token stream -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
r6175 r6248 5 5 import java.util.regex.PatternSyntaxException; 6 6 7 import org.openstreetmap.josm.Main; 7 8 import org.openstreetmap.josm.data.osm.Node; 8 9 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 224 225 if (!c.applies(env)) return false; 225 226 } catch (PatternSyntaxException e) { 226 System.err.println("PatternSyntaxException while applying condition" + c +": "+e.getMessage());227 Main.error("PatternSyntaxException while applying condition" + c +": "+e.getMessage()); 227 228 return false; 228 229 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/xml/LinePrototype.java
r3856 r6248 5 5 import java.util.List; 6 6 7 import org.openstreetmap.josm.Main; 7 8 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings; 8 9 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors; … … 62 63 } 63 64 if (f < 0) { 64 System.err.println(I18n.tr("Illegal dash pattern, values must be positive"));65 Main.error(I18n.tr("Illegal dash pattern, values must be positive")); 65 66 this.dashed = null; 66 67 return; … … 70 71 this.dashed = dashed; 71 72 } else { 72 System.err.println(I18n.tr("Illegal dash pattern, at least one value must be > 0"));73 Main.error(I18n.tr("Illegal dash pattern, at least one value must be > 0")); 73 74 } 74 75 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java
r6148 r6248 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.io.IOException; 6 7 import java.io.InputStream; 7 8 import java.io.InputStreamReader; 8 import java.io.IOException;9 9 import java.util.Collection; 10 10 import java.util.Collections; … … 76 76 } 77 77 78 } catch (IOException e) {79 System.err.println(tr("Warning: failed to load Mappaint styles from ''{0}''. Exception was: {1}", url, e.toString()));78 } catch (IOException e) { 79 Main.warn(tr("Failed to load Mappaint styles from ''{0}''. Exception was: {1}", url, e.toString())); 80 80 e.printStackTrace(); 81 81 logError(e); 82 } catch (SAXParseException e) {83 System.err.println(tr("Warning: failed to parse Mappaint styles from ''{0}''. Error was: [{1}:{2}] {3}", url, e.getLineNumber(), e.getColumnNumber(), e.getMessage()));82 } catch (SAXParseException e) { 83 Main.warn(tr("Failed to parse Mappaint styles from ''{0}''. Error was: [{1}:{2}] {3}", url, e.getLineNumber(), e.getColumnNumber(), e.getMessage())); 84 84 e.printStackTrace(); 85 85 logError(e); 86 } catch (SAXException e) {87 System.err.println(tr("Warning: failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage()));86 } catch (SAXException e) { 87 Main.warn(tr("Failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage())); 88 88 e.printStackTrace(); 89 89 logError(e); -
trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSourceHandler.java
r6246 r6248 73 73 private void error(String message) { 74 74 String warning = style.getDisplayString() + " (" + rule.cond.key + "=" + rule.cond.value + "): " + message; 75 System.err.println(warning);75 Main.warn(warning); 76 76 style.logError(new Exception(warning)); 77 77 } -
trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
r6070 r6248 110 110 con.disconnect(); 111 111 } 112 } catch (NoSuchFieldException e) {112 } catch (NoSuchFieldException e) { 113 113 e.printStackTrace(); 114 System.err.println(tr("Warning: failed to cancel running OAuth operation"));115 } catch (SecurityException e) {114 Main.warn(tr("Failed to cancel running OAuth operation")); 115 } catch (SecurityException e) { 116 116 e.printStackTrace(); 117 System.err.println(tr("Warning: failed to cancel running OAuth operation"));118 } catch (IllegalAccessException e) {117 Main.warn(tr("Failed to cancel running OAuth operation")); 118 } catch (IllegalAccessException e) { 119 119 e.printStackTrace(); 120 System.err.println(tr("Warning: failed to cancel running OAuth operation"));120 Main.warn(tr("Failed to cancel running OAuth operation")); 121 121 } 122 122 } -
trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
r6106 r6248 1247 1247 Matcher m = Pattern.compile("^\t([^:]+): *(.+)$").matcher(line); 1248 1248 if (! m.matches()) { 1249 System.err.println(tr(getStr(I18nString.ILLEGAL_FORMAT_OF_ENTRY), url, line));1249 Main.error(tr(getStr(I18nString.ILLEGAL_FORMAT_OF_ENTRY), url, line)); 1250 1250 continue; 1251 1251 } … … 1291 1291 sources.add(last = new ExtendedSourceEntry(m.group(1), m.group(2))); 1292 1292 } else { 1293 System.err.println(tr(getStr(I18nString.ILLEGAL_FORMAT_OF_ENTRY), url, line));1293 Main.error(tr(getStr(I18nString.ILLEGAL_FORMAT_OF_ENTRY), url, line)); 1294 1294 } 1295 1295 } -
trunk/src/org/openstreetmap/josm/gui/preferences/SourceEntry.java
r6152 r6248 7 7 import java.util.regex.Matcher; 8 8 import java.util.regex.Pattern; 9 10 import org.openstreetmap.josm.Main; 9 11 10 12 /** … … 127 129 return m.group(1); 128 130 } else { 129 System.err.println("Warning:Unexpected URL format: "+url);131 Main.warn("Unexpected URL format: "+url); 130 132 return url; 131 133 } -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r6070 r6248 904 904 Object tb = action.getValue("toolbar"); 905 905 if(tb == null) { 906 System.out.println(tr("Toolbar action without name: {0}",906 Main.info(tr("Toolbar action without name: {0}", 907 907 action.getClass().getName())); 908 908 continue; 909 909 } else if (!(tb instanceof String)) { 910 910 if(!(tb instanceof Boolean) || (Boolean)tb) { 911 System.out.println(tr("Strange toolbar value: {0}",911 Main.info(tr("Strange toolbar value: {0}", 912 912 action.getClass().getName())); 913 913 } … … 917 917 Action r = actions.get(toolbar); 918 918 if(r != null && r != action && !toolbar.startsWith("imagery_")) { 919 System.out.println(tr("Toolbar action {0} overwritten: {1} gets {2}",919 Main.info(tr("Toolbar action {0} overwritten: {1} gets {2}", 920 920 toolbar, r.getClass().getName(), action.getClass().getName())); 921 921 } … … 988 988 result.add(a); 989 989 } else { 990 System.out.println("Could not load tool definition "+s);990 Main.info("Could not load tool definition "+s); 991 991 } 992 992 } … … 1001 1001 public Action register(Action action) { 1002 1002 String toolbar = (String) action.getValue("toolbar"); 1003 if (toolbar == null) {1004 System.out.println(tr("Registered toolbar action without name: {0}",1003 if (toolbar == null) { 1004 Main.info(tr("Registered toolbar action without name: {0}", 1005 1005 action.getClass().getName())); 1006 1006 } else { 1007 1007 Action r = regactions.get(toolbar); 1008 if (r != null) {1009 System.out.println(tr("Registered toolbar action {0} overwritten: {1} gets {2}",1008 if (r != null) { 1009 Main.info(tr("Registered toolbar action {0} overwritten: {1} gets {2}", 1010 1010 toolbar, r.getClass().getName(), action.getClass().getName())); 1011 1011 } -
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java
r6246 r6248 2 2 package org.openstreetmap.josm.gui.preferences.advanced; 3 3 4 import static org.openstreetmap.josm.tools.I18n.marktr; 4 5 import static org.openstreetmap.josm.tools.I18n.tr; 5 import static org.openstreetmap.josm.tools.I18n.marktr;6 6 7 7 import java.awt.Dimension; … … 17 17 import java.util.Map; 18 18 import java.util.Map.Entry; 19 19 20 import javax.swing.AbstractAction; 20 21 21 import javax.swing.Box; 22 22 import javax.swing.JButton; … … 356 356 if (idx>=0) { 357 357 String t=s.substring(0,idx); 358 System.out.println(t); 359 if (profileTypes.containsKey(t)) 358 if (profileTypes.containsKey(t)) { 360 359 p.add(new ImportProfileAction(s, f, t)); 360 } 361 361 } 362 362 } … … 366 366 if (idx>=0) { 367 367 String t=s.substring(0,idx); 368 if (profileTypes.containsKey(t)) 368 if (profileTypes.containsKey(t)) { 369 369 p.add(new ImportProfileAction(s, f, t)); 370 } 370 371 } 371 372 } -
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ExportProfileAction.java
r6023 r6248 1 1 // License: GPL. See LICENSE file for details. 2 2 package org.openstreetmap.josm.gui.preferences.advanced; 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 3 5 4 6 import java.awt.event.ActionEvent; … … 6 8 import java.util.ArrayList; 7 9 import java.util.Map; 10 8 11 import javax.swing.AbstractAction; 9 12 import javax.swing.JFileChooser; 10 13 import javax.swing.JOptionPane; 11 14 import javax.swing.filechooser.FileFilter; 15 12 16 import org.openstreetmap.josm.Main; 13 17 import org.openstreetmap.josm.actions.DiskAccessAction; … … 15 19 import org.openstreetmap.josm.data.Preferences; 16 20 import org.openstreetmap.josm.data.Preferences.Setting; 17 18 import static org.openstreetmap.josm.tools.I18n.tr;19 21 20 22 /** … … 70 72 if (!sel.getName().endsWith(".xml")) sel=new File(sel.getAbsolutePath()+".xml"); 71 73 if (!sel.getName().startsWith(schemaKey)) { 72 System.out.println(sel.getParentFile().getAbsolutePath()+"/"+schemaKey+"_"+sel.getName()); 73 sel =new File(sel.getParentFile().getAbsolutePath()+"/"+schemaKey+"_"+sel.getName()); 74 sel = new File(sel.getParentFile().getAbsolutePath()+"/"+schemaKey+"_"+sel.getName()); 74 75 } 75 76 return sel; -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java
r6084 r6248 22 22 import javax.swing.JScrollPane; 23 23 24 import org.openstreetmap.josm.Main; 24 25 import org.openstreetmap.josm.data.imagery.ImageryInfo; 25 26 import org.openstreetmap.josm.gui.bbox.SlippyMapBBoxChooser; … … 83 84 JOptionPane.showMessageDialog(getParent(), tr("Could not parse WMS layer list."), 84 85 tr("WMS Error"), JOptionPane.ERROR_MESSAGE); 85 System.err.println("Could not parse WMS layer list. Incoming data:"); 86 System.err.println(ex.getIncomingData()); 86 Main.error("Could not parse WMS layer list. Incoming data:\n"+ex.getIncomingData()); 87 87 } 88 88 } -
trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java
r6246 r6248 84 84 canLoad = true; 85 85 } catch (IOException e) { 86 System.err.println(tr("Warning:Could not read tagging preset source: {0}", source));86 Main.warn(tr("Could not read tagging preset source: {0}", source)); 87 87 ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Error"), 88 88 new String[] {tr("Yes"), tr("No"), tr("Cancel")}); … … 108 108 // Should not happen, but at least show message 109 109 String msg = tr("Could not read tagging preset source {0}", source); 110 System.err.println(msg);110 Main.error(msg); 111 111 JOptionPane.showMessageDialog(Main.parent, msg); 112 112 return false; … … 135 135 136 136 if (errorMessage != null) { 137 System.err.println("Error: "+errorMessage);137 Main.error(errorMessage); 138 138 int result = JOptionPane.showConfirmDialog(Main.parent, new JLabel(errorMessage), tr("Error"), 139 139 JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.ERROR_MESSAGE); -
trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java
r6084 r6248 104 104 rbOAuth.setSelected(true); 105 105 } else { 106 System.err.println(tr("Warning:Unsupported value in preference ''{0}'', got ''{1}''. Using authentication method ''Basic Authentication''.", "osm-server.auth-method", authMethod));106 Main.warn(tr("Unsupported value in preference ''{0}'', got ''{1}''. Using authentication method ''Basic Authentication''.", "osm-server.auth-method", authMethod)); 107 107 rbBasicAuthentication.setSelected(true); 108 108 } -
trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java
r5886 r6248 15 15 import javax.swing.JPanel; 16 16 17 import org.openstreetmap.josm.Main; 17 18 import org.openstreetmap.josm.gui.widgets.JosmPasswordField; 18 19 import org.openstreetmap.josm.gui.widgets.JosmTextField; … … 103 104 } catch(CredentialsAgentException e) { 104 105 e.printStackTrace(); 105 System.err.println(tr("Warning: failed to retrieve OSM credentials from credential manager."));106 System.err.println(tr("Current credential manager is of type ''{0}''", cm.getClass().getName()));106 Main.warn(tr("Failed to retrieve OSM credentials from credential manager.")); 107 Main.warn(tr("Current credential manager is of type ''{0}''", cm.getClass().getName())); 107 108 tfOsmUserName.setText(""); 108 109 tfOsmPassword.setText(""); … … 118 119 ); 119 120 cm.store(RequestorType.SERVER, OsmApi.getOsmApi().getHost(), pa); 120 } catch (CredentialsAgentException e) {121 } catch (CredentialsAgentException e) { 121 122 e.printStackTrace(); 122 System.err.println(tr("Warning: failed to save OSM credentials to credential manager."));123 System.err.println(tr("Current credential manager is of type ''{0}''", cm.getClass().getName()));123 Main.warn(tr("Failed to save OSM credentials to credential manager.")); 124 Main.warn(tr("Current credential manager is of type ''{0}''", cm.getClass().getName())); 124 125 } 125 126 } -
trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAccessTokenHolder.java
r4245 r6248 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import org.openstreetmap.josm.Main; 6 7 import org.openstreetmap.josm.data.Preferences; 7 8 import org.openstreetmap.josm.data.oauth.OAuthToken; … … 144 145 } catch(CredentialsAgentException e) { 145 146 e.printStackTrace(); 146 System.err.println(tr("Warning:Failed to retrieve OAuth Access Token from credential manager"));147 System.err.println(tr("Current credential manager is of type ''{0}''", cm.getClass().getName()));147 Main.warn(tr("Failed to retrieve OAuth Access Token from credential manager")); 148 Main.warn(tr("Current credential manager is of type ''{0}''", cm.getClass().getName())); 148 149 } 149 150 saveToPreferences = pref.getBoolean("oauth.access-token.save-to-preferences", true); … … 175 176 } catch(CredentialsAgentException e){ 176 177 e.printStackTrace(); 177 System.err.println(tr("Warning:Failed to store OAuth Access Token to credentials manager"));178 System.err.println(tr("Current credential manager is of type ''{0}''", cm.getClass().getName()));178 Main.warn(tr("Failed to store OAuth Access Token to credentials manager")); 179 Main.warn(tr("Current credential manager is of type ''{0}''", cm.getClass().getName())); 179 180 } 180 181 } -
trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java
r5899 r6248 316 316 317 317 if (pp.equals(ProxyPolicy.USE_SYSTEM_SETTINGS) && ! DefaultProxySelector.willJvmRetrieveSystemProxies()) { 318 System.err.println(tr("Warning:JOSM is configured to use proxies from the system setting, but the JVM is not configured to retrieve them. Resetting preferences to ''No proxy''"));318 Main.warn(tr("JOSM is configured to use proxies from the system setting, but the JVM is not configured to retrieve them. Resetting preferences to ''No proxy''")); 319 319 pp = ProxyPolicy.NO_PROXY; 320 320 rbProxyPolicy.get(pp).setSelected(true); -
trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
r6070 r6248 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.preferences.shortcut; 3 4 import static org.openstreetmap.josm.tools.I18n.marktr; 5 import static org.openstreetmap.josm.tools.I18n.tr; 3 6 4 7 import java.awt.Color; … … 9 12 import java.awt.Insets; 10 13 import java.awt.Toolkit; 11 12 import static org.openstreetmap.josm.tools.I18n.marktr;13 import static org.openstreetmap.josm.tools.I18n.tr;14 15 14 import java.awt.event.KeyEvent; 16 15 import java.lang.reflect.Field; … … 18 17 import java.util.LinkedHashMap; 19 18 import java.util.Map; 20 21 19 import java.util.regex.PatternSyntaxException; 20 22 21 import javax.swing.AbstractAction; 23 22 import javax.swing.BorderFactory; … … 38 37 import javax.swing.event.ListSelectionListener; 39 38 import javax.swing.table.AbstractTableModel; 40 import javax.swing.table.TableModel;41 39 import javax.swing.table.DefaultTableCellRenderer; 42 40 import javax.swing.table.TableColumnModel; 43 41 import javax.swing.table.TableModel; 44 42 import javax.swing.table.TableRowSorter; 43 45 44 import org.openstreetmap.josm.Main; 46 45 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 46 import org.openstreetmap.josm.gui.widgets.JosmTextField; 47 47 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator; 48 48 import org.openstreetmap.josm.tools.Shortcut; 49 import org.openstreetmap.josm.gui.widgets.JosmTextField;50 49 51 50 /** … … 117 116 if (s != null && s.length() > 0 && !s.contains(unknown)) { 118 117 list.put(Integer.valueOf(i), s); 119 //System.out.println(i+": "+s);120 118 } 121 119 } catch (Exception e) { -
trunk/src/org/openstreetmap/josm/gui/tagging/TagTable.java
r6092 r6248 17 17 import java.util.Collections; 18 18 import java.util.EventObject; 19 import java.util.HashMap;20 import java.util.List;21 import java.util.Map;22 19 import java.util.concurrent.CopyOnWriteArrayList; 23 20 24 21 import javax.swing.AbstractAction; 25 import static javax.swing.Action.SHORT_DESCRIPTION;26 import static javax.swing.Action.SMALL_ICON;27 22 import javax.swing.CellEditor; 28 23 import javax.swing.DefaultListSelectionModel; … … 38 33 import javax.swing.table.TableColumn; 39 34 import javax.swing.text.JTextComponent; 35 40 36 import org.openstreetmap.josm.Main; 41 37 import org.openstreetmap.josm.actions.PasteTagsAction.TagPaster; 42 38 import org.openstreetmap.josm.data.osm.OsmPrimitive; 43 39 import org.openstreetmap.josm.data.osm.Relation; 44 45 40 import org.openstreetmap.josm.gui.dialogs.relation.RunnableAction; 41 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList; 46 42 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager; 47 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList;48 43 import org.openstreetmap.josm.tools.ImageProvider; 49 44 … … 464 459 public void setAutoCompletionManager(AutoCompletionManager autocomplete) { 465 460 if (autocomplete == null) { 466 System.out.println("argument autocomplete should not be null. Aborting.");461 Main.warn("argument autocomplete should not be null. Aborting."); 467 462 Thread.dumpStack(); 468 463 return; -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r6101 r6248 150 150 }); 151 151 } else { 152 System.out.println("Could not get presets icon " + iconName);152 Main.warn("Could not get presets icon " + iconName); 153 153 } 154 154 } … … 167 167 this.nameTemplate = new TemplateParser(pattern).parse(); 168 168 } catch (ParseError e) { 169 System.err.println("Error while parsing " + pattern + ": " + e.getMessage());169 Main.error("Error while parsing " + pattern + ": " + e.getMessage()); 170 170 throw new SAXException(e); 171 171 } … … 176 176 this.nameTemplateFilter = SearchCompiler.compile(filter, false, false); 177 177 } catch (org.openstreetmap.josm.actions.search.SearchCompiler.ParseError e) { 178 System.err.println("Error while parsing" + filter + ": " + e.getMessage());178 Main.error("Error while parsing" + filter + ": " + e.getMessage()); 179 179 throw new SAXException(e); 180 180 } -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
r6246 r6248 626 626 pnl.add(aibutton, GBC.std()); 627 627 } catch (ParseException x) { 628 System.err.println("Cannot parse auto-increment value of '" + ai + "' into an integer");628 Main.error("Cannot parse auto-increment value of '" + ai + "' into an integer"); 629 629 } 630 630 } … … 673 673 String v = getValue(value); 674 674 if (v == null) { 675 System.err.println("No 'last value' support for component " + value);675 Main.error("No 'last value' support for component " + value); 676 676 return; 677 677 } … … 921 921 } else { 922 922 if (values != null) { 923 System.err.println(tr("Warning in tagging preset \"{0}-{1}\": "923 Main.warn(tr("Warning in tagging preset \"{0}-{1}\": " 924 924 + "Ignoring ''{2}'' attribute as ''{3}'' elements are given.", 925 925 key, text, "values", "list_entry")); 926 926 } 927 927 if (display_values != null || locale_display_values != null) { 928 System.err.println(tr("Warning in tagging preset \"{0}-{1}\": "928 Main.warn(tr("Warning in tagging preset \"{0}-{1}\": " 929 929 + "Ignoring ''{2}'' attribute as ''{3}'' elements are given.", 930 930 key, text, "display_values", "list_entry")); 931 931 } 932 932 if (short_descriptions != null || locale_short_descriptions != null) { 933 System.err.println(tr("Warning in tagging preset \"{0}-{1}\": "933 Main.warn(tr("Warning in tagging preset \"{0}-{1}\": " 934 934 + "Ignoring ''{2}'' attribute as ''{3}'' elements are given.", 935 935 key, text, "short_descriptions", "list_entry")); … … 963 963 value_array = (String[]) method.invoke(null); 964 964 } else { 965 System.err.println(tr("Broken tagging preset \"{0}-{1}\" - Java method given in ''values_from'' is not \"{2}\"", key, text,965 Main.error(tr("Broken tagging preset \"{0}-{1}\" - Java method given in ''values_from'' is not \"{2}\"", key, text, 966 966 "public static String[] methodName()")); 967 967 } 968 968 } catch (Exception e) { 969 System.err.println(tr("Broken tagging preset \"{0}-{1}\" - Java method given in ''values_from'' threw {2} ({3})", key, text,969 Main.error(tr("Broken tagging preset \"{0}-{1}\" - Java method given in ''values_from'' threw {2} ({3})", key, text, 970 970 e.getClass().getName(), e.getMessage())); 971 971 } … … 984 984 985 985 if (display_array.length != value_array.length) { 986 System.err.println(tr("Broken tagging preset \"{0}-{1}\" - number of items in ''display_values'' must be the same as in ''values''", key, text));986 Main.error(tr("Broken tagging preset \"{0}-{1}\" - number of items in ''display_values'' must be the same as in ''values''", key, text)); 987 987 display_array = value_array; 988 988 } 989 989 990 990 if (short_descriptions_array != null && short_descriptions_array.length != value_array.length) { 991 System.err.println(tr("Broken tagging preset \"{0}-{1}\" - number of items in ''short_descriptions'' must be the same as in ''values''", key, text));991 Main.error(tr("Broken tagging preset \"{0}-{1}\" - number of items in ''short_descriptions'' must be the same as in ''values''", key, text)); 992 992 short_descriptions_array = null; 993 993 } -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetReader.java
r6198 r6248 187 187 allPresets.addAll(readAll(source, validate)); 188 188 } catch (IOException e) { 189 System.err.println(e.getClass().getName()+": "+e.getMessage());190 System.err.println(source);189 Main.error(e); 190 Main.error(source); 191 191 JOptionPane.showMessageDialog( 192 192 Main.parent, … … 196 196 ); 197 197 } catch (SAXException e) { 198 System.err.println(e.getClass().getName()+": "+e.getMessage());199 System.err.println(source);198 Main.error(e); 199 Main.error(source); 200 200 JOptionPane.showMessageDialog( 201 201 Main.parent, -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java
r6084 r6248 291 291 return list == null ? null : getFilteredItem(rowIndex); 292 292 } 293 294 public void dump() {295 System.out.println("---------------------------------");296 for (AutoCompletionListItem item: list) {297 System.out.println(item);298 }299 System.out.println("---------------------------------");300 }301 293 } -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java
r6068 r6248 12 12 import java.util.Set; 13 13 14 import org.openstreetmap.josm.Main; 14 15 import org.openstreetmap.josm.data.osm.DataSet; 15 16 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 156 157 presetTagCache.putAll(ki.key, ki.getValues()); 157 158 } catch (NullPointerException e) { 158 System.err.println(p+": Unable to cache "+ki);159 Main.error(p+": Unable to cache "+ki); 159 160 } 160 161 } -
trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java
r6232 r6248 2 2 package org.openstreetmap.josm.gui.util; 3 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 4 6 import java.awt.BasicStroke; 5 import static org.openstreetmap.josm.tools.I18n.tr;6 7 7 import java.awt.Component; 8 8 import java.awt.Container; … … 196 196 } 197 197 } catch (NumberFormatException ex) { 198 System.err.println("Error in stroke preference format: "+code);198 Main.error("Error in stroke preference format: "+code); 199 199 dash = new float[]{5.0f}; 200 200 } 201 201 if (sumAbs < 1e-1) { 202 System.err.println("Error in stroke dash fomat (all zeros): "+code);202 Main.error("Error in stroke dash fomat (all zeros): "+code); 203 203 return new BasicStroke(w); 204 204 } -
trunk/src/org/openstreetmap/josm/gui/widgets/AbstractIdTextField.java
r5899 r6248 4 4 import javax.swing.text.JTextComponent; 5 5 6 import org.openstreetmap.josm. gui.widgets.JosmTextField;6 import org.openstreetmap.josm.Main; 7 7 import org.openstreetmap.josm.tools.Utils; 8 8 … … 39 39 } 40 40 } catch (Exception e) { 41 System.err.println(e.getClass().getName()+": "+e.getMessage());41 Main.error(e); 42 42 } finally { 43 43 this.validator = validator; -
trunk/src/org/openstreetmap/josm/gui/widgets/JosmPasswordField.java
r5927 r6248 10 10 import javax.swing.text.Document; 11 11 import javax.swing.text.JTextComponent; 12 13 import org.openstreetmap.josm.Main; 12 14 13 15 /** … … 103 105 pasteAction.actionPerformed(e); 104 106 } catch (NullPointerException npe) { 105 System.err.println("NullPointerException occured because of JDK bug 6322854. "107 Main.error("NullPointerException occured because of JDK bug 6322854. " 106 108 +"Copy/Paste operation has not been performed. Please complain to Oracle: "+ 107 109 "http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6322854"); -
trunk/src/org/openstreetmap/josm/io/AbstractReader.java
r5123 r6248 10 10 import java.util.Map; 11 11 12 import org.openstreetmap.josm.Main; 12 13 import org.openstreetmap.josm.data.osm.Changeset; 13 14 import org.openstreetmap.josm.data.osm.DataSet; … … 101 102 } 102 103 if (n.isDeleted()) { 103 System.out.println(tr("Deleted node {0} is part of way {1}", id, w.getId()));104 Main.info(tr("Deleted node {0} is part of way {1}", id, w.getId())); 104 105 } else { 105 106 wayNodes.add(n); … … 108 109 w.setNodes(wayNodes); 109 110 if (w.hasIncompleteNodes()) { 110 System.out.println(tr("Way {0} with {1} nodes has incomplete nodes because at least one node was missing in the loaded data.",111 Main.info(tr("Way {0} with {1} nodes has incomplete nodes because at least one node was missing in the loaded data.", 111 112 externalWayId, w.getNodesCount())); 112 113 } … … 174 175 } 175 176 if (primitive.isDeleted()) { 176 System.out.println(tr("Deleted member {0} is used by relation {1}", primitive.getId(), relation.getId()));177 Main.info(tr("Deleted member {0} is used by relation {1}", primitive.getId(), relation.getId())); 177 178 } else { 178 179 relationMembers.add(new RelationMember(rm.getRole(), primitive)); -
trunk/src/org/openstreetmap/josm/io/CacheFiles.java
r6102 r6248 14 14 15 15 import org.openstreetmap.josm.Main; 16 import org.openstreetmap.josm.tools.Utils; 16 17 17 18 /** … … 115 116 new RandomAccessFile(data, "r").readFully(bytes); 116 117 return bytes; 117 } catch (Exception e) {118 System.out.println(e.getMessage());118 } catch (Exception e) { 119 Main.warn(e); 119 120 } 120 121 return null; … … 130 131 try { 131 132 File f = getPath(ident); 132 if (f.exists()) {133 if (f.exists()) { 133 134 f.delete(); 134 135 } 135 136 // rws also updates the file meta-data, i.e. last mod time 136 new RandomAccessFile(f, "rws").write(data); 137 } catch(Exception e){ 138 System.out.println(e.getMessage()); 137 RandomAccessFile raf = new RandomAccessFile(f, "rws"); 138 try { 139 raf.write(data); 140 } finally { 141 Utils.close(raf); 142 } 143 } catch (Exception e) { 144 Main.warn(e); 139 145 } 140 146 … … 164 170 } 165 171 return ImageIO.read(img); 166 } catch (Exception e) {167 System.out.println(e.getMessage());172 } catch (Exception e) { 173 Main.warn(e); 168 174 } 169 175 return null; … … 176 182 */ 177 183 public void saveImg(String ident, BufferedImage image) { 178 if (!enabled) return;184 if (!enabled) return; 179 185 try { 180 186 ImageIO.write(image, "png", getPath(ident, "png")); 181 } catch (Exception e){182 System.out.println(e.getMessage());187 } catch (Exception e) { 188 Main.warn(e); 183 189 } 184 190 -
trunk/src/org/openstreetmap/josm/io/Capabilities.java
r6070 r6248 8 8 import java.util.HashMap; 9 9 import java.util.List; 10 11 import org.openstreetmap.josm.Main; 10 12 11 13 /** … … 120 122 int n = Integer.parseInt(v); 121 123 if (n <= 0) { 122 System.err.println(tr("Warning: illegal value of attribute ''{0}'' of element ''{1}'' in server capabilities. Got ''{2}''", "changesets", "maximum_elements", n ));124 Main.warn(tr("Illegal value of attribute ''{0}'' of element ''{1}'' in server capabilities. Got ''{2}''", "changesets", "maximum_elements", n )); 123 125 return -1; 124 126 } 125 127 return n; 126 } catch (NumberFormatException e) {127 System.err.println(tr("Warning: illegal value of attribute ''{0}'' of element ''{1}'' in server capabilities. Got ''{2}''", "changesets", "maximum_elements", v ));128 } catch (NumberFormatException e) { 129 Main.warn(tr("Illegal value of attribute ''{0}'' of element ''{1}'' in server capabilities. Got ''{2}''", "changesets", "maximum_elements", v )); 128 130 return -1; 129 131 } -
trunk/src/org/openstreetmap/josm/io/ChangesetClosedException.java
r5266 r6248 11 11 import java.util.regex.Matcher; 12 12 import java.util.regex.Pattern; 13 14 import org.openstreetmap.josm.Main; 13 15 14 16 /** … … 81 83 closedOn = formatter.parse(m.group(2)); 82 84 } catch(ParseException ex) { 83 System.err.println(tr("Failed to parse date ''{0}'' replied by server.", m.group(2)));85 Main.error(tr("Failed to parse date ''{0}'' replied by server.", m.group(2))); 84 86 ex.printStackTrace(); 85 87 } 86 88 } else { 87 System.err.println(tr("Unexpected format of error header for conflict in changeset update. Got ''{0}''", errorHeader));89 Main.error(tr("Unexpected format of error header for conflict in changeset update. Got ''{0}''", errorHeader)); 88 90 } 89 91 } -
trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java
r6087 r6248 7 7 import java.net.InetSocketAddress; 8 8 import java.net.Proxy; 9 import java.net.Proxy.Type; 9 10 import java.net.ProxySelector; 10 11 import java.net.SocketAddress; 11 12 import java.net.URI; 12 import java.net.Proxy.Type;13 13 import java.util.Collections; 14 14 import java.util.List; … … 79 79 port = Integer.parseInt(value); 80 80 } catch (NumberFormatException e) { 81 System.err.println(tr("Unexpected format for port number in in preference ''{0}''. Got ''{1}''.", property, value));82 System.err.println(tr("The proxy will not be used."));81 Main.error(tr("Unexpected format for port number in in preference ''{0}''. Got ''{1}''.", property, value)); 82 Main.error(tr("The proxy will not be used.")); 83 83 return 0; 84 84 } 85 85 if (port <= 0 || port > 65535) { 86 System.err.println(tr("Illegal port number in preference ''{0}''. Got {1}.", property, port));87 System.err.println(tr("The proxy will not be used."));86 Main.error(tr("Illegal port number in preference ''{0}''. Got {1}.", property, port)); 87 Main.error(tr("The proxy will not be used.")); 88 88 return 0; 89 89 } … … 102 102 proxyPolicy= ProxyPolicy.fromName(value); 103 103 if (proxyPolicy == null) { 104 System.err.println(tr("Warning: unexpected value for preference ''{0}'' found. Got ''{1}''. Will use no proxy.", ProxyPreferencesPanel.PROXY_POLICY, value));104 Main.warn(tr("Unexpected value for preference ''{0}'' found. Got ''{1}''. Will use no proxy.", ProxyPreferencesPanel.PROXY_POLICY, value)); 105 105 proxyPolicy = ProxyPolicy.NO_PROXY; 106 106 } … … 113 113 httpProxySocketAddress = null; 114 114 if (proxyPolicy.equals(ProxyPolicy.USE_HTTP_PROXY)) { 115 System.err.println(tr("Warning:Unexpected parameters for HTTP proxy. Got host ''{0}'' and port ''{1}''.", host, port));116 System.err.println(tr("The proxy will not be used."));115 Main.warn(tr("Unexpected parameters for HTTP proxy. Got host ''{0}'' and port ''{1}''.", host, port)); 116 Main.warn(tr("The proxy will not be used.")); 117 117 } 118 118 } … … 125 125 socksProxySocketAddress = null; 126 126 if (proxyPolicy.equals(ProxyPolicy.USE_SOCKS_PROXY)) { 127 System.err.println(tr("Warning:Unexpected parameters for SOCKS proxy. Got host ''{0}'' and port ''{1}''.", host, port));128 System.err.println(tr("The proxy will not be used."));127 Main.warn(tr("Unexpected parameters for SOCKS proxy. Got host ''{0}'' and port ''{1}''.", host, port)); 128 Main.warn(tr("The proxy will not be used.")); 129 129 } 130 130 } … … 133 133 @Override 134 134 public void connectFailed(URI uri, SocketAddress sa, IOException ioe) { 135 // Just log something. The network stack will also throw an exception which will be caught 136 // somewhere else 135 // Just log something. The network stack will also throw an exception which will be caught somewhere else 137 136 // 138 System.out.println(tr("Error:Connection to proxy ''{0}'' for URI ''{1}'' failed. Exception was: {2}", sa.toString(), uri.toString(), ioe.toString()));137 Main.error(tr("Connection to proxy ''{0}'' for URI ''{1}'' failed. Exception was: {2}", sa.toString(), uri.toString(), ioe.toString())); 139 138 } 140 139 … … 145 144 case USE_SYSTEM_SETTINGS: 146 145 if (!JVM_WILL_USE_SYSTEM_PROXIES) { 147 System.err.println(tr("Warning: the JVM is not configured to lookup proxies from the system settings. The property ''java.net.useSystemProxies'' was missing at startup time. Will not use a proxy."));146 Main.warn(tr("The JVM is not configured to lookup proxies from the system settings. The property ''java.net.useSystemProxies'' was missing at startup time. Will not use a proxy.")); 148 147 return Collections.singletonList(Proxy.NO_PROXY); 149 148 } -
trunk/src/org/openstreetmap/josm/io/FileImporter.java
r6102 r6248 63 63 public boolean importDataHandleExceptions(File f, ProgressMonitor progressMonitor) { 64 64 try { 65 System.out.println("Open file: " + f.getAbsolutePath() + " (" + f.length() + " bytes)");65 Main.info("Open file: " + f.getAbsolutePath() + " (" + f.length() + " bytes)"); 66 66 importData(f, progressMonitor); 67 67 return true; … … 79 79 public boolean importDataHandleExceptions(List<File> files, ProgressMonitor progressMonitor) { 80 80 try { 81 System.out.println("Open "+files.size()+" files");81 Main.info("Open "+files.size()+" files"); 82 82 importData(files, progressMonitor); 83 83 return true; -
trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java
r6148 r6248 150 150 } 151 151 } catch (Exception e) { 152 if (file.getName().endsWith(".zip")) {153 System.err.println(tr("Warning: failed to open file with extension ''{2}'' and namepart ''{3}'' in zip file ''{0}''. Exception was: {1}",152 if (file.getName().endsWith(".zip")) { 153 Main.warn(tr("Failed to open file with extension ''{2}'' and namepart ''{3}'' in zip file ''{0}''. Exception was: {1}", 154 154 file.getName(), e.toString(), extension, namepart)); 155 155 } … … 257 257 {Long.toString(System.currentTimeMillis()), localFile.toString()})); 258 258 } else { 259 System.out.println(tr("Failed to rename file {0} to {1}.",259 Main.warn(tr("Failed to rename file {0} to {1}.", 260 260 destDirFile.getPath(), localFile.getPath())); 261 261 } 262 262 } catch (IOException e) { 263 263 if (age >= maxTime*1000 && age < maxTime*1000*2) { 264 System.out.println(tr("Failed to load {0}, use cached file and retry next time: {1}", 265 url, e)); 264 Main.warn(tr("Failed to load {0}, use cached file and retry next time: {1}", url, e)); 266 265 return localFile; 267 266 } else { … … 319 318 throw new IOException(msg); 320 319 } 321 System.out.println(tr("Download redirected to ''{0}''", downloadUrl));320 Main.info(tr("Download redirected to ''{0}''", downloadUrl)); 322 321 break; 323 322 default: -
trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
r6070 r6248 49 49 * reader.parseOsm(); 50 50 * if (!reader.getMissingPrimitives().isEmpty()) { 51 * System.out.println("There are missing primitives: " + reader.getMissingPrimitives());51 * Main.info("There are missing primitives: " + reader.getMissingPrimitives()); 52 52 * } 53 53 * if (!reader.getSkippedWays().isEmpty()) { 54 * System.out.println("There are skipped ways: " + reader.getMissingPrimitives());54 * Main.info("There are skipped ways: " + reader.getMissingPrimitives()); 55 55 * } 56 56 * </pre> … … 489 489 } catch (OsmApiException e) { 490 490 if (e.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) { 491 System.out.println(tr("Server replied with response code 404, retrying with an individual request for each object."));491 Main.info(tr("Server replied with response code 404, retrying with an individual request for each object.")); 492 492 return singleGetIdPackage(type, pkg, progressMonitor); 493 493 } else { … … 567 567 } catch (OsmApiException e) { 568 568 if (e.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) { 569 System.out.println(tr("Server replied with response code 404 for id {0}. Skipping.", Long.toString(id)));569 Main.info(tr("Server replied with response code 404 for id {0}. Skipping.", Long.toString(id))); 570 570 result.missingPrimitives.add(new SimplePrimitiveId(id, type)); 571 571 } else { -
trunk/src/org/openstreetmap/josm/io/NmeaReader.java
r6087 r6248 247 247 byte[] chb = chkstrings[0].getBytes(); 248 248 int chk=0; 249 for (int i = 1; i < chb.length; i++) {249 for (int i = 1; i < chb.length; i++) { 250 250 chk ^= chb[i]; 251 251 } 252 if(Integer.parseInt(chkstrings[1].substring(0,2),16) != chk) { 253 //System.out.println("Checksum error"); 252 if (Integer.parseInt(chkstrings[1].substring(0,2),16) != chk) { 254 253 ps.checksum_errors++; 255 254 ps.p_Wp=null; … … 447 446 return true; 448 447 449 } catch (RuntimeException x) {448 } catch (RuntimeException x) { 450 449 // out of bounds and such 451 // x.printStackTrace();452 // System.out.println("Malformed line: "+s.toString().trim());453 450 ps.malformed++; 454 451 ps.p_Wp=null; -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r6070 r6248 229 229 version = "0.6"; 230 230 } else { 231 System.err.println(tr("This version of JOSM is incompatible with the configured server."));232 System.err.println(tr("It supports protocol version 0.6, while the server says it supports {0} to {1}.",231 Main.error(tr("This version of JOSM is incompatible with the configured server.")); 232 Main.error(tr("It supports protocol version 0.6, while the server says it supports {0} to {1}.", 233 233 capabilities.get("version", "minimum"), capabilities.get("version", "maximum"))); 234 234 initialized = false; // FIXME gets overridden by next assignment … … 256 256 for (Layer l : Main.map.mapView.getLayersOfType(ImageryLayer.class)) { 257 257 if (((ImageryLayer) l).getInfo().isBlacklisted()) { 258 System.out.println(tr("Removed layer {0} because it is not allowed by the configured API.", l.getName()));258 Main.info(tr("Removed layer {0} because it is not allowed by the configured API.", l.getName())); 259 259 Main.main.removeLayer(l); 260 260 } … … 548 548 } catch (InterruptedException ex) {} 549 549 } 550 System.out.println(tr("OK - trying again."));550 Main.info(tr("OK - trying again.")); 551 551 } 552 552 … … 628 628 629 629 activeConnection.connect(); 630 System.out.println(activeConnection.getResponseMessage());630 Main.info(activeConnection.getResponseMessage()); 631 631 int retCode = activeConnection.getResponseCode(); 632 632 … … 634 634 if (retries-- > 0) { 635 635 sleepAndListen(retries, monitor); 636 System.out.println(tr("Starting retry {0} of {1}.", getMaxRetries() - retries,getMaxRetries()));636 Main.info(tr("Starting retry {0} of {1}.", getMaxRetries() - retries,getMaxRetries())); 637 637 continue; 638 638 } … … 666 666 if (activeConnection.getHeaderField("Error") != null) { 667 667 errorHeader = activeConnection.getHeaderField("Error"); 668 System.err.println("Error header: " + errorHeader);668 Main.error("Error header: " + errorHeader); 669 669 } else if (retCode != 200 && responseBody.length()>0) { 670 System.err.println("Error body: " + responseBody);670 Main.error("Error body: " + responseBody); 671 671 } 672 672 activeConnection.disconnect(); -
trunk/src/org/openstreetmap/josm/io/OsmChangesetContentParser.java
r6201 r6248 13 13 import javax.xml.parsers.SAXParserFactory; 14 14 15 import org.openstreetmap.josm.Main; 15 16 import org.openstreetmap.josm.data.osm.ChangesetDataSet; 16 17 import org.openstreetmap.josm.data.osm.ChangesetDataSet.ChangesetModificationType; … … 57 58 currentModificationType = ChangesetModificationType.DELETED; 58 59 } else { 59 System.err.println(tr("Warning: unsupported start element ''{0}'' in changeset content at position ({1},{2}). Skipping.", qName, locator.getLineNumber(), locator.getColumnNumber()));60 Main.warn(tr("Unsupported start element ''{0}'' in changeset content at position ({1},{2}). Skipping.", qName, locator.getLineNumber(), locator.getColumnNumber())); 60 61 } 61 62 } … … 85 86 // do nothing 86 87 } else { 87 System.err.println(tr("Warning: unsupported end element ''{0}'' in changeset content at position ({1},{2}). Skipping.", qName, locator.getLineNumber(), locator.getColumnNumber()));88 Main.warn(tr("Unsupported end element ''{0}'' in changeset content at position ({1},{2}). Skipping.", qName, locator.getLineNumber(), locator.getColumnNumber())); 88 89 } 89 90 } -
trunk/src/org/openstreetmap/josm/io/OsmConnection.java
r5881 r6248 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.net.Authenticator.RequestorType; 6 7 import java.net.HttpURLConnection; 7 import java.net.Authenticator.RequestorType;8 8 import java.nio.ByteBuffer; 9 9 import java.nio.CharBuffer; … … 19 19 import org.openstreetmap.josm.gui.preferences.server.OAuthAccessTokenHolder; 20 20 import org.openstreetmap.josm.io.auth.CredentialsAgentException; 21 import org.openstreetmap.josm.io.auth.CredentialsAgentResponse; 21 22 import org.openstreetmap.josm.io.auth.CredentialsManager; 22 import org.openstreetmap.josm.io.auth.CredentialsAgentResponse;23 23 import org.openstreetmap.josm.tools.Base64; 24 24 … … 132 132 addOAuthAuthorizationHeader(connection); 133 133 } else { 134 String msg = tr(" Warning: unexpected value for preference ''{0}''. Got ''{1}''.", "osm-server.auth-method", authMethod);135 System.err.println(msg);134 String msg = tr("Unexpected value for preference ''{0}''. Got ''{1}''.", "osm-server.auth-method", authMethod); 135 Main.warn(msg); 136 136 throw new OsmTransferException(msg); 137 137 } -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r6093 r6248 18 18 import javax.xml.stream.XMLStreamReader; 19 19 20 import org.openstreetmap.josm.Main; 20 21 import org.openstreetmap.josm.data.Bounds; 21 22 import org.openstreetmap.josm.data.coor.LatLon; … … 171 172 Bounds copy = new Bounds(bounds); 172 173 bounds.normalize(); 173 System.out.println("Bbox " + copy + " is out of the world, normalized to " + bounds);174 Main.info("Bbox " + copy + " is out of the world, normalized to " + bounds); 174 175 } 175 176 DataSource src = new DataSource(bounds, origin); … … 233 234 } 234 235 if (w.isDeleted() && !nodeIds.isEmpty()) { 235 System.out.println(tr("Deleted way {0} contains nodes", w.getUniqueId()));236 Main.info(tr("Deleted way {0} contains nodes", w.getUniqueId())); 236 237 nodeIds = new ArrayList<Long>(); 237 238 } … … 280 281 } 281 282 if (r.isDeleted() && !members.isEmpty()) { 282 System.out.println(tr("Deleted relation {0} contains members", r.getUniqueId()));283 Main.info(tr("Deleted relation {0} contains members", r.getUniqueId())); 283 284 members = new ArrayList<RelationMemberData>(); 284 285 } … … 356 357 protected void parseUnknown(boolean printWarning) throws XMLStreamException { 357 358 if (printWarning) { 358 System.out.println(tr("Undefined element ''{0}'' found in input stream. Skipping.", parser.getLocalName()));359 Main.info(tr("Undefined element ''{0}'' found in input stream. Skipping.", parser.getLocalName())); 359 360 } 360 361 while (true) { … … 445 446 throwException(tr("Illegal value for attribute ''version'' on OSM primitive with ID {0}. Got {1}.", Long.toString(current.getUniqueId()), versionString)); 446 447 } else if (version < 0 && current.getUniqueId() <= 0) { 447 System.out.println(tr("WARNING:Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.getUniqueId(), version, 0, "0.6"));448 Main.warn(tr("Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.getUniqueId(), version, 0, "0.6")); 448 449 version = 0; 449 450 } 450 451 } else if (ds.getVersion().equals("0.5")) { 451 452 if (version <= 0 && current.getUniqueId() > 0) { 452 System.out.println(tr("WARNING:Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.getUniqueId(), version, 1, "0.5"));453 Main.warn(tr("Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.getUniqueId(), version, 1, "0.5")); 453 454 version = 1; 454 455 } else if (version < 0 && current.getUniqueId() <= 0) { 455 System.out.println(tr("WARNING:Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.getUniqueId(), version, 0, "0.5"));456 Main.warn(tr("Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.getUniqueId(), version, 0, "0.5")); 456 457 version = 0; 457 458 } … … 467 468 } else if (current.getUniqueId() > 0 && ds.getVersion() != null && ds.getVersion().equals("0.5")) { 468 469 // default version in 0.5 files for existing primitives 469 System.out.println(tr("WARNING:Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.getUniqueId(), version, 1, "0.5"));470 Main.warn(tr("Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.getUniqueId(), version, 1, "0.5")); 470 471 version= 1; 471 472 } else if (current.getUniqueId() <= 0 && ds.getVersion() != null && ds.getVersion().equals("0.5")) { … … 496 497 if (current.getUniqueId() <= 0) { 497 498 // for a new primitive we just log a warning 498 System.out.println(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.", v, current.getUniqueId()));499 Main.info(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.", v, current.getUniqueId())); 499 500 current.setChangesetId(0); 500 501 } else { … … 506 507 if (current.getUniqueId() <= 0) { 507 508 // for a new primitive we just log a warning 508 System.out.println(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.", v, current.getUniqueId()));509 Main.info(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.", v, current.getUniqueId())); 509 510 current.setChangesetId(0); 510 511 } else { -
trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
r6246 r6248 107 107 108 108 try { 109 System.out.println("GET " + url);109 Main.info("GET " + url); 110 110 activeConnection.connect(); 111 111 } catch (Exception e) { -
trunk/src/org/openstreetmap/josm/io/imagery/HTMLGrabber.java
r4745 r6248 30 30 String urlstring = url.toExternalForm(); 31 31 32 System.out.println("Grabbing HTML " + (attempt > 1? "(attempt " + attempt + ") ":"") + url);32 Main.info("Grabbing HTML " + (attempt > 1? "(attempt " + attempt + ") ":"") + url); 33 33 34 34 ArrayList<String> cmdParams = new ArrayList<String>(); 35 35 StringTokenizer st = new StringTokenizer(MessageFormat.format(PROP_BROWSER.get(), urlstring)); 36 while ( st.hasMoreTokens()) {36 while (st.hasMoreTokens()) { 37 37 cmdParams.add(st.nextToken()); 38 38 } … … 43 43 try { 44 44 browser = builder.start(); 45 } catch (IOException ioe) {45 } catch (IOException ioe) { 46 46 throw new IOException( "Could not start browser. Please check that the executable path is correct.\n" + ioe.getMessage() ); 47 47 } -
trunk/src/org/openstreetmap/josm/io/imagery/WMSGrabber.java
r6087 r6248 158 158 159 159 protected BufferedImage grab(WMSRequest request, URL url, int attempt) throws IOException, OsmTransferException { 160 System.out.println("Grabbing WMS " + (attempt > 1? "(attempt " + attempt + ") ":"") + url);160 Main.info("Grabbing WMS " + (attempt > 1? "(attempt " + attempt + ") ":"") + url); 161 161 162 162 HttpURLConnection conn = Utils.openHttpConnection(url); -
trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java
r6106 r6248 20 20 import javax.xml.parsers.DocumentBuilderFactory; 21 21 22 import org.openstreetmap.josm.Main; 22 23 import org.openstreetmap.josm.data.Bounds; 23 24 import org.openstreetmap.josm.data.imagery.ImageryInfo; … … 127 128 } 128 129 129 System.out.println("GET " + getCapabilitiesUrl.toString());130 Main.info("GET " + getCapabilitiesUrl.toString()); 130 131 URLConnection openConnection = Utils.openHttpConnection(getCapabilitiesUrl); 131 132 InputStream inputStream = openConnection.getInputStream(); … … 139 140 String incomingData = ba.toString(); 140 141 141 //System.out.println("WMS capabilities:\n"+incomingData+"\n");142 142 try { 143 143 DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); … … 149 149 @Override 150 150 public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { 151 System.out.println("Ignoring DTD " + publicId + ", " + systemId);151 Main.info("Ignoring DTD " + publicId + ", " + systemId); 152 152 return new InputSource(new StringReader("")); 153 153 } … … 175 175 String baseURL = child.getAttribute("xlink:href"); 176 176 if (baseURL != null && !baseURL.equals(serviceUrlStr)) { 177 System.out.println("GetCapabilities specifies a different service URL: " + baseURL);177 Main.info("GetCapabilities specifies a different service URL: " + baseURL); 178 178 serviceUrl = new URL(baseURL); 179 179 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java
r6084 r6248 6 6 import java.io.IOException; 7 7 import java.net.BindException; 8 import java.net.InetAddress; 8 9 import java.net.ServerSocket; 9 10 import java.net.Socket; 10 11 import java.net.SocketException; 11 import java.net.InetAddress;12 12 13 13 import org.openstreetmap.josm.Main; … … 37 37 instance.start(); 38 38 } catch (BindException ex) { 39 Main.warn(marktr(" Warning:Cannot start remotecontrol server on port {0}: {1}"),39 Main.warn(marktr("Cannot start remotecontrol server on port {0}: {1}"), 40 40 Integer.toString(port), ex.getLocalizedMessage()); 41 41 } catch (IOException ioe) { -
trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
r6223 r6248 22 22 import java.util.regex.Pattern; 23 23 24 import org.openstreetmap.josm.Main; 24 25 import org.openstreetmap.josm.gui.help.HelpUtil; 25 26 import org.openstreetmap.josm.io.remotecontrol.handler.AddNodeHandler; … … 110 111 String commandWithSlash = "/" + command; 111 112 if (handlers.get(commandWithSlash) != null) { 112 System.out.println("RemoteControl: ignoring duplicate command " + command113 Main.info("RemoteControl: ignoring duplicate command " + command 113 114 + " with handler " + handler.getName()); 114 115 } else { 115 116 if (!silent) { 116 System.out.println("RemoteControl: adding command \"" +117 Main.info("RemoteControl: adding command \"" + 117 118 command + "\" (handled by " + handler.getSimpleName() + ")"); 118 119 } … … 151 152 return; 152 153 } 153 System.out.println("RemoteControl received: " + get);154 Main.info("RemoteControl received: " + get); 154 155 155 156 StringTokenizer st = new StringTokenizer(get); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandler.java
r6091 r6248 6 6 import java.awt.Point; 7 7 import java.util.HashMap; 8 8 9 import org.openstreetmap.josm.Main; 9 10 import org.openstreetmap.josm.actions.AutoScaleAction; … … 15 16 import org.openstreetmap.josm.io.remotecontrol.AddTagsDialog; 16 17 import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault; 17 import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;18 18 19 19 /** … … 77 77 78 78 // Parse the arguments 79 System.out.println("Adding node at (" + lat + ", " + lon + ")");79 Main.info("Adding node at (" + lat + ", " + lon + ")"); 80 80 81 81 // Create a new node -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandler.java
r6091 r6248 2 2 package org.openstreetmap.josm.io.remotecontrol.handler; 3 3 4 import java.util.Arrays;5 4 import static org.openstreetmap.josm.tools.I18n.tr; 6 5 6 import java.util.Arrays; 7 7 import java.util.HashMap; 8 8 … … 61 61 imgInfo.setDefaultMinZoom(Integer.parseInt(min_zoom)); 62 62 } catch (NumberFormatException e) { 63 System.err.println("NumberFormatException ("+e.getMessage()+")");63 Main.error(e); 64 64 } 65 65 } … … 69 69 imgInfo.setDefaultMaxZoom(Integer.parseInt(max_zoom)); 70 70 } catch (NumberFormatException e) { 71 System.err.println("NumberFormatException ("+e.getMessage()+")");71 Main.error(e); 72 72 } 73 73 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java
r6143 r6248 35 35 } 36 36 } catch (Exception ex) { 37 System.out.println("RemoteControl: Error parsing import remote control request:");37 Main.warn("RemoteControl: Error parsing import remote control request:"); 38 38 ex.printStackTrace(); 39 39 throw new RequestHandlerErrorException(); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
r6203 r6248 97 97 boolean newLayer = isLoadInNewLayer(); 98 98 99 if(command.equals(myCommand)) 100 { 101 if (!PermissionPrefWithDefault.LOAD_DATA.isAllowed()) 102 { 103 System.out.println("RemoteControl: download forbidden by preferences"); 104 } 105 else 106 { 99 if (command.equals(myCommand)) { 100 if (!PermissionPrefWithDefault.LOAD_DATA.isAllowed()) { 101 Main.info("RemoteControl: download forbidden by preferences"); 102 } else { 107 103 Area toDownload = null; 108 104 if (!newLayer) { … … 116 112 toDownload = new Area(new Rectangle2D.Double(minlon,minlat,maxlon-minlon,maxlat-minlat)); 117 113 toDownload.subtract(present); 118 if (!toDownload.isEmpty()) 119 { 114 if (!toDownload.isEmpty()) { 120 115 // the result might not be a rectangle (L shaped etc) 121 116 Rectangle2D downloadBounds = toDownload.getBounds2D(); … … 127 122 } 128 123 } 129 if (toDownload != null && toDownload.isEmpty()) 130 { 131 System.out.println("RemoteControl: no download necessary"); 132 } 133 else 134 { 124 if (toDownload != null && toDownload.isEmpty()) { 125 Main.info("RemoteControl: no download necessary"); 126 } else { 135 127 Future<?> future = osmTask.download(newLayer, new Bounds(minlat,minlon,maxlat,maxlon), null /* let the task manage the progress monitor */); 136 128 Main.worker.submit(new PostDownloadHandler(osmTask, future)); … … 139 131 } 140 132 } catch (Exception ex) { 141 System.out.println("RemoteControl: Error parsing load_and_zoom remote control request:");133 Main.warn("RemoteControl: Error parsing load_and_zoom remote control request:"); 142 134 ex.printStackTrace(); 143 135 throw new RequestHandlerErrorException(); … … 262 254 relations.add(Long.parseLong(item.substring(3))); 263 255 } else { 264 System.out.println("RemoteControl: invalid selection '"+item+"' ignored");256 Main.warn("RemoteControl: invalid selection '"+item+"' ignored"); 265 257 } 266 258 } catch (NumberFormatException e) { 267 System.out.println("RemoteControl: invalid selection '"+item+"' ignored");259 Main.warn("RemoteControl: invalid selection '"+item+"' ignored"); 268 260 } 269 261 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandler.java
r6091 r6248 50 50 protected void handleRequest() throws RequestHandlerErrorException, RequestHandlerBadRequestException { 51 51 if (!PermissionPrefWithDefault.LOAD_DATA.isAllowed()) { 52 System.out.println("RemoteControl: download forbidden by preferences");52 Main.info("RemoteControl: download forbidden by preferences"); 53 53 } 54 54 if (!ps.isEmpty()) { … … 88 88 ps.add(SimplePrimitiveId.fromString(i)); 89 89 } catch (IllegalArgumentException e) { 90 System.out.println("RemoteControl: invalid selection '"+i+"' ignored");90 Main.warn("RemoteControl: invalid selection '"+i+"' ignored"); 91 91 } 92 92 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java
r6091 r6248 137 137 if (!Main.pref.getBoolean(permissionPref.pref, permissionPref.defaultVal)) { 138 138 String err = MessageFormat.format("RemoteControl: ''{0}'' forbidden by preferences", myCommand); 139 System.out.println(err);139 Main.info(err); 140 140 throw new RequestHandlerForbiddenException(err); 141 141 } … … 211 211 if ((value == null) || (value.length() == 0)) { 212 212 error = true; 213 System.out.println("'" + myCommand + "' remote control request must have '" + key + "' parameter");213 Main.warn("'" + myCommand + "' remote control request must have '" + key + "' parameter"); 214 214 missingKeys.add(key); 215 215 } -
trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java
r6073 r6248 114 114 try { 115 115 if (pi.downloadlink == null) { 116 String msg = tr(" Warning:Cannot download plugin ''{0}''. Its download link is not known. Skipping download.", pi.name);117 System.err.println(msg);116 String msg = tr("Cannot download plugin ''{0}''. Its download link is not known. Skipping download.", pi.name); 117 Main.warn(msg); 118 118 throw new PluginDownloadException(msg); 119 119 } … … 128 128 out.write(buffer, 0, read); 129 129 } 130 } catch (MalformedURLException e) {131 String msg = tr(" Warning:Cannot download plugin ''{0}''. Its download link ''{1}'' is not a valid URL. Skipping download.", pi.name, pi.downloadlink);132 System.err.println(msg);130 } catch (MalformedURLException e) { 131 String msg = tr("Cannot download plugin ''{0}''. Its download link ''{1}'' is not a valid URL. Skipping download.", pi.name, pi.downloadlink); 132 Main.warn(msg); 133 133 throw new PluginDownloadException(msg); 134 134 } catch (IOException e) { -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r6090 r6248 66 66 * PluginHandler is basically a collection of static utility functions used to bootstrap 67 67 * and manage the loaded plugins. 68 * 68 * @since 1326 69 69 */ 70 70 public class PluginHandler { 71 71 72 72 /** 73 * deprecated plugins that are removed on start73 * Deprecated plugins that are removed on start 74 74 */ 75 75 public final static Collection<DeprecatedPlugin> DEPRECATED_PLUGINS; … … 117 117 } 118 118 119 /** 120 * Description of a deprecated plugin 121 */ 119 122 public static class DeprecatedPlugin implements Comparable<DeprecatedPlugin> { 120 public String name; 121 // short explanation, can be null 122 public String reason; 123 // migration, can be null 124 private Runnable migration; 125 123 /** Plugin name */ 124 public final String name; 125 /** Short explanation about deprecation, can be {@code null} */ 126 public final String reason; 127 /** Code to run to perform migration, can be {@code null} */ 128 private final Runnable migration; 129 130 /** 131 * Constructs a new {@code DeprecatedPlugin}. 132 * @param name The plugin name 133 */ 126 134 public DeprecatedPlugin(String name) { 127 this.name = name; 128 } 129 135 this(name, null, null); 136 } 137 138 /** 139 * Constructs a new {@code DeprecatedPlugin} with a given reason. 140 * @param name The plugin name 141 * @param reason The reason about deprecation 142 */ 130 143 public DeprecatedPlugin(String name, String reason) { 131 this.name = name; 132 this.reason = reason; 133 } 134 144 this(name, reason, null); 145 } 146 147 /** 148 * Constructs a new {@code DeprecatedPlugin}. 149 * @param name The plugin name 150 * @param reason The reason about deprecation 151 * @param migration The code to run to perform migration 152 */ 135 153 public DeprecatedPlugin(String name, String reason, Runnable migration) { 136 154 this.name = name; … … 139 157 } 140 158 159 /** 160 * Performs migration. 161 */ 141 162 public void migrate() { 142 163 if (migration != null) { … … 151 172 } 152 173 174 /** 175 * List of unmaintained plugins. Not really up-to-date as the vast majority of plugins are not really maintained after a few months, sadly... 176 */ 153 177 final public static String [] UNMAINTAINED_PLUGINS = new String[] {"gpsbabelgui", "Intersect_way"}; 154 178 … … 319 343 if (policy.equals("never")) { 320 344 if ("pluginmanager.version-based-update.policy".equals(togglePreferenceKey)) { 321 System.out.println(tr("Skipping plugin update after JOSM upgrade. Automatic update at startup is disabled."));345 Main.info(tr("Skipping plugin update after JOSM upgrade. Automatic update at startup is disabled.")); 322 346 } else if ("pluginmanager.time-based-update.policy".equals(togglePreferenceKey)) { 323 System.out.println(tr("Skipping plugin update after elapsed update interval. Automatic update at startup is disabled."));347 Main.info(tr("Skipping plugin update after elapsed update interval. Automatic update at startup is disabled.")); 324 348 } 325 349 return false; … … 328 352 if (policy.equals("always")) { 329 353 if ("pluginmanager.version-based-update.policy".equals(togglePreferenceKey)) { 330 System.out.println(tr("Running plugin update after JOSM upgrade. Automatic update at startup is enabled."));354 Main.info(tr("Running plugin update after JOSM upgrade. Automatic update at startup is enabled.")); 331 355 } else if ("pluginmanager.time-based-update.policy".equals(togglePreferenceKey)) { 332 System.out.println(tr("Running plugin update after elapsed update interval. Automatic update at startup is disabled."));356 Main.info(tr("Running plugin update after elapsed update interval. Automatic update at startup is disabled.")); 333 357 } 334 358 return true; … … 336 360 337 361 if (!policy.equals("ask")) { 338 System.err.println(tr("Unexpected value ''{0}'' for preference ''{1}''. Assuming value ''ask''.", policy, togglePreferenceKey));362 Main.warn(tr("Unexpected value ''{0}'' for preference ''{1}''. Assuming value ''ask''.", policy, togglePreferenceKey)); 339 363 } 340 364 int ret = HelpAwareOptionPane.showOptionDialog( … … 513 537 * the class loader <code>pluginClassLoader</code>. 514 538 * 539 * @param parent The parent component to be used for the displayed dialog 515 540 * @param plugin the plugin 516 541 * @param pluginClassLoader the plugin class loader … … 521 546 Class<?> klass = plugin.loadClass(pluginClassLoader); 522 547 if (klass != null) { 523 System.out.println(tr("loading plugin ''{0}'' (version {1})", plugin.name, plugin.localversion));548 Main.info(tr("loading plugin ''{0}'' (version {1})", plugin.name, plugin.localversion)); 524 549 PluginProxy pluginProxy = plugin.load(klass); 525 550 pluginList.add(pluginProxy); … … 528 553 msg = null; 529 554 } catch (PluginException e) { 530 System.err.println(e.getMessage());555 Main.error(e.getMessage()); 531 556 Throwable cause = e.getCause(); 532 557 if (cause != null) { 533 558 msg = cause.getLocalizedMessage(); 534 559 if (msg != null) { 535 System.err.println("Cause: " + cause.getClass().getName()+": " + msg);560 Main.error("Cause: " + cause.getClass().getName()+": " + msg); 536 561 } else { 537 562 cause.printStackTrace(); … … 545 570 e.printStackTrace(); 546 571 } 547 if (msg != null && confirmDisablePlugin(parent, msg, plugin.name)) {572 if (msg != null && confirmDisablePlugin(parent, msg, plugin.name)) { 548 573 Main.pref.removeFromCollection("plugins", plugin.name); 549 574 } … … 554 579 * memory. 555 580 * 581 * @param parent The parent component to be used for the displayed dialog 556 582 * @param plugins the list of plugins 557 583 * @param monitor the progress monitor. Defaults to {@link NullProgressMonitor#INSTANCE} if null. … … 621 647 * set to false. 622 648 * 649 * @param parent The parent component to be used for the displayed dialog 623 650 * @param plugins the collection of plugins 624 651 * @param monitor the progress monitor. Defaults to {@link NullProgressMonitor#INSTANCE} if null. … … 698 725 * messages. 699 726 * 727 * @param parent The parent component to be used for the displayed dialog 700 728 * @param monitor the progress monitor. Defaults to {@link NullProgressMonitor#INSTANCE} if null. 701 729 * @return the set of plugins to load (as set of plugin names) … … 785 813 } 786 814 } catch (PluginException e) { 787 System.out.println(tr("Warning: failed to find plugin {0}", name));815 Main.warn(tr("Failed to find plugin {0}", name)); 788 816 e.printStackTrace(); 789 817 } … … 801 829 * @throws IllegalArgumentException thrown if plugins is null 802 830 */ 803 public static List<PluginInformation> 831 public static List<PluginInformation> updatePlugins(Component parent, 804 832 List<PluginInformation> plugins, ProgressMonitor monitor) 805 833 throws IllegalArgumentException{ … … 825 853 allPlugins = task1.getAvailablePlugins(); 826 854 plugins = buildListOfPluginsToLoad(parent,monitor.createSubTaskMonitor(1, false)); 827 } catch (ExecutionException e) {828 System.out.println(tr("Warning: failed to download plugin information list"));855 } catch (ExecutionException e) { 856 Main.warn(tr("Failed to download plugin information list")); 829 857 e.printStackTrace(); 830 858 // don't abort in case of error, continue with downloading plugins below 831 } catch (InterruptedException e) {832 System.out.println(tr("Warning: failed to download plugin information list"));859 } catch (InterruptedException e) { 860 Main.warn(tr("Failed to download plugin information list")); 833 861 e.printStackTrace(); 834 862 // don't abort in case of error, continue with downloading plugins below … … 838 866 // 839 867 Collection<PluginInformation> pluginsToUpdate = new ArrayList<PluginInformation>(); 840 for (PluginInformation pi: plugins) {868 for (PluginInformation pi: plugins) { 841 869 if (pi.isUpdateRequired()) { 842 870 pluginsToUpdate.add(pi); … … 907 935 /** 908 936 * Ask the user for confirmation that a plugin shall be disabled. 909 * 937 * 938 * @param parent The parent component to be used for the displayed dialog 910 939 * @param reason the reason for disabling the plugin 911 940 * @param name the plugin name … … 940 969 } 941 970 971 /** 972 * Returns the plugin of the specified name. 973 * @param name The plugin name 974 * @return The plugin of the specified name, if installed and loaded, or {@code null} otherwise. 975 */ 942 976 public static Object getPlugin(String name) { 943 977 for (PluginProxy plugin : pluginList) 944 if (plugin.getPluginInformation().name.equals(name))978 if (plugin.getPluginInformation().name.equals(name)) 945 979 return plugin.plugin; 946 980 return null; … … 986 1020 if (plugin.exists()) { 987 1021 if (!plugin.delete() && dowarn) { 988 System.err.println(tr("Warning: failed to delete outdated plugin ''{0}''.", plugin.toString()));989 System.err.println(tr("Warning: failed to install already downloaded plugin ''{0}''. Skipping installation. JOSM is still going to load the old plugin version.", pluginName));1022 Main.warn(tr("Failed to delete outdated plugin ''{0}''.", plugin.toString())); 1023 Main.warn(tr("Failed to install already downloaded plugin ''{0}''. Skipping installation. JOSM is still going to load the old plugin version.", pluginName)); 990 1024 continue; 991 1025 } … … 996 1030 } catch (Exception e) { 997 1031 if (dowarn) { 998 System.err.println(tr("Warning: failed to install plugin ''{0}'' from temporary download file ''{1}''. {2}", plugin.toString(), updatedPlugin.toString(), e.getLocalizedMessage()));1032 Main.warn(tr("Failed to install plugin ''{0}'' from temporary download file ''{1}''. {2}", plugin.toString(), updatedPlugin.toString(), e.getLocalizedMessage())); 999 1033 } 1000 1034 continue; … … 1002 1036 // Install plugin 1003 1037 if (!updatedPlugin.renameTo(plugin) && dowarn) { 1004 System.err.println(tr("Warning: failed to install plugin ''{0}'' from temporary download file ''{1}''. Renaming failed.", plugin.toString(), updatedPlugin.toString()));1005 System.err.println(tr("Warning: failed to install already downloaded plugin ''{0}''. Skipping installation. JOSM is still going to load the old plugin version.", pluginName));1038 Main.warn(tr("Failed to install plugin ''{0}'' from temporary download file ''{1}''. Renaming failed.", plugin.toString(), updatedPlugin.toString())); 1039 Main.warn(tr("Failed to install already downloaded plugin ''{0}''. Skipping installation. JOSM is still going to load the old plugin version.", pluginName)); 1006 1040 } 1007 1041 } … … 1177 1211 } 1178 1212 1213 /** 1214 * Returns the list of loaded plugins as a {@code String} to be displayed in status report. Useful for bug reports. 1215 * @return The list of loaded plugins (one plugin per line) 1216 */ 1179 1217 public static String getBugReportText() { 1180 String text = "";1218 StringBuilder text = new StringBuilder(); 1181 1219 LinkedList <String> pl = new LinkedList<String>(Main.pref.getCollection("plugins", new LinkedList<String>())); 1182 1220 for (final PluginProxy pp : pluginList) { … … 1188 1226 Collections.sort(pl); 1189 1227 for (String s : pl) { 1190 text += "Plugin: " + s + "\n"; 1191 } 1192 return text; 1193 } 1194 1228 text.append("Plugin: ").append(s).append("\n"); 1229 } 1230 return text.toString(); 1231 } 1232 1233 /** 1234 * Returns the list of loaded plugins as a {@code JPanel} to be displayed in About dialog. 1235 * @return The list of loaded plugins (one "line" of Swing components per plugin) 1236 */ 1195 1237 public static JPanel getInfoPanel() { 1196 1238 JPanel pluginTab = new JPanel(new GridBagLayout()); -
trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java
r6232 r6248 23 23 import java.util.jar.JarInputStream; 24 24 import java.util.jar.Manifest; 25 25 26 import javax.swing.ImageIcon; 26 27 … … 186 187 new URL(s); 187 188 } catch (MalformedURLException e) { 188 System.out.println(tr("Invalid URL ''{0}'' in plugin {1}", s, name));189 Main.info(tr("Invalid URL ''{0}'' in plugin {1}", s, name)); 189 190 s = null; 190 191 } … … 200 201 s = tr(s); 201 202 } catch (IllegalArgumentException e) { 202 System.out.println(tr("Invalid plugin description ''{0}'' in plugin {1}", s, name));203 Main.info(tr("Invalid plugin description ''{0}'' in plugin {1}", s, name)); 203 204 } 204 205 } -
trunk/src/org/openstreetmap/josm/plugins/ReadLocalPluginInformationTask.java
r6084 r6248 14 14 import java.util.Map; 15 15 16 import org.openstreetmap.josm.Main; 16 17 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 17 18 import org.openstreetmap.josm.gui.progress.ProgressMonitor; … … 90 91 processLocalPluginInformationFile(f); 91 92 } catch(PluginListParseException e) { 92 System.err.println(tr("Warning:Failed to scan file ''{0}'' for plugin information. Skipping.", fname));93 Main.warn(tr("Failed to scan file ''{0}'' for plugin information. Skipping.", fname)); 93 94 e.printStackTrace(); 94 95 } … … 151 152 } 152 153 } catch (PluginException e){ 153 System.err.println(e.getMessage());154 System.err.println(tr("Warning:Failed to scan file ''{0}'' for plugin information. Skipping.", fname));154 Main.warn("PluginException: "+e.getMessage()); 155 Main.warn(tr("Failed to scan file ''{0}'' for plugin information. Skipping.", fname)); 155 156 } 156 157 monitor.worked(1); -
trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java
r6084 r6248 259 259 if (!pluginDir.exists()) { 260 260 if (! pluginDir.mkdirs()) { 261 System.err.println(tr("Warning: failed to create plugin directory ''{0}''. Cannot cache plugin list from plugin site ''{1}''.", pluginDir.toString(), site));261 Main.warn(tr("Failed to create plugin directory ''{0}''. Cannot cache plugin list from plugin site ''{1}''.", pluginDir.toString(), site)); 262 262 } 263 263 } … … 311 311 List<PluginInformation> pis = new PluginListParser().parse(in); 312 312 availablePlugins.addAll(filterDeprecatedPlugins(pis)); 313 } catch (UnsupportedEncodingException e) {314 System.err.println(tr("Failed to parse plugin list document from site ''{0}''. Skipping site. Exception was: {1}", site, e.toString()));315 e.printStackTrace(); 316 } catch (PluginListParseException e) {317 System.err.println(tr("Failed to parse plugin list document from site ''{0}''. Skipping site. Exception was: {1}", site, e.toString()));313 } catch (UnsupportedEncodingException e) { 314 Main.error(tr("Failed to parse plugin list document from site ''{0}''. Skipping site. Exception was: {1}", site, e.toString())); 315 e.printStackTrace(); 316 } catch (PluginListParseException e) { 317 Main.error(tr("Failed to parse plugin list document from site ''{0}''. Skipping site. Exception was: {1}", site, e.toString())); 318 318 e.printStackTrace(); 319 319 } -
trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java
r6232 r6248 370 370 try { 371 371 closeDate = formatter.parse(m.group(2)); 372 } catch (ParseException ex) {373 System.err.println(tr("Failed to parse date ''{0}'' replied by server.", m.group(2)));372 } catch (ParseException ex) { 373 Main.error(tr("Failed to parse date ''{0}'' replied by server.", m.group(2))); 374 374 ex.printStackTrace(); 375 375 } -
trunk/src/org/openstreetmap/josm/tools/I18n.java
r6084 r6248 5 5 import java.io.File; 6 6 import java.io.FileInputStream; 7 import java.io.IOException; 7 8 import java.io.InputStream; 8 import java.io.IOException;9 9 import java.net.URL; 10 10 import java.text.MessageFormat; … … 14 14 import java.util.Comparator; 15 15 import java.util.HashMap; 16 import java.util.Locale; 16 17 import java.util.jar.JarInputStream; 17 18 import java.util.zip.ZipEntry; 18 import java.util.Locale;19 19 20 20 import javax.swing.JColorChooser; … … 641 641 } else { 642 642 if (!l.getLanguage().equals("en")) { 643 System.out.println(tr("Unable to find translation for the locale {0}. Reverting to {1}.",643 Main.info(tr("Unable to find translation for the locale {0}. Reverting to {1}.", 644 644 l.getDisplayName(), Locale.getDefault().getDisplayName())); 645 645 } else { -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r6246 r6248 308 308 } else { 309 309 if (!suppressWarnings) { 310 System.err.println(tr("Failed to locate image ''{0}''", name));310 Main.error(tr("Failed to locate image ''{0}''", name)); 311 311 } 312 312 return null; … … 613 613 } 614 614 } catch (Exception e) { 615 System.err.println(tr("Warning: failed to handle zip file ''{0}''. Exception was: {1}", archive.getName(), e.toString()));615 Main.warn(tr("Failed to handle zip file ''{0}''. Exception was: {1}", archive.getName(), e.toString())); 616 616 } finally { 617 617 Utils.close(zipFile); … … 671 671 return u; 672 672 } catch (SecurityException e) { 673 System.out.println(tr(674 " Warning: failed to access directory ''{0}'' for security reasons. Exception was: {1}",673 Main.warn(tr( 674 "Failed to access directory ''{0}'' for security reasons. Exception was: {1}", 675 675 name, e.toString())); 676 676 } … … 685 685 return u; 686 686 } catch (SecurityException e) { 687 System.out.println(tr(688 " Warning: failed to access directory ''{0}'' for security reasons. Exception was: {1}", dir, e687 Main.warn(tr( 688 "Failed to access directory ''{0}'' for security reasons. Exception was: {1}", dir, e 689 689 .toString())); 690 690 } … … 736 736 @Override 737 737 public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { 738 System.out.println();739 738 if (localName.equalsIgnoreCase("img")) { 740 739 String val = atts.getValue("src"); … … 759 758 return r.getResult(); 760 759 } catch (Exception e) { 761 System.out.println("INFO: parsing " + base + fn + " failed:\n" + e);760 Main.warn("Parsing " + base + fn + " failed:\n" + e); 762 761 return null; 763 762 } 764 System.out.println("INFO: parsing " + base + fn + " failed: Unexpected content.");763 Main.warn("Parsing " + base + fn + " failed: Unexpected content."); 765 764 return null; 766 765 } -
trunk/src/org/openstreetmap/josm/tools/OpenBrowser.java
r6070 r6248 51 51 // Workaround for KDE (Desktop API is severely flawed) 52 52 // see http://bugs.sun.com/view_bug.do?bug_id=6486393 53 System.err.println("Warning:Desktop class failed. Platform dependent fall back for open url in browser.");53 Main.warn("Desktop class failed. Platform dependent fall back for open url in browser."); 54 54 displayUrlFallback(uri); 55 55 } … … 60 60 } else { 61 61 try { 62 System.err.println("Warning:Desktop class is not supported. Platform dependent fall back for open url in browser.");62 Main.warn("Desktop class is not supported. Platform dependent fall back for open url in browser."); 63 63 displayUrlFallback(uri); 64 64 } catch (IOException e) { -
trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java
r6125 r6248 40 40 MsetEnabledPreferencesMenu.invoke(Ocom_apple_eawt_Application, new Object[] { Boolean.TRUE }); 41 41 } catch (Exception ex) { 42 // Oops, what now? 43 // We'll just ignore this for now. The user will still be able to close JOSM 44 // by closing all its windows. 45 System.out.println("Failed to register with OSX: " + ex); 42 // We'll just ignore this for now. The user will still be able to close JOSM by closing all its windows. 43 Main.warn("Failed to register with OSX: " + ex); 46 44 } 47 45 } … … 49 47 public Object invoke (Object proxy, Method method, Object[] args) throws Throwable { 50 48 Boolean handled = Boolean.TRUE; 51 //System.out.println("Going to handle method "+method+" (short: "+method.getName()+") with event "+args[0]);52 49 if (method.getName().equals("handleQuit")) { 53 50 handled = Main.exitJosm(false, 0); … … 62 59 args[0].getClass().getDeclaredMethod("setHandled", new Class[] { boolean.class }).invoke(args[0], new Object[] { handled }); 63 60 } catch (Exception ex) { 64 System.out.println("Failed to report handled event: " + ex);61 Main.warn("Failed to report handled event: " + ex); 65 62 } 66 63 } … … 69 66 @Override 70 67 public void openUrl(String url) throws IOException { 71 // Ain't that KISS?72 68 Runtime.getRuntime().exec("open " + url); 73 69 } -
trunk/src/org/openstreetmap/josm/tools/Shortcut.java
r5979 r6248 371 371 if (potentialShortcut != null) { 372 372 // this always is a logic error in the hook 373 System.err.println("CONFLICT WITH SYSTEM KEY "+shortText);373 Main.error("CONFLICT WITH SYSTEM KEY "+shortText); 374 374 return null; 375 375 } … … 415 415 if ( findShortcut(k, newmodifier) == null ) { 416 416 Shortcut newsc = new Shortcut(shortText, longText, requestedKey, m, k, newmodifier, false, false); 417 System.out.println(tr("Silent shortcut conflict: ''{0}'' moved by ''{1}'' to ''{2}''.",417 Main.info(tr("Silent shortcut conflict: ''{0}'' moved by ''{1}'' to ''{2}''.", 418 418 shortText, conflict.getShortText(), newsc.getKeyText())); 419 419 newsc.saveDefault(); -
trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java
r6229 r6248 24 24 import javax.xml.validation.ValidatorHandler; 25 25 26 import org.openstreetmap.josm.Main; 26 27 import org.openstreetmap.josm.io.MirroredInputStream; 27 28 import org.xml.sax.Attributes; … … 296 297 } catch (SAXException e) { 297 298 // Exception very unlikely to happen, so no need to translate this 298 System.err.println("Cannot disable 'load-external-dtd' feature: "+e.getMessage());299 Main.error("Cannot disable 'load-external-dtd' feature: "+e.getMessage()); 299 300 } 300 301 reader.parse(new InputSource(in));
Note:
See TracChangeset
for help on using the changeset viewer.