Changeset 1857 in josm for trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
- Timestamp:
- 2009-07-26T22:52:23+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r1843 r1857 31 31 import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor; 32 32 import org.openstreetmap.josm.data.osm.visitor.Visitor; 33 import org.openstreetmap.josm.gui.OptionPaneUtil; 33 34 import org.openstreetmap.josm.gui.PrimitiveNameFormatter; 34 35 import org.openstreetmap.josm.tools.Shortcut; … … 65 66 66 67 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 ); 68 74 return; 69 75 } … … 117 123 } 118 124 if (wayOccurenceCounter.isEmpty()) { 119 JOptionPane.showMessageDialog(Main.parent,125 OptionPaneUtil.showMessageDialog(Main.parent, 120 126 trn("The selected node is not in the middle of any way.", 121 127 "The selected nodes are not in the middle of any way.", 122 selectedNodes.size())); 128 selectedNodes.size()), 129 tr("Warning"), 130 JOptionPane.WARNING_MESSAGE); 123 131 return; 124 132 } … … 127 135 if (entry.getValue().equals(selectedNodes.size())) { 128 136 if (selectedWay != null) { 129 JOptionPane.showMessageDialog(Main.parent,137 OptionPaneUtil.showMessageDialog(Main.parent, 130 138 trn("There is more than one way using the node you selected. Please select the way also.", 131 139 "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); 133 143 return; 134 144 } … … 138 148 139 149 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); 142 154 return; 143 155 } … … 151 163 } 152 164 if (!nds.isEmpty()) { 153 JOptionPane.showMessageDialog(Main.parent,165 OptionPaneUtil.showMessageDialog(Main.parent, 154 166 trn("The selected way does not contain the selected node.", 155 167 "The selected way does not contain all the selected nodes.", 156 selectedNodes.size())); 168 selectedNodes.size()), 169 tr("Warning"), 170 JOptionPane.WARNING_MESSAGE); 157 171 return; 158 172 } … … 219 233 && !nodeSet.contains(wayChunks.get(0).get(0))) { 220 234 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); 222 240 return; 223 241 } … … 230 248 if (wayChunks.size() < 2) { 231 249 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); 233 255 } 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); 235 261 } 236 262 return; … … 321 347 } 322 348 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); 324 354 } 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); 326 360 } 327 361
Note:
See TracChangeset
for help on using the changeset viewer.