Changeset 2032 in josm


Ignore:
Timestamp:
2009-09-03T09:29:22+02:00 (15 years ago)
Author:
stoecker
Message:

fix #3377 - patch by xeen - removed deprecated calls

Location:
trunk/src/org/openstreetmap/josm
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AbstractMergeAction.java

    r2017 r2032  
    6666        layerList.setModel(new DefaultComboBoxModel(targetLayers.toArray()));
    6767        layerList.setSelectedIndex(0);
    68    
     68
    6969        JPanel pnl = new JPanel();
    7070        pnl.setLayout(new GridBagLayout());
    7171        pnl.add(new JLabel(tr("Please select the target layer.")), GBC.eol());
    7272        pnl.add(layerList, GBC.eol());
    73    
    74         int decision = new ExtendedDialog(Main.parent, tr("Select target layer"), pnl, new String[] { tr("Merge"),
    75             tr("Cancel") }, new String[] { "dialogs/mergedown", "cancel" }).getValue();
    76         if (decision != 1)
     73
     74        ExtendedDialog ed = new ExtendedDialog(Main.parent,
     75                tr("Select target layer"),
     76                new String[] { tr("Merge"), tr("Cancel") });
     77        ed.setButtonIcons(new String[] { "dialogs/mergedown", "cancel" });
     78        ed.setContent(pnl);
     79        ed.showDialog();
     80        if (ed.getValue() != 1)
    7781            return null;
     82
    7883        Layer targetLayer = (Layer) layerList.getSelectedItem();
    7984        return targetLayer;
  • trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java

    r2025 r2032  
    118118        for (HashSet<Way> waylinks : backlinks.values()) {
    119119            if (!waylinks.containsAll(selectedWays)) {
    120                 int option = new ExtendedDialog(Main.parent,
     120
     121                ExtendedDialog ed = new ExtendedDialog(Main.parent,
    121122                        tr("Combine ways with different memberships?"),
    122                         tr("The selected ways have differing relation memberships.  "
    123                                 + "Do you still want to combine them?"),
    124                                 new String[] {tr("Combine Anyway"), tr("Cancel")},
    125                                 new String[] {"combineway.png", "cancel.png"}).getValue();
    126                 if (option == 1) {
     123                        new String[] {tr("Combine Anyway"), tr("Cancel")});
     124                ed.setButtonIcons(new String[] {"combineway.png", "cancel.png"});
     125                ed.setContent(tr("The selected ways have differing relation memberships.  "
     126                        + "Do you still want to combine them?"));
     127                ed.showDialog();
     128
     129                if (ed.getValue() == 1) {
    127130                    break;
    128131                }
     
    150153            Object secondTry = actuallyCombineWays(selectedWays, true);
    151154            if (secondTry instanceof List<?>) {
    152                 int option = new ExtendedDialog(Main.parent,
     155                ExtendedDialog ed = new ExtendedDialog(Main.parent,
    153156                        tr("Change directions?"),
    154                         tr("The ways can not be combined in their current directions.  "
    155                                 + "Do you want to reverse some of them?"),
    156                                 new String[] {tr("Reverse and Combine"), tr("Cancel")},
    157                                 new String[] {"wayflip.png", "cancel.png"}).getValue();
    158                 if (option != 1) return;
     157                        new String[] {tr("Reverse and Combine"), tr("Cancel")});
     158                ed.setButtonIcons(new String[] {"wayflip.png", "cancel.png"});
     159                ed.setContent(tr("The ways can not be combined in their current directions.  "
     160                        + "Do you want to reverse some of them?"));
     161                ed.showDialog();
     162                if (ed.getValue() != 1) return;
     163
    159164                nodeList = (List<Node>) secondTry;
    160165            } else {
     
    205210
    206211        if (!components.isEmpty()) {
    207             int answer = new ExtendedDialog(Main.parent,
     212
     213            ExtendedDialog ed = new ExtendedDialog(Main.parent,
    208214                    tr("Enter values for all conflicts."),
    209                     p,
    210                     new String[] {tr("Solve Conflicts"), tr("Cancel")},
    211                     new String[] {"dialogs/conflict.png", "cancel.png"}).getValue();
    212             if (answer != 1) return;
     215                    new String[] {tr("Solve Conflicts"), tr("Cancel")});
     216            ed.setButtonIcons(new String[] {"dialogs/conflict.png", "cancel.png"});
     217            ed.setContent(p);
     218            ed.showDialog();
     219
     220            if (ed.getValue() != 1) return;
    213221
    214222            for (Entry<String, JComboBox> e : components.entrySet()) {
  • trunk/src/org/openstreetmap/josm/gui/ConditionalOptionPaneUtil.java

    r2017 r2032  
    2727 *
    2828 */
    29 public class ConditionalOptionPaneUtil {
     29@Deprecated public class ConditionalOptionPaneUtil {
    3030    static public final int DIALOG_DISABLED_OPTION = Integer.MIN_VALUE;
    3131
  • trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java

    r2027 r2032  
    636636        }
    637637
    638         LinkedList<TaggingPreset> p = new LinkedList<TaggingPreset>();
    639638        presets.removeAll();
    640639        int total = nodes+ways+relations+closedways;
     
    831830        protected void deleteFromRelation(int row) {
    832831            Relation cur = (Relation)membershipData.getValueAt(row, 0);
    833             int result = new ExtendedDialog(Main.parent,
     832
     833            ExtendedDialog ed = new ExtendedDialog(Main.parent,
    834834                    tr("Change relation"),
    835                     tr("Really delete selection from relation {0}?", cur.getDisplayName(DefaultNameFormatter.getInstance())),
    836                     new String[] {tr("Delete from relation"), tr("Cancel")},
    837                     new String[] {"dialogs/delete.png", "cancel.png"}).getValue();
    838 
    839             if(result != 1)
     835                    new String[] {tr("Delete from relation"), tr("Cancel")});
     836            ed.setButtonIcons(new String[] {"dialogs/delete.png", "cancel.png"});
     837            ed.setContent(tr("Really delete selection from relation {0}?", cur.getDisplayName(DefaultNameFormatter.getInstance())));
     838            ed.showDialog();
     839
     840            if(ed.getValue() != 1)
    840841                return;
    841842
  • trunk/src/org/openstreetmap/josm/io/GpxExporter.java

    r2017 r2032  
    112112        p.add(keywords, GBC.eop().fill(GBC.HORIZONTAL));
    113113
    114         int answer = new ExtendedDialog(Main.parent, tr("Export options"), p, new String[] { tr("Export and Save"),
    115             tr("Cancel") }, new String[] { "exportgpx.png", "cancel.png" }).getValue();
    116         if (answer != 1)
     114        ExtendedDialog ed = new ExtendedDialog(Main.parent,
     115                tr("Export options"),
     116                new String[] { tr("Export and Save"), tr("Cancel") });
     117        ed.setButtonIcons(new String[] { "exportgpx.png", "cancel.png" });
     118        ed.setContent(p);
     119        ed.showDialog();
     120
     121        if (ed.getValue() != 1)
    117122            return;
    118123
  • trunk/src/org/openstreetmap/josm/plugins/PluginSelection.java

    r2017 r2032  
    9797            done = true;
    9898        } else {
    99             int answer = new ExtendedDialog(Main.parent,
     99            ExtendedDialog ed = new ExtendedDialog(Main.parent,
    100100                    tr("Update"),
    101                     tr("Update the following plugins:\n\n{0}", toUpdateStr.toString()),
    102                     new String[] {tr("Update Plugins"), tr("Cancel")},
    103                     new String[] {"dialogs/refresh.png", "cancel.png"}).getValue();
    104             if (answer == 1) {
     101                    new String[] {tr("Update Plugins"), tr("Cancel")});
     102            ed.setButtonIcons(new String[] {"dialogs/refresh.png", "cancel.png"});
     103            ed.setContent(tr("Update the following plugins:\n\n{0}", toUpdateStr.toString()));
     104            ed.showDialog();
     105
     106            if (ed.getValue() == 1) {
    105107                PluginDownloader.update(toUpdate);
    106108                done = true;
     
    133135        }
    134136        if (!toDownload.isEmpty()) {
    135             int answer = new ExtendedDialog(Main.parent,
     137            ExtendedDialog ed = new ExtendedDialog(Main.parent,
    136138                    tr("Download missing plugins"),
    137                     tr("Download the following plugins?\n\n{0}", msg),
    138                     new String[] {tr("Download Plugins"), tr("Cancel")},
    139                     new String[] {"download.png", "cancel.png"}).getValue();
     139                    new String[] {tr("Download Plugins"), tr("Cancel")});
     140            ed.setButtonIcons(new String[] {"download.png", "cancel.png"});
     141            ed.setContent(tr("Download the following plugins?\n\n{0}", msg));
     142            ed.showDialog();
     143
    140144            Collection<PluginInformation> error =
    141                 (answer != 1 ? toDownload : new PluginDownloader().download(toDownload));
     145                (ed.getValue() != 1 ? toDownload : new PluginDownloader().download(toDownload));
    142146            for (PluginInformation pd : error) {
    143147                pluginMap.put(pd.name, false);
     
    330334                                    name = x[0];
    331335                                    url = x[1];
    332                                     manifest = null;
     336                                    // Is null anyway
     337                                    //manifest = null;
    333338                                }
    334339                            }
Note: See TracChangeset for help on using the changeset viewer.