Ignore:
Timestamp:
2013-08-10T12:06:25+02:00 (11 years ago)
Author:
bastiK
Message:

see #6963 - converted popups to notifications for all actions in the Tools menu (TODO: Simplify Way)

File:
1 edited

Legend:

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

    r6084 r6130  
    3232import org.openstreetmap.josm.data.osm.Way;
    3333import org.openstreetmap.josm.gui.DefaultNameFormatter;
     34import org.openstreetmap.josm.gui.Notification;
    3435import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    3536import org.openstreetmap.josm.tools.CheckParameterUtil;
     
    128129
    129130        if (applicableWays == null) {
    130             JOptionPane.showMessageDialog(
    131                     Main.parent,
    132                     tr("The current selection cannot be used for splitting - no node is selected."),
    133                     tr("Warning"),
    134                     JOptionPane.WARNING_MESSAGE);
     131            new Notification(
     132                    tr("The current selection cannot be used for splitting - no node is selected."))
     133                    .setIcon(JOptionPane.WARNING_MESSAGE)
     134                    .show();
    135135            return;
    136136        } else if (applicableWays.isEmpty()) {
    137             JOptionPane.showMessageDialog(Main.parent,
    138                     tr("The selected nodes do not share the same way."),
    139                     tr("Warning"),
    140                     JOptionPane.WARNING_MESSAGE);
     137            new Notification(
     138                    tr("The selected nodes do not share the same way."))
     139                    .setIcon(JOptionPane.WARNING_MESSAGE)
     140                    .show();
    141141            return;
    142142        }
     
    157157
    158158        if (applicableWays.isEmpty()) {
    159             JOptionPane.showMessageDialog(Main.parent,
     159            new Notification(
    160160                    trn("The selected node is not in the middle of any way.",
    161                             "The selected nodes are not in the middle of any way.",
    162                             selectedNodes.size()),
    163                             tr("Warning"),
    164                             JOptionPane.WARNING_MESSAGE);
     161                        "The selected nodes are not in the middle of any way.",
     162                        selectedNodes.size()))
     163                    .setIcon(JOptionPane.WARNING_MESSAGE)
     164                    .show();
    165165            return;
    166166        } else if (applicableWays.size() > 1) {
    167             JOptionPane.showMessageDialog(Main.parent,
     167            new Notification(
    168168                    trn("There is more than one way using the node you selected. Please select the way also.",
    169                             "There is more than one way using the nodes you selected. Please select the way also.",
    170                             selectedNodes.size()),
    171                             tr("Warning"),
    172                             JOptionPane.WARNING_MESSAGE);
     169                        "There is more than one way using the nodes you selected. Please select the way also.",
     170                        selectedNodes.size()))
     171                    .setIcon(JOptionPane.WARNING_MESSAGE)
     172                    .show();
    173173            return;
    174174        }
     
    290290                && !nodeSet.contains(wayChunks.get(0).get(0))) {
    291291            if (wayChunks.size() == 2) {
    292                 JOptionPane.showMessageDialog(
    293                         Main.parent,
    294                         tr("You must select two or more nodes to split a circular way."),
    295                         tr("Warning"),
    296                         JOptionPane.WARNING_MESSAGE);
     292                new Notification(
     293                        tr("You must select two or more nodes to split a circular way."))
     294                        .setIcon(JOptionPane.WARNING_MESSAGE)
     295                        .show();
    297296                return null;
    298297            }
     
    305304        if (wayChunks.size() < 2) {
    306305            if (wayChunks.get(0).get(0) == wayChunks.get(0).get(wayChunks.get(0).size() - 1)) {
    307                 JOptionPane.showMessageDialog(
    308                         Main.parent,
    309                         tr("You must select two or more nodes to split a circular way."),
    310                         tr("Warning"),
    311                         JOptionPane.WARNING_MESSAGE);
     306                new Notification(
     307                        tr("You must select two or more nodes to split a circular way."))
     308                        .setIcon(JOptionPane.WARNING_MESSAGE)
     309                        .show();
    312310            } else {
    313                 JOptionPane.showMessageDialog(
    314                         Main.parent,
    315                         tr("The way cannot be split at the selected nodes. (Hint: Select nodes in the middle of the way.)"),
    316                         tr("Warning"),
    317                         JOptionPane.WARNING_MESSAGE);
     311                new Notification(
     312                        tr("The way cannot be split at the selected nodes. (Hint: Select nodes in the middle of the way.)"))
     313                        .setIcon(JOptionPane.WARNING_MESSAGE)
     314                        .show();
    318315            }
    319316            return null;
     
    495492        }
    496493        if (warnmerole) {
    497             JOptionPane.showMessageDialog(
    498                     Main.parent,
    499                     tr("<html>A role based relation membership was copied to all new ways.<br>You should verify this and correct it when necessary.</html>"),
    500                     tr("Warning"),
    501                     JOptionPane.WARNING_MESSAGE);
     494            new Notification(
     495                    tr("A role based relation membership was copied to all new ways.<br>You should verify this and correct it when necessary."))
     496                    .setIcon(JOptionPane.WARNING_MESSAGE)
     497                    .show();
    502498        } else if (warnme) {
    503             JOptionPane.showMessageDialog(
    504                     Main.parent,
    505                     tr("<html>A relation membership was copied to all new ways.<br>You should verify this and correct it when necessary.</html>"),
    506                     tr("Warning"),
    507                     JOptionPane.WARNING_MESSAGE);
     499            new Notification(
     500                    tr("A relation membership was copied to all new ways.<br>You should verify this and correct it when necessary."))
     501                    .setIcon(JOptionPane.WARNING_MESSAGE)
     502                    .show();
    508503        }
    509504
Note: See TracChangeset for help on using the changeset viewer.