- Timestamp:
- 2014-02-01T03:18:43+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/MoveAction.java
r6380 r6798 55 55 } else if (dir == Direction.LEFT) { 56 56 sc = Shortcut.registerShortcut("core:moveleft", tr("Move objects {0}", tr("left")), KeyEvent.VK_LEFT, Shortcut.SHIFT); 57 } else { //dir == Direction.RIGHT ) {57 } else { //dir == Direction.RIGHT 58 58 sc = Shortcut.registerShortcut("core:moveright", tr("Move objects {0}", tr("right")), KeyEvent.VK_RIGHT, Shortcut.SHIFT); 59 59 } … … 73 73 } else if (dir == Direction.LEFT) { 74 74 putValue("toolbar", "action/move/left"); 75 } else { //dir == Direction.RIGHT ) {75 } else { //dir == Direction.RIGHT 76 76 putValue("toolbar", "action/move/right"); 77 77 } -
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r6317 r6798 41 41 */ 42 42 public final class OrthogonalizeAction extends JosmAction { 43 private String USAGE = tr( 43 private static final String USAGE = tr( 44 44 "<h3>When one or more ways are selected, the shape is adjusted such, that all angles are 90 or 180 degrees.</h3>"+ 45 45 "You can add two nodes to the selection. Then, the direction is fixed by these two reference nodes. "+ … … 279 279 throw new InvalidUserInputException( 280 280 tr("<html>Please make sure all selected ways head in a similar direction<br>"+ 281 "or orthogonalize them one by one.</html>")); 281 "or orthogonalize them one by one.</html>"), ex); 282 282 } 283 283 … … 439 439 direction = direction.changeBy(angleToDirectionChange(h2 - h1, TOLERANCE1)); 440 440 } catch (RejectedAngleException ex) { 441 throw new InvalidUserInputException(tr("Please select ways with angles of approximately 90 or 180 degrees.")); 441 throw new InvalidUserInputException(tr("Please select ways with angles of approximately 90 or 180 degrees."), ex); 442 442 } 443 443 segDirections[i+1] = direction; … … 574 574 super(message); 575 575 } 576 InvalidUserInputException(String message, Throwable cause) { 577 super(message, cause); 578 } 576 579 InvalidUserInputException() { 577 580 super(); -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmCompressedTask.java
r6380 r6798 19 19 public class DownloadOsmCompressedTask extends DownloadOsmTask { 20 20 21 String PATTERN_GZ = "https?://.*/.*\\.osm.(gz|bz2?)"; 21 static final String PATTERN_GZ = "https?://.*/.*\\.osm.(gz|bz2?)"; 22 22 23 23 @Override -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r6792 r6798 86 86 87 87 private Node lastUsedNode = null; 88 private double PHI =Math.toRadians(90);88 private static final double PHI = Math.toRadians(90); 89 89 private double toleranceMultiplier; 90 90 -
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r6792 r6798 445 445 this.keyPattern = Pattern.compile(key, searchFlags); 446 446 } catch (PatternSyntaxException e) { 447 throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage())); 447 throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()), e); 448 448 } catch (Exception e) { 449 throw new ParseError(tr(rxErrorMsgNoPos, key, e.getMessage())); 449 throw new ParseError(tr(rxErrorMsgNoPos, key, e.getMessage()), e); 450 450 } 451 451 try { 452 452 this.valuePattern = Pattern.compile(value, searchFlags); 453 453 } catch (PatternSyntaxException e) { 454 throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage())); 454 throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()), e); 455 455 } catch (Exception e) { 456 throw new ParseError(tr(rxErrorMsgNoPos, value, e.getMessage())); 456 throw new ParseError(tr(rxErrorMsgNoPos, value, e.getMessage()), e); 457 457 } 458 458 this.key = key; … … 696 696 this.searchRegex = Pattern.compile(s, regexFlags(caseSensitive)); 697 697 } catch (PatternSyntaxException e) { 698 throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage())); 698 throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()), e); 699 699 } catch (Exception e) { 700 throw new ParseError(tr(rxErrorMsgNoPos, s, e.getMessage())); 700 throw new ParseError(tr(rxErrorMsgNoPos, s, e.getMessage()), e); 701 701 } 702 702 this.search = s; … … 1171 1171 public ParseError(String msg) { 1172 1172 super(msg); 1173 } 1174 public ParseError(String msg, Throwable cause) { 1175 super(msg, cause); 1173 1176 } 1174 1177 public ParseError(Token expected, Token found) { -
trunk/src/org/openstreetmap/josm/data/Bounds.java
r6509 r6798 182 182 values[i] = Double.parseDouble(components[i]); 183 183 } catch(NumberFormatException e) { 184 throw new IllegalArgumentException(MessageFormat.format("Illegal double value ''{0}''", components[i])); 184 throw new IllegalArgumentException(MessageFormat.format("Illegal double value ''{0}''", components[i]), e); 185 185 } 186 186 } -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r6792 r6798 1189 1189 } 1190 1190 } catch (IllegalArgumentException ex) { 1191 throw new RuntimeException(); 1191 throw new RuntimeException(ex); 1192 1192 } catch (IllegalAccessException ex) { 1193 throw new RuntimeException(); 1193 throw new RuntimeException(ex); 1194 1194 } 1195 1195 } … … 1202 1202 struct = klass.newInstance(); 1203 1203 } catch (InstantiationException ex) { 1204 throw new RuntimeException(); 1204 throw new RuntimeException(ex); 1205 1205 } catch (IllegalAccessException ex) { 1206 throw new RuntimeException(); 1206 throw new RuntimeException(ex); 1207 1207 } 1208 1208 for (Entry<String,String> key_value : hash.entrySet()) { … … 1214 1214 continue; 1215 1215 } catch (SecurityException ex) { 1216 throw new RuntimeException(); 1216 throw new RuntimeException(ex); 1217 1217 } 1218 1218 if (f.getAnnotation(pref.class) == null) { … … 1242 1242 f.set(struct, value); 1243 1243 } catch (IllegalArgumentException ex) { 1244 throw new AssertionError(); 1244 throw new AssertionError(ex); 1245 1245 } catch (IllegalAccessException ex) { 1246 throw new RuntimeException(); 1246 throw new RuntimeException(ex); 1247 1247 } 1248 1248 } -
trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
r6388 r6798 113 113 update(null); 114 114 } catch (ProjectionConfigurationException ex1) { 115 throw new RuntimeException(); 115 throw new RuntimeException(ex1); 116 116 } 117 117 } … … 201 201 initp = parseParameterList(init); 202 202 } catch (ProjectionConfigurationException ex) { 203 throw new ProjectionConfigurationException(tr(initKey+": "+ex.getMessage())); 203 throw new ProjectionConfigurationException(tr(initKey+": "+ex.getMessage()), ex); 204 204 } 205 205 for (Map.Entry<String, String> e : parameters.entrySet()) { … … 292 292 towgs84Param.add(Double.parseDouble(str)); 293 293 } catch (NumberFormatException e) { 294 throw new ProjectionConfigurationException(tr("Unable to parse value of parameter ''towgs84'' (''{0}'')", str)); 294 throw new ProjectionConfigurationException(tr("Unable to parse value of parameter ''towgs84'' (''{0}'')", str), e); 295 295 } 296 296 } … … 380 380 } catch (NumberFormatException e) { 381 381 throw new ProjectionConfigurationException( 382 tr("Unable to parse value ''{1}'' of parameter ''{0}'' as number.", parameterName, doubleStr)); 382 tr("Unable to parse value ''{1}'' of parameter ''{0}'' as number.", parameterName, doubleStr), e); 383 383 } 384 384 } -
trunk/src/org/openstreetmap/josm/gui/FileDrop.java
r6730 r6798 297 297 298 298 // BEGIN 2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added. 299 private static String ZERO_CHAR_STRING = "" + (char)0; 299 private static final String ZERO_CHAR_STRING = "" + (char)0; 300 300 private static File[] createFileArray(BufferedReader bReader) 301 301 { -
trunk/src/org/openstreetmap/josm/gui/MapStatus.java
r6789 r6798 784 784 lonText.setInheritsPopupMenu(true); 785 785 headingText.setInheritsPopupMenu(true); 786 //angleText.setInheritsPopupMenu(true);787 786 distText.setInheritsPopupMenu(true); 788 787 nameText.setInheritsPopupMenu(true); 789 //helpText.setInheritsPopupMenu(true);790 //progressBar.setInheritsPopupMenu(true);791 788 792 789 add(latText, GBC.std()); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r6732 r6798 1628 1628 putValue(SHORT_DESCRIPTION, tr("Edit the relation the currently selected relation member refers to")); 1629 1629 putValue(SMALL_ICON, ImageProvider.get("dialogs", "edit")); 1630 //putValue(NAME, tr("Edit"));1631 1630 refreshEnabled(); 1632 1631 } -
trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java
r6643 r6798 55 55 import org.openstreetmap.josm.tools.WindowGeometry; 56 56 57 /** 58 * Help browser displaying HTML pages fetched from JOSM wiki. 59 */ 57 60 public class HelpBrowser extends JDialog { 58 61 /** the unique instance */ … … 425 428 class OpenInBrowserAction extends AbstractAction { 426 429 public OpenInBrowserAction() { 427 //putValue(NAME, tr("Open in Browser"));428 430 putValue(SHORT_DESCRIPTION, tr("Open the current help page in an external browser")); 429 431 putValue(SMALL_ICON, ImageProvider.get("help", "internet")); … … 438 440 class EditAction extends AbstractAction { 439 441 public EditAction() { 440 // putValue(NAME, tr("Edit"));441 442 putValue(SHORT_DESCRIPTION, tr("Edit the current help page")); 442 443 putValue(SMALL_ICON,ImageProvider.get("dialogs", "edit")); -
trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
r6792 r6798 272 272 static int checkMaxZoomLvl(int maxZoomLvl, TileSource ts) { 273 273 if(maxZoomLvl > MAX_ZOOM) { 274 /*Main.debug("Max. zoom level should not be more than 30! Setting to 30.");*/275 274 maxZoomLvl = MAX_ZOOM; 276 275 } 277 276 if(maxZoomLvl < PROP_MIN_ZOOM_LVL.get()) { 278 /*Main.debug("Max. zoom level should not be more than min. zoom level! Setting to min.");*/279 277 maxZoomLvl = PROP_MIN_ZOOM_LVL.get(); 280 278 } -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r6792 r6798 919 919 timezone = parseTimezone(zone); 920 920 } catch (ParseException pe) { 921 throw new RuntimeException(); 921 throw new RuntimeException(pe); 922 922 } 923 923 delta = sldMinutes.getValue()*60 + sldSeconds.getValue(); -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageEntry.java
r6450 r6798 191 191 c = super.clone(); 192 192 } catch (CloneNotSupportedException e) { 193 throw new RuntimeException(); 193 throw new RuntimeException(e); 194 194 } 195 195 return (ImageEntry) c; -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r6643 r6798 1107 1107 } 1108 1108 1109 private static DataFlavor ACTION_FLAVOR = new DataFlavor( 1110 ActionDefinition.class, "ActionItem"); 1111 1109 private static final DataFlavor ACTION_FLAVOR = new DataFlavor(ActionDefinition.class, "ActionItem"); 1112 1110 } -
trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
r6792 r6798 61 61 // independent from the keyboard's labelling. But the operation system's locale 62 62 // usually matches the keyboard. This even works with my English Windows and my German keyboard. 63 private static String SHIFT = KeyEvent.getKeyModifiersText(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.SHIFT_DOWN_MASK).getModifiers()); 64 private static String CTRL = KeyEvent.getKeyModifiersText(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.CTRL_DOWN_MASK).getModifiers()); 65 private static String ALT = KeyEvent.getKeyModifiersText(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.ALT_DOWN_MASK).getModifiers()); 66 private static String META = KeyEvent.getKeyModifiersText(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.META_DOWN_MASK).getModifiers()); 63 private static final String SHIFT = KeyEvent.getKeyModifiersText(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.SHIFT_DOWN_MASK).getModifiers()); 64 private static final String CTRL = KeyEvent.getKeyModifiersText(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.CTRL_DOWN_MASK).getModifiers()); 65 private static final String ALT = KeyEvent.getKeyModifiersText(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.ALT_DOWN_MASK).getModifiers()); 66 private static final String META = KeyEvent.getKeyModifiersText(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.META_DOWN_MASK).getModifiers()); 67 67 68 68 // A list of keys to present the user. Sadly this really is a list of keys Java knows about, -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
r6795 r6798 1362 1362 result.add(presetType); 1363 1363 } catch (IllegalArgumentException e) { 1364 throw new SAXException(tr("Unknown type: {0}", type)); 1364 throw new SAXException(tr("Unknown type: {0}", type), e); 1365 1365 } 1366 1366 } -
trunk/src/org/openstreetmap/josm/io/GpxImporter.java
r6716 r6798 86 86 } catch (SAXException e) { 87 87 Main.error(e); 88 throw new IOException(tr("Parsing data for layer ''{0}'' failed", fileName)); 88 throw new IOException(tr("Parsing data for layer ''{0}'' failed", fileName), e); 89 89 } 90 90 } … … 161 161 } catch (SAXException e) { 162 162 Main.error(e); 163 throw new IOException(tr("Parsing data for layer ''{0}'' failed", gpxLayerName)); 163 throw new IOException(tr("Parsing data for layer ''{0}'' failed", gpxLayerName), e); 164 164 } 165 165 } -
trunk/src/org/openstreetmap/josm/io/NMEAImporter.java
r6132 r6798 25 25 "nmea,nme,nma,log,txt", "nmea", tr("NMEA-0183 Files") + " (*.nmea *.nme *.nma *.log *.txt)"); 26 26 27 /** 28 * Constructs a new {@code NMEAImporter}. 29 */ 27 30 public NMEAImporter() { 28 31 super(FILE_FILTER); 29 32 } 30 33 31 @Override public void importData(File file, ProgressMonitor progressMonitor) throws IOException { 34 @Override 35 public void importData(File file, ProgressMonitor progressMonitor) throws IOException { 32 36 final String fn = file.getName(); 33 final NmeaReader r = new NmeaReader(new FileInputStream(file) , file.getAbsoluteFile().getParentFile());37 final NmeaReader r = new NmeaReader(new FileInputStream(file)); 34 38 if (r.getNumberOfCoordinates() > 0) { 35 39 r.data.storageFile = file; -
trunk/src/org/openstreetmap/josm/io/NmeaReader.java
r6296 r6798 3 3 4 4 import java.io.BufferedReader; 5 import java.io.File;6 5 import java.io.InputStream; 7 6 import java.io.InputStreamReader; … … 170 169 } 171 170 172 public NmeaReader(InputStream source , File relativeMarkerPath) {171 public NmeaReader(InputStream source) { 173 172 174 173 // create the data tree -
trunk/src/org/openstreetmap/josm/io/OsmImporter.java
r6716 r6798 44 44 } 45 45 46 /** 47 * Constructs a new {@code OsmImporter}. 48 */ 46 49 public OsmImporter() { 47 50 super(FILE_FILTER); … … 65 68 } catch (FileNotFoundException e) { 66 69 Main.error(e); 67 throw new IOException(tr("File ''{0}'' does not exist.", file.getName())); 70 throw new IOException(tr("File ''{0}'' does not exist.", file.getName()), e); 68 71 } finally { 69 72 Utils.close(in); -
trunk/src/org/openstreetmap/josm/io/imagery/HTMLGrabber.java
r6316 r6798 45 45 browser = builder.start(); 46 46 } catch (IOException ioe) { 47 throw new IOException( 47 throw new IOException("Could not start browser. Please check that the executable path is correct.\n" + ioe.getMessage(), ioe); 48 48 } 49 49 -
trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java
r6316 r6798 301 301 tags = URLDecoder.decode(args.get("addtags"), "UTF-8").split("\\|"); 302 302 } catch (UnsupportedEncodingException e) { 303 throw new RuntimeException(); 303 throw new RuntimeException(e); 304 304 } 305 305 Set<String> tagSet = new HashSet<String>(); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java
r6643 r6798 37 37 Main.warn("RemoteControl: Error parsing import remote control request:"); 38 38 Main.error(ex); 39 throw new RequestHandlerErrorException(); 39 throw new RequestHandlerErrorException(ex); 40 40 } 41 41 } … … 118 118 url = new URL(urlString); 119 119 } catch (MalformedURLException e) { 120 throw new RequestHandlerBadRequestException("MalformedURLException: "+e.getMessage()); 120 throw new RequestHandlerBadRequestException("MalformedURLException: "+e.getMessage(), e); 121 121 } 122 122 // Find download tasks for the given URL -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
r6792 r6798 137 137 Main.warn("RemoteControl: Error parsing load_and_zoom remote control request:"); 138 138 Main.error(ex); 139 throw new RequestHandlerErrorException(); 139 throw new RequestHandlerErrorException(ex); 140 140 } 141 141 -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java
r6782 r6798 276 276 return URLDecoder.decode(param, "UTF-8"); 277 277 } catch (UnsupportedEncodingException e) { 278 throw new RuntimeException(); 278 throw new RuntimeException(e); 279 279 } 280 280 } … … 289 289 super(message); 290 290 } 291 291 public RequestHandlerException(String message, Throwable cause) { 292 super(message, cause); 293 } 294 public RequestHandlerException(Throwable cause) { 295 super(cause); 296 } 292 297 public RequestHandlerException() { 293 298 } … … 295 300 296 301 public static class RequestHandlerErrorException extends RequestHandlerException { 302 public RequestHandlerErrorException(Throwable cause) { 303 super(cause); 304 } 297 305 } 298 306 … … 302 310 super(message); 303 311 } 312 public RequestHandlerBadRequestException(String message, Throwable cause) { 313 super(message, cause); 314 } 304 315 } 305 316 -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r6792 r6798 480 480 md = MessageDigest.getInstance("MD5"); 481 481 } catch (NoSuchAlgorithmException e) { 482 throw new RuntimeException(); 482 throw new RuntimeException(e); 483 483 } 484 484 byte[] byteDigest = md.digest(byteData);
Note:
See TracChangeset
for help on using the changeset viewer.