Changeset 110 in josm
- Timestamp:
- 2006-07-15T15:57:15+02:00 (18 years ago)
- Location:
- src/org/openstreetmap/josm
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/Main.java
r104 r110 272 272 } catch (final IOException e1) { 273 273 e1.printStackTrace(); 274 errMsg = tr("Preferences could not be loaded. Write default preference file to '{0}'.",274 errMsg = tr("Preferences could not be loaded. Write default preference file to \"{0}\".", 275 275 pref.getPreferencesDir() + "preferences"); 276 276 Main.pref.resetToDefault(); … … 339 339 final Bounds b = DownloadAction.osmurl2bounds(s); 340 340 if (b == null) 341 JOptionPane.showMessageDialog(Main.parent, tr("Ignoring malformed url: '{0}'", s));341 JOptionPane.showMessageDialog(Main.parent, tr("Ignoring malformed url: \"{0}\"", s)); 342 342 else 343 343 main.downloadAction.download(false, b.min.lat(), b.min.lon(), b.max.lat(), b.max.lon()); … … 349 349 main.openAction.openFile(new File(new URI(s))); 350 350 } catch (URISyntaxException e) { 351 JOptionPane.showMessageDialog(Main.parent, tr("Ignoring malformed file url: '{0}", s));351 JOptionPane.showMessageDialog(Main.parent, tr("Ignoring malformed file url: \"{0}\"", s)); 352 352 } 353 353 return; -
src/org/openstreetmap/josm/actions/OpenAction.java
r104 r110 85 85 } catch (IOException x) { 86 86 x.printStackTrace(); 87 JOptionPane.showMessageDialog(Main.parent, tr("Could not read '{0}'",fn)+"\n"+x.getMessage());87 JOptionPane.showMessageDialog(Main.parent, tr("Could not read \"{0}\"",fn)+"\n"+x.getMessage()); 88 88 } 89 89 } -
src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
r108 r110 86 86 String key = data.getValueAt(row, 0).toString(); 87 87 Collection<OsmPrimitive> sel = Main.ds.getSelected(); 88 String msg = "<html>"+trn("This will change {0} object.", "This will change {0} objects.", sel.size(), sel.size())+"<br><br> "+tr("Please select a new value for '{0}'.<br>(Empty string deletes the key.)</html>)", key);88 String msg = "<html>"+trn("This will change {0} object.", "This will change {0} objects.", sel.size(), sel.size())+"<br><br> "+tr("Please select a new value for \"{0}\".<br>(Empty string deletes the key.)</html>)", key); 89 89 final JComboBox combo = (JComboBox)data.getValueAt(row, 1); 90 90 JPanel p = new JPanel(new BorderLayout()); -
src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r108 r110 87 87 } catch (IOException e) { 88 88 e.printStackTrace(); 89 JOptionPane.showMessageDialog(Main.parent, tr("Could not read from url: '{0}'",url));89 JOptionPane.showMessageDialog(Main.parent, tr("Could not read from url: \"{0}\"",url)); 90 90 } catch (SAXException e) { 91 91 e.printStackTrace(); 92 JOptionPane.showMessageDialog(Main.parent,tr("Parsing error in url: '{0}'",url));92 JOptionPane.showMessageDialog(Main.parent,tr("Parsing error in url: \"{0}\"",url)); 93 93 } 94 94 } -
src/org/openstreetmap/josm/io/OsmReader.java
r106 r110 26 26 import org.openstreetmap.josm.data.osm.visitor.AddVisitor; 27 27 import org.openstreetmap.josm.data.osm.visitor.Visitor; 28 import org.openstreetmap.josm.tools.DateParser; 28 29 import org.xml.sax.Attributes; 29 30 import org.xml.sax.SAXException; … … 145 146 if (time != null && time.length() != 0) { 146 147 try { 147 DateFormat df = new SimpleDateFormat("y-M-d H:m:s"); 148 current.timestamp = df.parse(time); 148 current.timestamp = DateParser.parse(time); 149 149 } catch (ParseException e) { 150 150 e.printStackTrace(); 151 throw new SAXException(tr("Couldn' t read time format '{0}'.",time));151 throw new SAXException(tr("Couldn''t read time format \"{0}\".",time)); 152 152 } 153 153 } … … 164 164 String s = atts.getValue(value); 165 165 if (s == null) 166 throw new SAXException(tr("Missing required attirbute '{0}'.",value));166 throw new SAXException(tr("Missing required attirbute \"{0}\".",value)); 167 167 return Long.parseLong(s); 168 168 } -
src/org/openstreetmap/josm/io/RawCsvReader.java
r104 r110 81 81 st.nextToken(); 82 82 else 83 throw new SAXException(tr("Unknown data type: '{0}'.{1}",token,(Main.pref.get("csv.importstring").equals("") ? (" "+tr("Maybe add an format string in preferences.")) : "")));83 throw new SAXException(tr("Unknown data type: \"{0}\".{1}",token,(Main.pref.get("csv.importstring").equals("") ? (" "+tr("Maybe add an format string in preferences.")) : ""))); 84 84 } 85 85 data.add(new GpsPoint(new LatLon(lat, lon), time)); -
src/org/openstreetmap/josm/io/RawGpsReader.java
r106 r110 41 41 double lon = Double.parseDouble(atts.getValue("lon")); 42 42 if (Math.abs(lat) > 90) 43 throw new SAXException(tr("Data error: lat value '{0}'is out of bound.", lat));43 throw new SAXException(tr("Data error: lat value \"{0}\" is out of bound.", lat)); 44 44 if (Math.abs(lon) > 180) 45 throw new SAXException(tr("Data error: lon value '{0}'is out of bound.", lon));45 throw new SAXException(tr("Data error: lon value \"{0}\" is out of bound.", lon)); 46 46 currentLatLon = new LatLon(lat, lon); 47 47 } catch (NumberFormatException e) { -
src/org/openstreetmap/josm/test/DateParserTest.java
r102 r110 25 25 assertEquals(d2, DateParser.parse("11/23/2001T23:05:42")); 26 26 assertEquals(d2, DateParser.parse("11/23/2001T23:05:42+001")); 27 assertEquals(d2, DateParser.parse("2001-11-23T23:05:42+01:00")); 27 28 assertEquals(d, DateParser.parse("11/23/2001T23:05:42.123")); 28 29 assertEquals(d, DateParser.parse("11/23/2001T23:05:42.123+001")); -
src/org/openstreetmap/josm/tools/DateParser.java
r107 r110 6 6 import java.text.SimpleDateFormat; 7 7 import java.util.Date; 8 import java.util.regex.Matcher; 9 import java.util.regex.Pattern; 8 10 9 11 /** … … 17 19 "yyyy-MM-dd'T'HH:mm:ss'Z'", 18 20 "yyyy-MM-dd'T'HH:mm:ssZ", 21 "yyyy-MM-dd'T'HH:mm:ss", 22 "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", 19 23 "yyyy-MM-dd'T'HH:mm:ss.SSSZ", 20 "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",21 24 "yyyy-MM-dd HH:mm:ss", 22 25 "MM/dd/yyyy HH:mm:ss", 26 "MM/dd/yyyy'T'HH:mm:ss.SSS'Z'", 23 27 "MM/dd/yyyy'T'HH:mm:ss.SSSZ", 24 "MM/dd/yyyy'T'HH:mm:ss.SSS'Z'",25 28 "MM/dd/yyyy'T'HH:mm:ss.SSS", 26 29 "MM/dd/yyyy'T'HH:mm:ssZ", … … 30 33 31 34 public static Date parse(String d) throws ParseException { 35 // first try to fix ruby's broken xmlschema - format 36 Matcher m = Pattern.compile("(....-..-..T..:..:..[+-]..):(..)").matcher(d); 37 if (m.matches()) 38 d = m.group(1) + m.group(2); 39 32 40 for (String parse : formats) { 33 41 SimpleDateFormat sdf = new SimpleDateFormat(parse);
Note:
See TracChangeset
for help on using the changeset viewer.