Ignore:
Timestamp:
2009-07-26T22:52:23+02:00 (15 years ago)
Author:
Gubaer
Message:

replaced JOptionDialog.show... by OptionPaneUtil.show....
improved relation editor

File:
1 edited

Legend:

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

    r1843 r1857  
    3131import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor;
    3232import org.openstreetmap.josm.data.osm.visitor.Visitor;
     33import org.openstreetmap.josm.gui.OptionPaneUtil;
    3334import org.openstreetmap.josm.gui.PrimitiveNameFormatter;
    3435import org.openstreetmap.josm.tools.Shortcut;
     
    6566
    6667        if (!checkSelection(selection)) {
    67             JOptionPane.showMessageDialog(Main.parent, tr("The current selection cannot be used for splitting."));
     68            OptionPaneUtil.showMessageDialog(
     69                    Main.parent,
     70                    tr("The current selection cannot be used for splitting."),
     71                    tr("Warning"),
     72                    JOptionPane.WARNING_MESSAGE
     73            );
    6874            return;
    6975        }
     
    117123            }
    118124            if (wayOccurenceCounter.isEmpty()) {
    119                 JOptionPane.showMessageDialog(Main.parent,
     125                OptionPaneUtil.showMessageDialog(Main.parent,
    120126                        trn("The selected node is not in the middle of any way.",
    121127                                "The selected nodes are not in the middle of any way.",
    122                                 selectedNodes.size()));
     128                                selectedNodes.size()),
     129                                tr("Warning"),
     130                                JOptionPane.WARNING_MESSAGE);
    123131                return;
    124132            }
     
    127135                if (entry.getValue().equals(selectedNodes.size())) {
    128136                    if (selectedWay != null) {
    129                         JOptionPane.showMessageDialog(Main.parent,
     137                        OptionPaneUtil.showMessageDialog(Main.parent,
    130138                                trn("There is more than one way using the node you selected. Please select the way also.",
    131139                                        "There is more than one way using the nodes you selected. Please select the way also.",
    132                                         selectedNodes.size()));
     140                                        selectedNodes.size()),
     141                                        tr("Warning"),
     142                                        JOptionPane.WARNING_MESSAGE);
    133143                        return;
    134144                    }
     
    138148
    139149            if (selectedWay == null) {
    140                 JOptionPane.showMessageDialog(Main.parent,
    141                         tr("The selected nodes do not share the same way."));
     150                OptionPaneUtil.showMessageDialog(Main.parent,
     151                        tr("The selected nodes do not share the same way."),
     152                        tr("Warning"),
     153                        JOptionPane.WARNING_MESSAGE);
    142154                return;
    143155            }
     
    151163            }
    152164            if (!nds.isEmpty()) {
    153                 JOptionPane.showMessageDialog(Main.parent,
     165                OptionPaneUtil.showMessageDialog(Main.parent,
    154166                        trn("The selected way does not contain the selected node.",
    155167                                "The selected way does not contain all the selected nodes.",
    156                                 selectedNodes.size()));
     168                                selectedNodes.size()),
     169                                tr("Warning"),
     170                                JOptionPane.WARNING_MESSAGE);
    157171                return;
    158172            }
     
    219233                && !nodeSet.contains(wayChunks.get(0).get(0))) {
    220234            if (wayChunks.size() == 2) {
    221                 JOptionPane.showMessageDialog(Main.parent, tr("You must select two or more nodes to split a circular way."));
     235                OptionPaneUtil.showMessageDialog(
     236                        Main.parent,
     237                        tr("You must select two or more nodes to split a circular way."),
     238                        tr("Warning"),
     239                        JOptionPane.WARNING_MESSAGE);
    222240                return;
    223241            }
     
    230248        if (wayChunks.size() < 2) {
    231249            if(wayChunks.get(0).get(0) == wayChunks.get(0).get(wayChunks.get(0).size()-1)) {
    232                 JOptionPane.showMessageDialog(Main.parent, tr("You must select two or more nodes to split a circular way."));
     250                OptionPaneUtil.showMessageDialog(
     251                        Main.parent,
     252                        tr("You must select two or more nodes to split a circular way."),
     253                        tr("Warning"),
     254                        JOptionPane.WARNING_MESSAGE);
    233255            } else {
    234                 JOptionPane.showMessageDialog(Main.parent, tr("The way cannot be split at the selected nodes. (Hint: Select nodes in the middle of the way.)"));
     256                OptionPaneUtil.showMessageDialog(
     257                        Main.parent,
     258                        tr("The way cannot be split at the selected nodes. (Hint: Select nodes in the middle of the way.)"),
     259                        tr("Warning"),
     260                        JOptionPane.WARNING_MESSAGE);
    235261            }
    236262            return;
     
    321347        }
    322348        if(warnmerole) {
    323             JOptionPane.showMessageDialog(Main.parent, tr("A role based relation membership was copied to all new ways.\nYou should verify this and correct it when necessary."));
     349            OptionPaneUtil.showMessageDialog(
     350                    Main.parent,
     351                    tr("<html>A role based relation membership was copied to all new ways.<br>You should verify this and correct it when necessary.</html>"),
     352                    tr("Warning"),
     353                    JOptionPane.WARNING_MESSAGE);
    324354        } else if(warnme) {
    325             JOptionPane.showMessageDialog(Main.parent, tr("A relation membership was copied to all new ways.\nYou should verify this and correct it when necessary."));
     355            OptionPaneUtil.showMessageDialog(
     356                    Main.parent,
     357                    tr("<html>A relation membership was copied to all new ways.<br>You should verify this and correct it when necessary.</html>"),
     358                    tr("Warning"),
     359                    JOptionPane.WARNING_MESSAGE);
    326360        }
    327361
Note: See TracChangeset for help on using the changeset viewer.