Ignore:
Timestamp:
2010-08-28T22:44:50+02:00 (14 years ago)
Author:
tilusnet
Message:
  • Adapted AlignWays to the recently changed editable layer removing mechanism in JOSM which caused AlignWays to fail cleanup on JOSM exit while in active AlignWays mode
  • Tips dialog shows now a consistent action shortcut
Location:
applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysAction.java

    r22758 r22842  
    7878                if (!c.areSegsAlignable()) {
    7979                        JOptionPane.showMessageDialog(Main.parent,
    80                                         tr("Please select two segments that don''t share any nodes or put the pivot on their common node.\n" +
    81                                         "Your action is being igonred."),
    82                                         tr("AlignWayS: Alignment not possible"), JOptionPane.WARNING_MESSAGE);
     80                                        tr("Please select two segments that don''t share any nodes\n"
     81                                                        + " or put the pivot on their common node.\n"),
     82                                                        tr("AlignWayS: Alignment not possible"), JOptionPane.WARNING_MESSAGE);
    8383                        return false;
    8484                }
     
    9090                                (c).undoCommand();
    9191                                JOptionPane.showMessageDialog(Main.parent,
    92                                                 tr("Aligning would result nodes outside the world.\n" +
    93                                                 "Your action is being ignored."),
    94                                                 tr("AlignWayS: Alignment denied"), JOptionPane.WARNING_MESSAGE);
     92                                                tr("Aligning would result nodes outside the world.\n"),
     93                                                tr("AlignWayS: Alignment not possible"), JOptionPane.WARNING_MESSAGE);
    9594                                return false;
    9695                        }
  • applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysMode.java

    r21613 r22842  
    6262        public void exitMode() {
    6363                super.exitMode();
     64                setCurrentState(noneSelected);
    6465                Main.map.mapView.removeMouseListener(this);
    65                 setCurrentState(noneSelected);
    6666                AlignWaysPlugin.getAwAction().setEnabled(false);
    6767        }
     
    119119                if (currentState == noneSelected) {
    120120                        awSegs.cleanupWays();
    121                         getCurrentDataSet().clearSelection();
     121                        // FIX: getCurrentDataSet may return null when the editable layer had
     122                        // already been removed by JOSM. This happens e.g. when the user closes
     123                        // JOSM while AlignWays mode is still active.
     124                        if (getCurrentDataSet() != null) {
     125                                getCurrentDataSet().clearSelection();
     126                        }
    122127                }
    123128        }
  • applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysTipsPanel.java

    r21613 r22842  
    9696
    9797                step04.setIcon(new ImageIcon(getClass().getResource("/images/tipsdialog/hlpAlgCmd.png"))); // NOI18N
    98                 step04.setText(tr("<html>\n<div style=\"font-family:sans-serif\">\n<ul>\n  <li><b>Align the segments.</b> Press <b><i><span style=\"color:green\">Shift-A</span></i></b>. Alternatively you''ll find the command in the <b>Tools</b>\n menu or may want to place the action on the <b>toolbar</b>.\n  </li>\n</ul>\n</div>\n</html>\n\n"));
     98                step04.setText(tr("<html>\n<div style=\"font-family:sans-serif\">\n<ul>\n  <li><b>Align the segments.</b> Press <b><i><span style=\"color:green\">"
     99                                + AlignWaysPlugin.awAction.getShortcut().getKeyText()
     100                                + "</span></i></b>. Alternatively you''ll find the command in the <b>Tools</b>\n menu or may want to place the action on the <b>toolbar</b>.\n  </li>\n</ul>\n</div>\n</html>\n\n"));
    99101                step04.setVerticalAlignment(SwingConstants.TOP);
    100102
Note: See TracChangeset for help on using the changeset viewer.