Changeset 1857 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2009-07-26T22:52:23+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/GpxExportAction.java
r1847 r1857 231 231 } catch (IOException x) { 232 232 x.printStackTrace(); 233 JOptionPane.showMessageDialog(Main.parent, tr("Error while exporting {0}:\n{1}", fn,x.getMessage()), tr("Error"), JOptionPane.ERROR_MESSAGE); 233 OptionPaneUtil.showMessageDialog( 234 Main.parent, 235 tr("Error while exporting {0}:\n{1}", fn,x.getMessage()), 236 tr("Error"), 237 JOptionPane.ERROR_MESSAGE 238 ); 234 239 } 235 240 } … … 285 290 l.setVisibleRowCount(4); 286 291 l.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); 287 int answer = JOptionPane.showConfirmDialog(Main.parent, new JScrollPane(l),tr("Choose a predefined license"), JOptionPane.OK_CANCEL_OPTION); 292 int answer = OptionPaneUtil.showConfirmationDialog( 293 Main.parent, 294 new JScrollPane(l), 295 tr("Choose a predefined license"), 296 JOptionPane.OK_CANCEL_OPTION, 297 JOptionPane.QUESTION_MESSAGE 298 ); 288 299 if (answer != JOptionPane.OK_OPTION || l.getSelectedIndex() == -1) 289 300 return; -
trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
r1847 r1857 37 37 import org.openstreetmap.josm.data.osm.visitor.CollectBackReferencesVisitor; 38 38 import org.openstreetmap.josm.gui.ExtendedDialog; 39 import org.openstreetmap.josm.gui.OptionPaneUtil; 39 40 import org.openstreetmap.josm.tools.GBC; 40 41 import org.openstreetmap.josm.tools.Pair; … … 72 73 73 74 if (selectedNodes.size() < 2) { 74 JOptionPane.showMessageDialog(75 OptionPaneUtil.showMessageDialog( 75 76 Main.parent, 76 77 tr("Please select at least two nodes to merge."), … … 249 250 w.visit(backRefs); 250 251 if (!backRefs.data.isEmpty()) { 251 JOptionPane.showMessageDialog(Main.parent, 252 OptionPaneUtil.showMessageDialog( 253 Main.parent, 252 254 tr("Cannot merge nodes: " + 253 "Would have to delete a way that is still used.")); 255 "Would have to delete a way that is still used."), 256 tr("Warning"), 257 JOptionPane.WARNING_MESSAGE 258 ); 254 259 return null; 255 260 } -
trunk/src/org/openstreetmap/josm/actions/MirrorAction.java
r1847 r1857 19 19 import org.openstreetmap.josm.data.osm.OsmPrimitive; 20 20 import org.openstreetmap.josm.data.osm.Way; 21 import org.openstreetmap.josm.gui.OptionPaneUtil; 21 22 import org.openstreetmap.josm.tools.Shortcut; 22 23 … … 49 50 50 51 if (nodes.size() == 0) { 51 JOptionPane.showMessageDialog(52 OptionPaneUtil.showMessageDialog( 52 53 Main.parent, 53 54 tr("Please select at least one node or way."), -
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r1847 r1857 106 106 } 107 107 if(delta < Math.PI/4) { 108 JOptionPane.showMessageDialog(Main.parent, tr("Please select ways with almost right angles to orthogonalize.")); 108 OptionPaneUtil.showMessageDialog( 109 Main.parent, 110 tr("Please select ways with almost right angles to orthogonalize."), 111 tr("Information"), 112 JOptionPane.INFORMATION_MESSAGE 113 ); 109 114 return; 110 115 } -
trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java
r1847 r1857 87 87 public boolean checkSaveConditions(Layer layer) { 88 88 if (layer == null) { 89 JOptionPane.showMessageDialog(Main.parent, tr("Internal Error: cannot check conditions for no layer. Please report this as a bug.")); 89 OptionPaneUtil.showMessageDialog( 90 Main.parent, 91 tr("Internal Error: cannot check conditions for no layer. Please report this as a bug."), 92 tr("Error"), 93 JOptionPane.ERROR_MESSAGE 94 ); 90 95 return false; 91 96 } 92 97 if (Main.map == null) { 93 JOptionPane.showMessageDialog(98 OptionPaneUtil.showMessageDialog( 94 99 Main.parent, 95 100 tr("No document open so nothing to save."), … … 271 276 } catch (IOException e) { 272 277 e.printStackTrace(); 273 JOptionPane.showMessageDialog(Main.parent, tr("An error occurred while saving.")+"\n"+e.getMessage()); 278 OptionPaneUtil.showMessageDialog( 279 Main.parent, 280 tr("An error occurred while saving. Error is: {0}", e.getMessage()), 281 tr("Error"), 282 JOptionPane.ERROR_MESSAGE 283 ); 274 284 } 275 285 try { -
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 -
trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java
r1820 r1857 27 27 import org.openstreetmap.josm.data.osm.Way; 28 28 import org.openstreetmap.josm.gui.MapView; 29 import org.openstreetmap.josm.gui.OptionPaneUtil; 29 30 import org.openstreetmap.josm.tools.Shortcut; 30 31 … … 131 132 132 133 if(errMsg != null) { 133 JOptionPane.showMessageDialog(Main.parent, errMsg); 134 OptionPaneUtil.showMessageDialog( 135 Main.parent, 136 errMsg, 137 tr("Error"), 138 JOptionPane.ERROR_MESSAGE); 134 139 } 135 140 -
trunk/src/org/openstreetmap/josm/actions/UpdateDataAction.java
r1820 r1857 15 15 import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTaskList; 16 16 import org.openstreetmap.josm.data.osm.DataSource; 17 import org.openstreetmap.josm.gui.OptionPaneUtil; 17 18 import org.openstreetmap.josm.gui.layer.Layer; 18 19 import org.openstreetmap.josm.gui.layer.Layer.LayerChangeListener; … … 73 74 74 75 if(bboxCount == 0) { 75 JOptionPane.showMessageDialog(76 OptionPaneUtil.showMessageDialog( 76 77 Main.parent, 77 78 tr("No data to update found. Have you already opened or downloaded a data layer?"), -
trunk/src/org/openstreetmap/josm/actions/UpdateSelectionAction.java
r1820 r1857 17 17 import org.openstreetmap.josm.data.osm.DataSet; 18 18 import org.openstreetmap.josm.data.osm.OsmPrimitive; 19 import org.openstreetmap.josm.gui.OptionPaneUtil; 19 20 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 20 21 import org.openstreetmap.josm.gui.layer.Layer; … … 205 206 Collection<OsmPrimitive> selection = getCurrentDataSet().getSelected(); 206 207 if (selection.size() == 0) { 207 JOptionPane.showMessageDialog(208 OptionPaneUtil.showMessageDialog( 208 209 Main.parent, 209 210 tr("There are no selected primitives to update."), -
trunk/src/org/openstreetmap/josm/actions/UploadAction.java
r1820 r1857 26 26 import org.openstreetmap.josm.data.osm.OsmPrimitive; 27 27 import org.openstreetmap.josm.gui.ExtendedDialog; 28 import org.openstreetmap.josm.gui.OptionPaneUtil; 28 29 import org.openstreetmap.josm.gui.OsmPrimitivRenderer; 29 30 import org.openstreetmap.josm.gui.PleaseWaitRunnable; … … 174 175 ConflictCollection conflicts = Main.map.mapView.getEditLayer().getConflicts(); 175 176 if (conflicts !=null && !conflicts.isEmpty()) { 176 JOptionPane.showMessageDialog(Main.parent,tr("There are unresolved conflicts. You have to resolve these first.")); 177 OptionPaneUtil.showMessageDialog( 178 Main.parent, 179 tr("There are unresolved conflicts. You have to resolve these first."), 180 tr("Warning"), 181 JOptionPane.WARNING_MESSAGE 182 ); 177 183 Main.map.conflictDialog.action.button.setSelected(true); 178 184 Main.map.conflictDialog.action.actionPerformed(null); -
trunk/src/org/openstreetmap/josm/actions/search/SelectionWebsiteLoader.java
r1814 r1857 20 20 import org.openstreetmap.josm.Main; 21 21 import org.openstreetmap.josm.data.osm.OsmPrimitive; 22 import org.openstreetmap.josm.gui.OptionPaneUtil; 22 23 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 23 24 import org.openstreetmap.josm.io.OsmIdReader; … … 59 60 } catch (IOException e) { 60 61 e.printStackTrace(); 61 JOptionPane.showMessageDialog(Main.parent, tr("Could not read from URL: \"{0}\"",url)); 62 OptionPaneUtil.showMessageDialog( 63 Main.parent, 64 tr("Could not read from URL: \"{0}\"",url), 65 tr("Error"), 66 JOptionPane.ERROR_MESSAGE 67 ); 62 68 } catch (SAXException e) { 63 69 e.printStackTrace(); 64 JOptionPane.showMessageDialog(Main.parent,tr("Parsing error in URL: \"{0}\"",url)); 70 OptionPaneUtil.showMessageDialog( 71 Main.parent, 72 tr("Parsing error in URL: \"{0}\"",url), 73 tr("Error"), 74 JOptionPane.ERROR_MESSAGE 75 ); 65 76 } catch(OsmTransferException e) { 66 77 e.printStackTrace(); 67 78 if (e.getCause() != null) { 68 79 if (e.getCause() instanceof IOException ) { 69 JOptionPane.showMessageDialog(Main.parent, tr("Could not read from URL: \"{0}\"",url), 80 OptionPaneUtil.showMessageDialog( 81 Main.parent, tr("Could not read from URL: \"{0}\"",url), 70 82 tr("Error"), JOptionPane.ERROR_MESSAGE); 71 83 } else if (e.getCause() instanceof SAXException) { 72 JOptionPane.showMessageDialog(Main.parent,tr("Parsing error in URL: \"{0}\"",url),84 OptionPaneUtil.showMessageDialog(Main.parent,tr("Parsing error in URL: \"{0}\"",url), 73 85 tr("Error"), JOptionPane.ERROR_MESSAGE); 74 86 } 75 87 } else { 76 JOptionPane.showMessageDialog(Main.parent,tr("Error while communicating with server.",url),88 OptionPaneUtil.showMessageDialog(Main.parent,tr("Error while communicating with server.",url), 77 89 tr("Error"), JOptionPane.ERROR_MESSAGE); 78 90 }
Note:
See TracChangeset
for help on using the changeset viewer.