- Timestamp:
- 2010-01-13T20:12:48+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/dialogs
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java
r2715 r2847 214 214 tr("Continue resolving")}; 215 215 int ret = JOptionPane.showOptionDialog(Main.parent, 216 tr("<html>You did n''t finish to merge the differences in this conflict.<br>"216 tr("<html>You did not finish to merge the differences in this conflict.<br>" 217 217 + "Conflict resolutions won't be applied unless all differences<br>" 218 218 + "are resolved." -
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
r2711 r2847 50 50 import org.openstreetmap.josm.tools.Shortcut; 51 51 import org.openstreetmap.josm.tools.ImageProvider.OverlayPosition; 52 import org.openstreetmap.josm.tools.CheckParameterUtil; 52 53 53 54 /** … … 81 82 static public LayerListDialog getInstance() throws IllegalStateException { 82 83 if (instance == null) 83 throw new IllegalStateException( tr("Dialog not created yet. Invoke createInstance() first"));84 throw new IllegalStateException("Dialog not created yet. Invoke createInstance() first"); 84 85 return instance; 85 86 } … … 311 312 public ShowHideLayerAction(Layer layer) throws IllegalArgumentException { 312 313 this(); 313 if (layer == null) 314 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer")); 314 CheckParameterUtil.ensureParameterNotNull(layer, "layer"); 315 315 this.layer = layer; 316 316 putValue(NAME, tr("Show/Hide")); … … 356 356 private Layer layer; 357 357 358 public ActivateLayerAction(Layer layer) throws IllegalArgumentException{358 public ActivateLayerAction(Layer layer) { 359 359 this(); 360 if (layer == null) 361 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer")); 360 CheckParameterUtil.ensureParameterNotNull(layer, "layer"); 362 361 this.layer = layer; 363 362 putValue(NAME, tr("Activate")); … … 423 422 public MergeAction(Layer layer) throws IllegalArgumentException { 424 423 this(); 425 if (layer == null) 426 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer")); 424 CheckParameterUtil.ensureParameterNotNull(layer, "layer"); 427 425 this.layer = layer; 428 426 putValue(NAME, tr("Merge")); -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManager.java
r2824 r2847 516 516 HelpAwareOptionPane.showOptionDialog( 517 517 ChangesetCacheManager.this, 518 tr("<html>JOSM is currently running with an anonymous user. It can 't download<br>"518 tr("<html>JOSM is currently running with an anonymous user. It cannot download<br>" 519 519 + "your changesets from the OSM server unless you enter your OSM user name<br>" 520 520 + "in the JOSM preferences.</html>" -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableCellRenderer.java
r2711 r2847 60 60 protected void renderOpen(Changeset cs) { 61 61 if (cs.isOpen()) { 62 setText(trc("changeset. open", "Open"));62 setText(trc("changeset.state", "Open")); 63 63 } else { 64 setText(trc("changeset. open", "Closed"));64 setText(trc("changeset.state", "Closed")); 65 65 } 66 66 setToolTipText(""); -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentDownloadTask.java
r2711 r2847 6 6 import java.awt.Component; 7 7 import java.io.IOException; 8 import java.text.MessageFormat; 8 9 import java.util.ArrayList; 9 10 import java.util.Collection; … … 68 69 super(tr("Downloading changeset content"), false /* don't ignore exceptions */); 69 70 if (changesetId <= 0) 70 throw new IllegalArgumentException( tr("Expected integer value > 0 for parameter ''{0}'', got ''{1}''", "changesetId", changesetId));71 throw new IllegalArgumentException(MessageFormat.format("Expected integer value > 0 for parameter ''{0}'', got ''{1}''", "changesetId", changesetId)); 71 72 init(Collections.singleton(changesetId)); 72 73 } … … 94 95 super(parent, tr("Downloading changeset content"), false /* don't ignore exceptions */); 95 96 if (changesetId <= 0) 96 throw new IllegalArgumentException( tr("Expected integer value > 0 for parameter ''{0}'', got ''{1}''", "changesetId", changesetId));97 throw new IllegalArgumentException(MessageFormat.format("Expected integer value > 0 for parameter ''{0}'', got ''{1}''", "changesetId", changesetId)); 97 98 init(Collections.singleton(changesetId)); 98 99 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanel.java
r2711 r2847 322 322 HelpAwareOptionPane.showOptionDialog( 323 323 ChangesetContentPanel.this, 324 trn("<html>The selected object is n''t available in the current<br>"324 trn("<html>The selected object is not available in the current<br>" 325 325 + "edit layer ''{0}''.</html>", 326 326 "<html>None of the selected objects is available in the current<br>" … … 384 384 HelpAwareOptionPane.showOptionDialog( 385 385 ChangesetContentPanel.this, 386 trn("<html>The selected object is n''t available in the current<br>"386 trn("<html>The selected object is not available in the current<br>" 387 387 + "edit layer ''{0}''.</html>", 388 388 "<html>None of the selected objects is available in the current<br>" -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/SingleChangesetDownloadPanel.java
r2711 r2847 139 139 public void validate() { 140 140 if (!isValid()) { 141 feedbackInvalid(tr("The current value is n't a valid changeset ID. Please enter an integer value > 0"));141 feedbackInvalid(tr("The current value is not a valid changeset ID. Please enter an integer value > 0")); 142 142 } else { 143 143 feedbackValid(tr("Please enter an integer value > 0")); -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java
r2822 r2847 525 525 query.forUser(im.getUserId()); 526 526 } else 527 throw new IllegalStateException(tr("Can 't restrict changeset query to the current user because the current user is anonymous"));527 throw new IllegalStateException(tr("Cannot restrict changeset query to the current user because the current user is anonymous")); 528 528 } else if (rbRestrictToUid.isSelected()) { 529 529 int uid = valUid.getUid(); … … 531 531 query.forUser(uid); 532 532 } else 533 throw new IllegalStateException(tr("Current value ''{0}'' for user ID is n''t valid", tfUid.getText()));533 throw new IllegalStateException(tr("Current value ''{0}'' for user ID is not valid", tfUid.getText())); 534 534 } else if (rbRestrictToUserName.isSelected()) { 535 535 if (! valUserName.isValid()) 536 throw new IllegalStateException(tr("Can ''t restrict the changeset query to the user name ''{0}''", tfUserName.getText()));536 throw new IllegalStateException(tr("Cannot restrict the changeset query to the user name ''{0}''", tfUserName.getText())); 537 537 query.forUser(tfUserName.getText()); 538 538 } … … 835 835 public void fillInQuery(ChangesetQuery query) throws IllegalStateException{ 836 836 if (!isValidChangesetQuery()) 837 throw new IllegalStateException(tr("Can 't build changeset query with time based restrictions. Input isn't valid."));837 throw new IllegalStateException(tr("Cannot build changeset query with time based restrictions. Input is not valid.")); 838 838 if (rbClosedAfter.isSelected()) { 839 839 GregorianCalendar cal = new GregorianCalendar(); … … 940 940 public void fillInQuery(ChangesetQuery query) { 941 941 if (!isValidChangesetQuery()) 942 throw new IllegalStateException(tr("Can 't restrict the changeset query to a specific bounding box. The input is invalid."));942 throw new IllegalStateException(tr("Cannot restrict the changeset query to a specific bounding box. The input is invalid.")); 943 943 query.inBbox(getBoundingBox()); 944 944 } … … 987 987 int uid = Integer.parseInt(value); 988 988 if (uid <= 0) { 989 feedbackInvalid(tr("The current value is n't a valid user ID. Please enter an integer value > 0"));989 feedbackInvalid(tr("The current value is not a valid user ID. Please enter an integer value > 0")); 990 990 return; 991 991 } 992 992 } catch(NumberFormatException e) { 993 feedbackInvalid(tr("The current value is n't a valid user ID. Please enter an integer value > 0"));993 feedbackInvalid(tr("The current value is not a valid user ID. Please enter an integer value > 0")); 994 994 return; 995 995 } … … 1028 1028 String value = getComponent().getText(); 1029 1029 if (value.trim().length() == 0) { 1030 feedbackInvalid(tr("<html>The current value is n't a valid user name.<br>Please enter an non-empty user name.</html>"));1030 feedbackInvalid(tr("<html>The current value is not a valid user name.<br>Please enter an non-empty user name.</html>")); 1031 1031 return; 1032 1032 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java
r2578 r2847 3 3 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 import static org.openstreetmap.josm.tools.I18n.trn; 5 6 6 7 import java.awt.BorderLayout; … … 43 44 import org.openstreetmap.josm.io.OsmServerObjectReader; 44 45 import org.openstreetmap.josm.io.OsmTransferException; 46 import org.openstreetmap.josm.tools.CheckParameterUtil; 45 47 import org.openstreetmap.josm.tools.ImageProvider; 46 48 import org.xml.sax.SAXException; … … 117 119 */ 118 120 public ChildRelationBrowser(OsmDataLayer layer) throws IllegalArgumentException { 119 if (layer == null) 120 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer")); 121 CheckParameterUtil.ensureParameterNotNull(layer, "layer"); 121 122 this.layer = layer; 122 123 model = new RelationTreeModel(); … … 326 327 JOptionPane.showMessageDialog( 327 328 Main.parent, 328 tr("There were {0} conflicts during import.", conflictsCount), 329 tr("Conflicts in data"), 329 trn("There was {0} conflict during import.", 330 "There were {0} conflicts during import.", 331 conflictsCount, conflictsCount), 332 trn("Conflict in data", "Conflicts in data", conflictsCount), 330 333 JOptionPane.WARNING_MESSAGE 331 334 ); … … 342 345 String message = tr("<html>The child relation<br>" 343 346 + "{0}<br>" 344 + "is deleted on the server. It can 't be loaded",347 + "is deleted on the server. It cannot be loaded", 345 348 r.getDisplayName(DefaultNameFormatter.getInstance()) 346 349 ); … … 479 482 JOptionPane.showMessageDialog( 480 483 Main.parent, 481 tr("There were {0} conflicts during import.", conflictsCount), 482 tr("Conflicts in data"), 484 trn("There was {0} conflict during import.", 485 "There were {0} conflicts during import.", 486 conflictsCount, conflictsCount), 487 trn("Conflict in data", "Conflicts in data", conflictsCount), 483 488 JOptionPane.WARNING_MESSAGE 484 489 ); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationTask.java
r2751 r2847 19 19 import org.openstreetmap.josm.io.OsmServerObjectReader; 20 20 import org.openstreetmap.josm.io.OsmTransferException; 21 import org.openstreetmap.josm.tools.CheckParameterUtil; 21 22 import org.xml.sax.SAXException; 22 23 … … 43 44 public DownloadRelationTask(Collection<Relation> relations, OsmDataLayer layer) throws IllegalArgumentException{ 44 45 super(tr("Download relations"), false /* don't ignore exception */); 45 if (relations == null) 46 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null", "relations")); 47 if (layer == null) 48 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null", "layer")); 46 CheckParameterUtil.ensureParameterNotNull(relations, "relations"); 47 CheckParameterUtil.ensureParameterNotNull(layer, "layer"); 49 48 this.relations = relations; 50 49 this.layer = layer; -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r2711 r2847 3 3 import static org.openstreetmap.josm.gui.help.HelpUtil.ht; 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 import static org.openstreetmap.josm.tools.I18n.trn; 5 6 6 7 import java.awt.BorderLayout; … … 1087 1088 Main.parent, 1088 1089 tr("<html>This relation has been changed outside of the editor.<br>" 1089 + "You can 't apply your changes and continue editing.<br>"1090 + "You cannot apply your changes and continue editing.<br>" 1090 1091 + "<br>" 1091 1092 + "Do you want to create a conflict and close the editor?</html>"), … … 1303 1304 1304 1305 protected boolean confirmSettingEmptyRole(int onNumMembers) { 1305 String message = tr("<html>You are setting an empty role on {0} primitives.<br>" 1306 + "This is equal to deleting the roles of these primitives.<br>" 1307 + "Do you really want to apply the new role?</html>", onNumMembers); 1306 String message = "<html>" 1307 + trn("You are setting an empty role on {0} primitive.", 1308 "You are setting an empty role on {0} primitives.", onNumMembers, onNumMembers) 1309 + "<br>" 1310 + tr("This is equal to deleting the roles of these primitives.") + 1311 "<br>" 1312 + tr("Do you really want to apply the new role?") + "</html>"; 1308 1313 String [] options = new String[] { 1309 1314 tr("Yes, apply it"), 1310 tr("No, do n't apply")1315 tr("No, do not apply") 1311 1316 }; 1312 1317 int ret = ConditionalOptionPaneUtil.showOptionDialog( -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java
r2512 r2847 22 22 import org.openstreetmap.josm.io.OsmServerBackreferenceReader; 23 23 import org.openstreetmap.josm.io.OsmTransferException; 24 import org.openstreetmap.josm.tools.CheckParameterUtil; 24 25 import org.xml.sax.SAXException; 25 26 … … 74 75 public ParentRelationLoadingTask(Relation child, OsmDataLayer layer, boolean full, PleaseWaitProgressMonitor monitor ) { 75 76 super(tr("Download referring relations"), monitor, false /* don't ignore exception */); 76 if (child == null) 77 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "child")); 78 if (layer == null) 79 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer")); 80 if (child.isNew()) 81 throw new IllegalArgumentException(tr("Value of child.getId() > 0 expected. Got {1}.", child.getId())); 77 CheckParameterUtil.ensureValidPrimitiveId(child, "child"); 78 CheckParameterUtil.ensureParameterNotNull(layer, "layer"); 82 79 referrers = null; 83 80 this.layer = layer; -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationEditor.java
r2711 r2847 16 16 import org.openstreetmap.josm.gui.ExtendedDialog; 17 17 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 18 import org.openstreetmap.josm.tools.CheckParameterUtil; 18 19 19 20 public abstract class RelationEditor extends ExtendedDialog { … … 120 121 false 121 122 ); 122 if (layer == null) 123 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer")); 123 CheckParameterUtil.ensureParameterNotNull(layer, "layer"); 124 124 this.layer = layer; 125 125 setRelation(relation); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTree.java
r2578 r2847 159 159 } catch(Exception e) { 160 160 if (cancelled) { 161 System.out.println(tr("Warning: ignoring exception because task was cancelled. Exception was: " +e.toString()));161 System.out.println(tr("Warning: ignoring exception because task was cancelled. Exception was: {0}", e.toString())); 162 162 return; 163 163 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableModel.java
r2711 r2847 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.dialogs.relation; 3 import static org.openstreetmap.josm.tools.I18n.tr;4 5 3 import java.util.ArrayList; 6 4 import java.util.Collection; … … 16 14 import org.openstreetmap.josm.gui.layer.Layer; 17 15 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 16 import org.openstreetmap.josm.tools.CheckParameterUtil; 18 17 19 18 public class SelectionTableModel extends AbstractTableModel implements SelectionChangedListener, MapView.LayerChangeListener{ … … 30 29 */ 31 30 public SelectionTableModel(OsmDataLayer layer) throws IllegalArgumentException { 32 if (layer == null) 33 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer")); 31 CheckParameterUtil.ensureParameterNotNull(layer, "layer"); 34 32 this.layer = layer; 35 33 cache = new ArrayList<OsmPrimitive>();
Note:
See TracChangeset
for help on using the changeset viewer.