Changeset 6130 in josm for trunk/src/org/openstreetmap/josm


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)

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

Legend:

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

    r6084 r6130  
    22package org.openstreetmap.josm.actions;
    33
     4import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    45import static org.openstreetmap.josm.tools.I18n.tr;
    5 import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    66
    77import java.awt.event.ActionEvent;
     
    2525import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2626import org.openstreetmap.josm.data.osm.Way;
     27import org.openstreetmap.josm.gui.Notification;
    2728import org.openstreetmap.josm.tools.Geometry;
    2829import org.openstreetmap.josm.tools.Shortcut;
     
    138139
    139140        if (nodes.size() < 4) {
    140             JOptionPane.showMessageDialog(
    141                     Main.parent,
    142                     tr("Please select at least four nodes."),
    143                     tr("Information"),
    144                     JOptionPane.INFORMATION_MESSAGE
    145             );
     141            new Notification(
     142                    tr("Please select at least four nodes."))
     143                    .setIcon(JOptionPane.INFORMATION_MESSAGE)
     144                    .setDuration(Notification.TIME_SHORT)
     145                    .show();
    146146            return;
    147147        }
  • trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java

    r6093 r6130  
    2020import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2121import org.openstreetmap.josm.data.osm.Way;
     22import org.openstreetmap.josm.gui.Notification;
    2223import org.openstreetmap.josm.tools.Shortcut;
    2324
     
    6566
    6667    private void showWarning() {
    67         JOptionPane.showMessageDialog(
    68                 Main.parent,
    69                 tr("Please select at least three nodes."),
    70                 tr("Information"),
    71                 JOptionPane.INFORMATION_MESSAGE
    72         );
    73         return;
     68        new Notification(
     69                tr("Please select at least three nodes."))
     70                .setIcon(JOptionPane.INFORMATION_MESSAGE)
     71                .show();
    7472    }
    7573
  • trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java

    r6106 r6130  
    3434import org.openstreetmap.josm.data.preferences.BooleanProperty;
    3535import org.openstreetmap.josm.gui.ExtendedDialog;
     36import org.openstreetmap.josm.gui.Notification;
    3637import org.openstreetmap.josm.gui.conflict.tags.CombinePrimitiveResolverDialog;
    3738import org.openstreetmap.josm.gui.util.GuiHelper;
     
    6566
    6667    protected static void warnCombiningImpossible() {
    67         String msg = tr("Could not combine ways "
     68        String msg = tr("Could not combine ways<br>"
    6869                + "(They could not be merged into a single string of nodes)");
    69         JOptionPane.showMessageDialog(
    70                 Main.parent,
    71                 msg,
    72                 tr("Information"),
    73                 JOptionPane.INFORMATION_MESSAGE
    74         );
     70        new Notification(msg)
     71                .setIcon(JOptionPane.INFORMATION_MESSAGE)
     72                .show();
    7573        return;
    7674    }
     
    198196        Set<Way> selectedWays = OsmPrimitive.getFilteredSet(selection, Way.class);
    199197        if (selectedWays.size() < 2) {
    200             JOptionPane.showMessageDialog(
    201                     Main.parent,
    202                     tr("Please select at least two ways to combine."),
    203                     tr("Information"),
    204                     JOptionPane.INFORMATION_MESSAGE
    205             );
     198            new Notification(
     199                    tr("Please select at least two ways to combine."))
     200                    .setIcon(JOptionPane.INFORMATION_MESSAGE)
     201                    .setDuration(Notification.TIME_SHORT)
     202                    .show();
    206203            return;
    207204        }
  • trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java

    r6124 r6130  
    203203
    204204            if (sUnder == 0) {
    205                 JOptionPane.showMessageDialog(
    206                         Main.parent,
    207                         tr("Those nodes are not in a circle. Aborting."),
    208                         tr("Warning"),
    209                         JOptionPane.WARNING_MESSAGE
    210                 );
     205                new Notification(
     206                        tr("Those nodes are not in a circle. Aborting."))
     207                        .setIcon(JOptionPane.WARNING_MESSAGE)
     208                        .show();
    211209                return;
    212210            }
     
    264262
    265263        } else {
    266             Notification note = new Notification();
    267             note.setContent(tr("Please select exactly two or three nodes or one way with exactly two or three nodes."));
    268             note.setIcon(JOptionPane.INFORMATION_MESSAGE);
    269             note.show();
     264            new Notification(
     265                    tr("Please select exactly two or three nodes or one way with exactly two or three nodes."))
     266                    .setIcon(JOptionPane.INFORMATION_MESSAGE)
     267                    .setDuration(Notification.TIME_LONG)
     268                    .show();
    270269            return;
    271270        }
  • trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java

    r6093 r6130  
    3030import org.openstreetmap.josm.data.osm.RelationMember;
    3131import org.openstreetmap.josm.data.osm.Way;
     32import org.openstreetmap.josm.gui.Notification;
    3233import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor;
    3334import org.openstreetmap.josm.tools.Shortcut;
     
    6364    public void actionPerformed(ActionEvent e) {
    6465        if (Main.main.getEditLayer() == null) {
    65             JOptionPane.showMessageDialog(Main.parent, tr("No data loaded."));
     66            new Notification(
     67                    tr("No data loaded."))
     68                    .setIcon(JOptionPane.WARNING_MESSAGE)
     69                    .setDuration(Notification.TIME_SHORT)
     70                    .show();
    6671            return;
    6772        }
     
    7277            // Sometimes it make sense creating multipoly of only one way (so it will form outer way)
    7378            // and then splitting the way later (so there are multiple ways forming outer way)
    74             JOptionPane.showMessageDialog(Main.parent, tr("You must select at least one way."));
     79            new Notification(
     80                    tr("You must select at least one way."))
     81                    .setIcon(JOptionPane.INFORMATION_MESSAGE)
     82                    .setDuration(Notification.TIME_SHORT)
     83                    .show();
    7584            return;
    7685        }
     
    152161
    153162        if (error != null) {
    154             JOptionPane.showMessageDialog(Main.parent, error);
     163            new Notification(error)
     164                    .setIcon(JOptionPane.INFORMATION_MESSAGE)
     165                    .show();
    155166            return null;
    156167        } else {
  • trunk/src/org/openstreetmap/josm/actions/DistributeAction.java

    r6093 r6130  
    2222import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2323import org.openstreetmap.josm.data.osm.Way;
     24import org.openstreetmap.josm.gui.Notification;
    2425import org.openstreetmap.josm.tools.Shortcut;
    2526
     
    7677
    7778        if (nodes.size() < 3) {
    78             JOptionPane.showMessageDialog(
    79                     Main.parent,
    80                     tr("Please select at least three nodes."),
    81                     tr("Information"),
    82                     JOptionPane.INFORMATION_MESSAGE
    83             );
     79            new Notification(
     80                    tr("Please select at least three nodes."))
     81                    .setIcon(JOptionPane.INFORMATION_MESSAGE)
     82                    .setDuration(Notification.TIME_SHORT)
     83                    .show();
    8484            return;
    8585        }
  • trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java

    r6093 r6130  
    4242import org.openstreetmap.josm.data.osm.TagCollection;
    4343import org.openstreetmap.josm.data.osm.Way;
     44import org.openstreetmap.josm.gui.Notification;
    4445import org.openstreetmap.josm.gui.conflict.tags.CombinePrimitiveResolverDialog;
    4546import org.openstreetmap.josm.tools.Geometry;
     
    320321
    321322        if (ways.isEmpty()) {
    322             JOptionPane.showMessageDialog(Main.parent, tr("Please select at least one closed way that should be joined."));
     323            new Notification(
     324                    tr("Please select at least one closed way that should be joined."))
     325                    .setIcon(JOptionPane.INFORMATION_MESSAGE)
     326                    .show();
    323327            return;
    324328        }
     
    327331        for (Way way : ways) {
    328332            if (!way.isClosed()) {
    329                 JOptionPane.showMessageDialog(Main.parent, tr("One of the selected ways is not closed and therefore cannot be joined."));
     333                new Notification(
     334                        tr("One of the selected ways is not closed and therefore cannot be joined."))
     335                        .setIcon(JOptionPane.INFORMATION_MESSAGE)
     336                        .show();
    330337                return;
    331338            }
     
    355362
    356363        if (!testJoin(areas)) {
    357             JOptionPane.showMessageDialog(Main.parent, tr("No intersection found. Nothing was changed."));
     364            new Notification(
     365                    tr("No intersection found. Nothing was changed."))
     366                    .setIcon(JOptionPane.INFORMATION_MESSAGE)
     367                    .show();
    358368            return;
    359369        }
     
    377387                Main.map.mapView.repaint();
    378388            } else {
    379                 JOptionPane.showMessageDialog(Main.parent, tr("No intersection found. Nothing was changed."));
     389                new Notification(
     390                        tr("No intersection found. Nothing was changed."))
     391                        .setIcon(JOptionPane.INFORMATION_MESSAGE)
     392                        .show();
    380393            }
    381394        }
     
    518531
    519532        if (warnAboutRelations) {
    520             JOptionPane.showMessageDialog(Main.parent, tr("Some of the ways were part of relations that have been modified. Please verify no errors have been introduced."));
     533            new Notification(
     534                    tr("Some of the ways were part of relations that have been modified.<br>Please verify no errors have been introduced."))
     535                    .setIcon(JOptionPane.INFORMATION_MESSAGE)
     536                    .setDuration(Notification.TIME_LONG)
     537                    .show();
    521538        }
    522539
     
    12121229
    12131230            if (outerWays.size() > 1) {
    1214                 JOptionPane.showMessageDialog(Main.parent, tr("Sorry. Cannot handle multipolygon relations with multiple outer ways."));
     1231                new Notification(
     1232                        tr("Sorry. Cannot handle multipolygon relations with multiple outer ways."))
     1233                        .setIcon(JOptionPane.INFORMATION_MESSAGE)
     1234                        .show();
    12151235                return null;
    12161236            }
     
    12221242
    12231243            if (processedOuterWays.contains(outerWay)) {
    1224                 JOptionPane.showMessageDialog(Main.parent, tr("Sorry. Cannot handle way that is outer in multiple multipolygon relations."));
     1244                new Notification(
     1245                        tr("Sorry. Cannot handle way that is outer in multiple multipolygon relations."))
     1246                        .setIcon(JOptionPane.INFORMATION_MESSAGE)
     1247                        .show();
    12251248                return null;
    12261249            }
    12271250
    12281251            if (processedInnerWays.contains(outerWay)) {
    1229                 JOptionPane.showMessageDialog(Main.parent, tr("Sorry. Cannot handle way that is both inner and outer in multipolygon relations."));
     1252                new Notification(
     1253                        tr("Sorry. Cannot handle way that is both inner and outer in multipolygon relations."))
     1254                        .setIcon(JOptionPane.INFORMATION_MESSAGE)
     1255                        .show();
    12301256                return null;
    12311257            }
     
    12341260            {
    12351261                if (processedOuterWays.contains(way)) {
    1236                     JOptionPane.showMessageDialog(Main.parent, tr("Sorry. Cannot handle way that is both inner and outer in multipolygon relations."));
     1262                    new Notification(
     1263                            tr("Sorry. Cannot handle way that is both inner and outer in multipolygon relations."))
     1264                            .setIcon(JOptionPane.INFORMATION_MESSAGE)
     1265                            .show();
    12371266                    return null;
    12381267                }
    12391268
    12401269                if (processedInnerWays.contains(way)) {
    1241                     JOptionPane.showMessageDialog(Main.parent, tr("Sorry. Cannot handle way that is inner in multiple multipolygon relations."));
     1270                    new Notification(
     1271                            tr("Sorry. Cannot handle way that is inner in multiple multipolygon relations."))
     1272                            .setIcon(JOptionPane.INFORMATION_MESSAGE)
     1273                            .show();
    12421274                    return null;
    12431275                }
  • trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java

    r6084 r6130  
    3434import org.openstreetmap.josm.gui.HelpAwareOptionPane;
    3535import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
     36import org.openstreetmap.josm.gui.Notification;
    3637import org.openstreetmap.josm.gui.conflict.tags.CombinePrimitiveResolverDialog;
    3738import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     
    6869            List<Node> nearestNodes = Main.map.mapView.getNearestNodes(Main.map.mapView.getPoint(selectedNodes.get(0)), selectedNodes, OsmPrimitive.isUsablePredicate);
    6970            if (nearestNodes.isEmpty()) {
    70                 JOptionPane.showMessageDialog(
    71                         Main.parent,
    72                         tr("Please select at least two nodes to merge or a node that is close to another node."),
    73                         tr("Warning"),
    74                         JOptionPane.WARNING_MESSAGE
    75                 );
    76 
     71                new Notification(
     72                        tr("Please select at least two nodes to merge or one node that is close to another node."))
     73                        .setIcon(JOptionPane.WARNING_MESSAGE)
     74                        .show();
    7775                return;
    7876            }
  • trunk/src/org/openstreetmap/josm/actions/MirrorAction.java

    r6093 r6130  
    22package org.openstreetmap.josm.actions;
    33
     4import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    45import static org.openstreetmap.josm.tools.I18n.tr;
    5 import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    66
    77import java.awt.event.ActionEvent;
     
    2020import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2121import org.openstreetmap.josm.data.osm.Way;
     22import org.openstreetmap.josm.gui.Notification;
    2223import org.openstreetmap.josm.tools.Shortcut;
    2324
     
    5253
    5354        if (nodes.isEmpty()) {
    54             JOptionPane.showMessageDialog(
    55                     Main.parent,
    56                     tr("Please select at least one node or way."),
    57                     tr("Information"),
    58                     JOptionPane.INFORMATION_MESSAGE
    59             );
     55            new Notification(
     56                    tr("Please select at least one node or way."))
     57                    .setIcon(JOptionPane.INFORMATION_MESSAGE)
     58                    .setDuration(Notification.TIME_SHORT)
     59                    .show();
    6060            return;
    6161        }
  • trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java

    r6093 r6130  
    3030import org.openstreetmap.josm.data.osm.Way;
    3131import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil;
     32import org.openstreetmap.josm.gui.Notification;
    3233import org.openstreetmap.josm.tools.Shortcut;
    3334
     
    114115            }
    115116            catch (InvalidUserInputException ex) {
    116                 JOptionPane.showMessageDialog(
    117                         Main.parent,
    118                         tr("Orthogonalize Shape / Undo\n"+
    119                         "Please select nodes that were moved by the previous Orthogonalize Shape action!"),
    120                         tr("Undo Orthogonalize Shape"),
    121                         JOptionPane.INFORMATION_MESSAGE);
     117                new Notification(
     118                        tr("Orthogonalize Shape / Undo<br>"+
     119                        "Please select nodes that were moved by the previous Orthogonalize Shape action!"))
     120                        .setIcon(JOptionPane.INFORMATION_MESSAGE)
     121                        .show();
    122122            }
    123123        }
     
    184184            }
    185185        } catch (InvalidUserInputException ex) {
     186            String msg;
    186187            if (ex.getMessage().equals("usage")) {
    187                 ConditionalOptionPaneUtil.showMessageDialog("orthogonalize_usage",
    188                         Main.parent,
    189                         "<html><h2>" + tr("Usage") + "</h2>" + USAGE + "</html>",
    190                         tr("Orthogonalize Shape"),
    191                         JOptionPane.INFORMATION_MESSAGE);
    192             }
    193             else {
    194                 ConditionalOptionPaneUtil.showMessageDialog("orthogonalize_error",
    195                         Main.parent,
    196                         "<html>" + ex.getMessage() + "<br><hr><h2>" + tr("Usage") + "</h2>" + USAGE + "</html>",
    197                         tr("Selected Elements cannot be orthogonalized"),
    198                         JOptionPane.INFORMATION_MESSAGE);
    199             }
     188                msg = "<h2>" + tr("Usage") + "</h2>" + USAGE;
     189            } else {
     190                msg = ex.getMessage() + "<br><hr><h2>" + tr("Usage") + "</h2>" + USAGE;
     191            }
     192            new Notification(msg)
     193                    .setIcon(JOptionPane.INFORMATION_MESSAGE)
     194                    .setDuration(Notification.TIME_VERY_LONG)
     195                    .show();
    200196        }
    201197    }
  • trunk/src/org/openstreetmap/josm/actions/ReverseWayAction.java

    r6084 r6130  
    2525import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2626import org.openstreetmap.josm.data.osm.Way;
     27import org.openstreetmap.josm.gui.Notification;
    2728import org.openstreetmap.josm.tools.Shortcut;
    2829import org.openstreetmap.josm.tools.Utils;
     
    8081        final Collection<Way> sel = getCurrentDataSet().getSelectedWays();
    8182        if (sel.isEmpty()) {
    82             JOptionPane.showMessageDialog(
    83                     Main.parent,
    84                     tr("Please select at least one way."),
    85                     tr("Information"),
    86                     JOptionPane.INFORMATION_MESSAGE
    87             );
     83            new Notification(
     84                    tr("Please select at least one way."))
     85                    .setIcon(JOptionPane.INFORMATION_MESSAGE)
     86                    .setDuration(Notification.TIME_SHORT)
     87                    .show();
    8888            return;
    8989        }
  • 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
  • trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java

    r5909 r6130  
    3030import org.openstreetmap.josm.data.osm.Way;
    3131import org.openstreetmap.josm.gui.MapView;
     32import org.openstreetmap.josm.gui.Notification;
    3233import org.openstreetmap.josm.tools.Shortcut;
    3334
     
    4142 * If a single node is selected, it will copy that node and remove all tags from the old one
    4243 */
    43 
    4444public class UnGlueAction extends JosmAction {
    4545
     
    6868
    6969        String errMsg = null;
     70        int errorTime = Notification.TIME_DEFAULT;
    7071        if (checkSelection(selection)) {
    7172            if (!checkAndConfirmOutlyingUnglue()) {
     
    8586                    unglueNode(e);
    8687                } else {
     88                    errorTime = Notification.TIME_SHORT;
    8789                    errMsg = tr("This node is not glued to anything else.");
    8890                }
     
    120122            }
    121123        } else {
     124            errorTime = Notification.TIME_VERY_LONG;
    122125            errMsg =
    123126                tr("The current selection cannot be used for unglueing.")+"\n"+
     
    136139
    137140        if(errMsg != null) {
    138             JOptionPane.showMessageDialog(
    139                     Main.parent,
    140                     errMsg,
    141                     tr("Error"),
    142                     JOptionPane.ERROR_MESSAGE);
     141            new Notification(
     142                    errMsg)
     143                    .setIcon(JOptionPane.ERROR_MESSAGE)
     144                    .setDuration(errorTime)
     145                    .show();
    143146        }
    144147
     
    149152
    150153    /**
    151      * Assumes there is one tagged Node stored in selectedNode that it will try to unglue
    152      * (= copy node and remove all tags from the old one. Relations will not be removed)
     154     * Assumes there is one tagged Node stored in selectedNode that it will try to unglue.
     155     * (i.e. copy node and remove all tags from the old one. Relations will not be removed)
    153156     */
    154157    private void unglueNode(ActionEvent e) {
  • trunk/src/org/openstreetmap/josm/gui/MainMenu.java

    r6129 r6130  
    175175    public final JosmAction combineWay = new CombineWayAction();
    176176    public final JosmAction reverseWay = new ReverseWayAction();
     177    public final JosmAction simplifyWay = new SimplifyWayAction();
    177178    public final JosmAction alignInCircle = new AlignInCircleAction();
    178179    public final JosmAction alignInLine = new AlignInLineAction();
     
    181182    public final JosmAction orthoUndo = new Undo();  // action is not shown in the menu. Only triggered by shortcut
    182183    public final JosmAction mirror = new MirrorAction();
     184    public final JosmAction followLine = new FollowLineAction();
    183185    public final AddNodeAction addnode = new AddNodeAction();
    184186    public final MoveNodeAction movenode = new MoveNodeAction();
     
    187189    public final JosmAction joinNodeWay = new JoinNodeWayAction();
    188190    public final JosmAction unglueNodes = new UnGlueAction();
    189     public final JosmAction simplifyWay = new SimplifyWayAction();
    190191    public final JosmAction joinAreas = new JoinAreasAction();
    191192    public final JosmAction createMultipolygon = new CreateMultipolygonAction();
    192     public final JosmAction followLine = new FollowLineAction();
    193193
    194194    /* Audio menu */
  • trunk/src/org/openstreetmap/josm/gui/Notification.java

    r6124 r6130  
    77import javax.swing.JOptionPane;
    88import javax.swing.UIManager;
     9
     10import org.openstreetmap.josm.Main;
    911
    1012/**
     
    2830
    2931    public final static int DEFAULT_CONTENT_WIDTH = 350;
     32
     33    // some standard duration values (in milliseconds)
     34
     35    /**
     36     * Very short and very easy to grasp message (3 s).
     37     * E.g. "Please select at least one node".
     38     */
     39    public final static int TIME_SHORT = Main.pref.getInteger("notification-time-short-ms", 3000);
     40    /**
     41     * Short message of one or two lines (5 s).
     42     */
     43    public final static int TIME_DEFAULT = Main.pref.getInteger("notification-time-default-ms", 5000);
     44    /**
     45     * Somewhat longer message (10 s).
     46     */
     47    public final static int TIME_LONG = Main.pref.getInteger("notification-time-long-ms", 10000);
     48    /**
     49     * Long text.
     50     * (Make sure is still sensible to show as a notification)
     51     */
     52    public final static int TIME_VERY_LONG = Main.pref.getInteger("notification-time-very_long-ms", 20000);
    3053
    3154    private Icon icon;
Note: See TracChangeset for help on using the changeset viewer.