Changeset 2847 in josm for trunk


Ignore:
Timestamp:
2010-01-13T20:12:48+01:00 (14 years ago)
Author:
mjulius
Message:

fix messages for gui/dialogs

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  
    214214                        tr("Continue resolving")};
    215215                int ret = JOptionPane.showOptionDialog(Main.parent,
    216                         tr("<html>You didn''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>"
    217217                                + "Conflict resolutions won't be applied unless all differences<br>"
    218218                                + "are resolved."
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java

    r2711 r2847  
    5050import org.openstreetmap.josm.tools.Shortcut;
    5151import org.openstreetmap.josm.tools.ImageProvider.OverlayPosition;
     52import org.openstreetmap.josm.tools.CheckParameterUtil;
    5253
    5354/**
     
    8182    static public LayerListDialog getInstance() throws IllegalStateException {
    8283        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");
    8485        return instance;
    8586    }
     
    311312        public ShowHideLayerAction(Layer layer) throws IllegalArgumentException {
    312313            this();
    313             if (layer == null)
    314                 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer"));
     314            CheckParameterUtil.ensureParameterNotNull(layer, "layer");
    315315            this.layer = layer;
    316316            putValue(NAME, tr("Show/Hide"));
     
    356356        private  Layer layer;
    357357
    358         public ActivateLayerAction(Layer layer) throws IllegalArgumentException {
     358        public ActivateLayerAction(Layer layer) {
    359359            this();
    360             if (layer == null)
    361                 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer"));
     360            CheckParameterUtil.ensureParameterNotNull(layer, "layer");
    362361            this.layer = layer;
    363362            putValue(NAME, tr("Activate"));
     
    423422        public MergeAction(Layer layer) throws IllegalArgumentException {
    424423            this();
    425             if (layer == null)
    426                 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer"));
     424            CheckParameterUtil.ensureParameterNotNull(layer, "layer");
    427425            this.layer = layer;
    428426            putValue(NAME, tr("Merge"));
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManager.java

    r2824 r2847  
    516516            HelpAwareOptionPane.showOptionDialog(
    517517                    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>"
    519519                            + "your changesets from the OSM server unless you enter your OSM user name<br>"
    520520                            + "in the JOSM preferences.</html>"
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableCellRenderer.java

    r2711 r2847  
    6060    protected void renderOpen(Changeset cs) {
    6161        if (cs.isOpen()) {
    62             setText(trc("changeset.open", "Open"));
     62            setText(trc("changeset.state", "Open"));
    6363        } else {
    64             setText(trc("changeset.open", "Closed"));
     64            setText(trc("changeset.state", "Closed"));
    6565        }
    6666        setToolTipText("");
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentDownloadTask.java

    r2711 r2847  
    66import java.awt.Component;
    77import java.io.IOException;
     8import java.text.MessageFormat;
    89import java.util.ArrayList;
    910import java.util.Collection;
     
    6869        super(tr("Downloading changeset content"), false /* don't ignore exceptions */);
    6970        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));
    7172        init(Collections.singleton(changesetId));
    7273    }
     
    9495        super(parent, tr("Downloading changeset content"), false /* don't ignore exceptions */);
    9596        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));
    9798        init(Collections.singleton(changesetId));
    9899    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanel.java

    r2711 r2847  
    322322            HelpAwareOptionPane.showOptionDialog(
    323323                    ChangesetContentPanel.this,
    324                     trn("<html>The selected object isn''t available in the current<br>"
     324                    trn("<html>The selected object is not available in the current<br>"
    325325                            + "edit layer ''{0}''.</html>",
    326326                            "<html>None of the selected objects is available in the current<br>"
     
    384384            HelpAwareOptionPane.showOptionDialog(
    385385                    ChangesetContentPanel.this,
    386                     trn("<html>The selected object isn''t available in the current<br>"
     386                    trn("<html>The selected object is not available in the current<br>"
    387387                            + "edit layer ''{0}''.</html>",
    388388                            "<html>None of the selected objects is available in the current<br>"
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/SingleChangesetDownloadPanel.java

    r2711 r2847  
    139139        public void validate() {
    140140            if (!isValid()) {
    141                 feedbackInvalid(tr("The current value isn'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"));
    142142            } else {
    143143                feedbackValid(tr("Please enter an integer value > 0"));
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java

    r2822 r2847  
    525525                    query.forUser(im.getUserId());
    526526                } 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"));
    528528            } else if (rbRestrictToUid.isSelected()) {
    529529                int uid  = valUid.getUid();
     
    531531                    query.forUser(uid);
    532532                } else
    533                     throw new IllegalStateException(tr("Current value ''{0}'' for user ID isn''t valid", tfUid.getText()));
     533                    throw new IllegalStateException(tr("Current value ''{0}'' for user ID is not valid", tfUid.getText()));
    534534            } else if (rbRestrictToUserName.isSelected()) {
    535535                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()));
    537537                query.forUser(tfUserName.getText());
    538538            }
     
    835835        public void fillInQuery(ChangesetQuery query) throws IllegalStateException{
    836836            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."));
    838838            if (rbClosedAfter.isSelected()) {
    839839                GregorianCalendar cal = new GregorianCalendar();
     
    940940        public void fillInQuery(ChangesetQuery query) {
    941941            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."));
    943943            query.inBbox(getBoundingBox());
    944944        }
     
    987987                int uid = Integer.parseInt(value);
    988988                if (uid <= 0) {
    989                     feedbackInvalid(tr("The current value isn'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"));
    990990                    return;
    991991                }
    992992            } catch(NumberFormatException e) {
    993                 feedbackInvalid(tr("The current value isn'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"));
    994994                return;
    995995            }
     
    10281028            String value  = getComponent().getText();
    10291029            if (value.trim().length() == 0) {
    1030                 feedbackInvalid(tr("<html>The  current value isn'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>"));
    10311031                return;
    10321032            }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java

    r2578 r2847  
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
     5import static org.openstreetmap.josm.tools.I18n.trn;
    56
    67import java.awt.BorderLayout;
     
    4344import org.openstreetmap.josm.io.OsmServerObjectReader;
    4445import org.openstreetmap.josm.io.OsmTransferException;
     46import org.openstreetmap.josm.tools.CheckParameterUtil;
    4547import org.openstreetmap.josm.tools.ImageProvider;
    4648import org.xml.sax.SAXException;
     
    117119     */
    118120    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");
    121122        this.layer = layer;
    122123        model = new RelationTreeModel();
     
    326327                JOptionPane.showMessageDialog(
    327328                        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),
    330333                        JOptionPane.WARNING_MESSAGE
    331334                );
     
    342345            String message = tr("<html>The child relation<br>"
    343346                    + "{0}<br>"
    344                     + "is deleted on the server. It can't be loaded",
     347                    + "is deleted on the server. It cannot be loaded",
    345348                    r.getDisplayName(DefaultNameFormatter.getInstance())
    346349            );
     
    479482                JOptionPane.showMessageDialog(
    480483                        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),
    483488                        JOptionPane.WARNING_MESSAGE
    484489                );
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationTask.java

    r2751 r2847  
    1919import org.openstreetmap.josm.io.OsmServerObjectReader;
    2020import org.openstreetmap.josm.io.OsmTransferException;
     21import org.openstreetmap.josm.tools.CheckParameterUtil;
    2122import org.xml.sax.SAXException;
    2223
     
    4344    public DownloadRelationTask(Collection<Relation> relations, OsmDataLayer layer) throws IllegalArgumentException{
    4445        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");
    4948        this.relations = relations;
    5049        this.layer = layer;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java

    r2711 r2847  
    33import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    44import static org.openstreetmap.josm.tools.I18n.tr;
     5import static org.openstreetmap.josm.tools.I18n.trn;
    56
    67import java.awt.BorderLayout;
     
    10871088                    Main.parent,
    10881089                    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>"
    10901091                            + "<br>"
    10911092                            + "Do you want to create a conflict and close the editor?</html>"),
     
    13031304
    13041305        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>";
    13081313            String [] options = new String[] {
    13091314                    tr("Yes, apply it"),
    1310                     tr("No, don't apply")
     1315                    tr("No, do not apply")
    13111316            };
    13121317            int ret = ConditionalOptionPaneUtil.showOptionDialog(
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java

    r2512 r2847  
    2222import org.openstreetmap.josm.io.OsmServerBackreferenceReader;
    2323import org.openstreetmap.josm.io.OsmTransferException;
     24import org.openstreetmap.josm.tools.CheckParameterUtil;
    2425import org.xml.sax.SAXException;
    2526
     
    7475    public ParentRelationLoadingTask(Relation child, OsmDataLayer layer, boolean full, PleaseWaitProgressMonitor monitor ) {
    7576        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");
    8279        referrers = null;
    8380        this.layer = layer;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationEditor.java

    r2711 r2847  
    1616import org.openstreetmap.josm.gui.ExtendedDialog;
    1717import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     18import org.openstreetmap.josm.tools.CheckParameterUtil;
    1819
    1920public abstract class RelationEditor extends ExtendedDialog {
     
    120121                false
    121122        );
    122         if (layer == null)
    123             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer"));
     123        CheckParameterUtil.ensureParameterNotNull(layer, "layer");
    124124        this.layer = layer;
    125125        setRelation(relation);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTree.java

    r2578 r2847  
    159159            } catch(Exception e) {
    160160                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()));
    162162                    return;
    163163                }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableModel.java

    r2711 r2847  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.gui.dialogs.relation;
    3 import static org.openstreetmap.josm.tools.I18n.tr;
    4 
    53import java.util.ArrayList;
    64import java.util.Collection;
     
    1614import org.openstreetmap.josm.gui.layer.Layer;
    1715import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     16import org.openstreetmap.josm.tools.CheckParameterUtil;
    1817
    1918public class SelectionTableModel extends AbstractTableModel implements SelectionChangedListener, MapView.LayerChangeListener{
     
    3029     */
    3130    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");
    3432        this.layer = layer;
    3533        cache = new ArrayList<OsmPrimitive>();
Note: See TracChangeset for help on using the changeset viewer.