Changeset 1847 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2009-07-25T23:44:19+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/conflict/properties/PropertiesMergeModel.java
r1811 r1847 27 27 import org.openstreetmap.josm.data.osm.RelationMember; 28 28 import org.openstreetmap.josm.data.osm.Way; 29 import org.openstreetmap.josm.gui.OptionPaneUtil; 29 30 import org.openstreetmap.josm.gui.conflict.MergeDecisionType; 30 31 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; … … 417 418 String msg = e.getMessage() != null ? e.getMessage() : e.toString(); 418 419 msg = msg.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">"); 419 JOptionPane.showMessageDialog(420 OptionPaneUtil.showMessageDialog( 420 421 Main.parent, 421 422 tr("<html>An error occurred while communicating with the server<br>" … … 468 469 tr("No, cancel operation") 469 470 }; 470 int ret = JOptionPane.showOptionDialog(471 int ret = OptionPaneUtil.showOptionDialog( 471 472 Main.parent, 472 473 tr("<html>There are {0} additional nodes used by way {1}<br>" … … 478 479 JOptionPane.YES_NO_OPTION, 479 480 JOptionPane.QUESTION_MESSAGE, 480 null,481 481 options, 482 482 options[0] … … 497 497 tr("No, cancel operation") 498 498 }; 499 int ret = JOptionPane.showOptionDialog(499 int ret = OptionPaneUtil.showOptionDialog( 500 500 Main.parent, 501 501 tr("<html>There are {0} additional primitives referred to by relation {1}<br>" … … 507 507 JOptionPane.YES_NO_OPTION, 508 508 JOptionPane.QUESTION_MESSAGE, 509 null,510 509 options, 511 510 options[0] -
trunk/src/org/openstreetmap/josm/gui/conflict/properties/PropertiesMerger.java
r1690 r1847 25 25 import org.openstreetmap.josm.data.coor.LatLon; 26 26 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 27 import org.openstreetmap.josm.gui.OptionPaneUtil; 27 28 import org.openstreetmap.josm.gui.conflict.MergeDecisionType; 28 29 import org.openstreetmap.josm.tools.ImageProvider; … … 582 583 tr("No, abort") 583 584 }; 584 int ret = JOptionPane.showOptionDialog(585 int ret = OptionPaneUtil.showOptionDialog( 585 586 null, 586 587 tr("<html>To keep your local version, JOSM<br>" … … 595 596 JOptionPane.YES_NO_OPTION, 596 597 JOptionPane.QUESTION_MESSAGE, 597 null,598 598 options, 599 599 options[1] … … 624 624 tr("No, abort") 625 625 }; 626 int ret = JOptionPane.showOptionDialog(626 int ret = OptionPaneUtil.showOptionDialog( 627 627 null, 628 628 tr("<html>JOSM will have to remove your local primitive with id {0}<br>" … … 634 634 JOptionPane.YES_NO_OPTION, 635 635 JOptionPane.QUESTION_MESSAGE, 636 null,637 636 options, 638 637 options[1] -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java
r1782 r1847 22 22 import org.openstreetmap.josm.Main; 23 23 import org.openstreetmap.josm.command.Command; 24 import org.openstreetmap.josm.gui.OptionPaneUtil; 24 25 import org.openstreetmap.josm.gui.conflict.ConflictResolver; 25 26 import org.openstreetmap.josm.gui.conflict.properties.OperationCancelledException; … … 174 175 tr("Apply partial resolutions"), 175 176 tr("Continue resolving")}; 176 int n = JOptionPane.showOptionDialog(null,177 int n = OptionPaneUtil.showOptionDialog(null, 177 178 tr("<html>You didn''t finish to resolve all conflicts.<br>" 178 179 + "Click <strong>{0}</strong> to apply already resolved conflicts anyway.<br>" … … 184 185 JOptionPane.YES_NO_OPTION, 185 186 JOptionPane.WARNING_MESSAGE, 186 null,187 187 options, 188 188 options[1] -
trunk/src/org/openstreetmap/josm/gui/dialogs/HistoryDialog.java
r1815 r1847 43 43 import org.openstreetmap.josm.data.osm.history.History; 44 44 import org.openstreetmap.josm.data.osm.history.HistoryDataSet; 45 import org.openstreetmap.josm.gui.OptionPaneUtil; 45 46 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 46 47 import org.openstreetmap.josm.gui.SideButton; … … 246 247 msg = task.getLastException().toString(); 247 248 } 248 JOptionPane.showMessageDialog(249 OptionPaneUtil.showMessageDialog( 249 250 Main.parent, 250 251 tr( -
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListPopup.java
r1169 r1847 13 13 14 14 import org.openstreetmap.josm.Main; 15 import org.openstreetmap.josm.gui.OptionPaneUtil; 15 16 import org.openstreetmap.josm.gui.layer.Layer; 16 17 import org.openstreetmap.josm.tools.ImageProvider; … … 28 29 } 29 30 public void actionPerformed(ActionEvent e) { 30 JOptionPane.showMessageDialog(Main.parent, layer.getInfoComponent()); 31 OptionPaneUtil.showMessageDialog( 32 Main.parent, 33 layer.getInfoComponent(), 34 tr("Information about layer"), 35 JOptionPane.INFORMATION_MESSAGE 36 ); 31 37 } 32 38 } 33 39 34 40 public LayerListPopup(final JList layers, final Layer layer) { 35 for (Component c : layer.getMenuEntries()) 41 for (Component c : layer.getMenuEntries()) { 36 42 add(c); 43 } 37 44 } 38 45 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r1838 r1847 16 16 import javax.swing.DefaultListModel; 17 17 import javax.swing.JList; 18 import javax.swing.JOptionPane;19 18 import javax.swing.JPanel; 20 19 import javax.swing.JScrollPane; … … 28 27 import org.openstreetmap.josm.data.osm.OsmPrimitive; 29 28 import org.openstreetmap.josm.data.osm.Relation; 30 import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil;31 import org.openstreetmap.josm.gui.OptionPaneUtil;32 29 import org.openstreetmap.josm.gui.OsmPrimitivRenderer; 33 30 import org.openstreetmap.josm.gui.SideButton; -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java
r1828 r1847 34 34 import org.openstreetmap.josm.data.osm.RelationMember; 35 35 import org.openstreetmap.josm.data.osm.visitor.MergeVisitor; 36 import org.openstreetmap.josm.gui.OptionPaneUtil; 36 37 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 37 38 import org.openstreetmap.josm.gui.PrimitiveNameFormatter; … … 309 310 msg = lastException.toString(); 310 311 } 311 JOptionPane.showMessageDialog(null, msg, tr("Error"), JOptionPane.ERROR_MESSAGE); 312 OptionPaneUtil.showMessageDialog( 313 Main.parent, 314 msg, 315 tr("Error"), 316 JOptionPane.ERROR_MESSAGE 317 ); 312 318 } 313 319 … … 331 337 332 338 if (conflictsCount > 0) { 333 JOptionPane op = new JOptionPane( 339 OptionPaneUtil.showMessageDialog( 340 Main.parent, 334 341 tr("There were {0} conflicts during import.", conflictsCount), 342 tr("Conflicts in data"), 335 343 JOptionPane.WARNING_MESSAGE 336 344 ); 337 JDialog dialog = op.createDialog(ChildRelationBrowser.this, tr("Conflicts in data"));338 dialog.setAlwaysOnTop(true);339 dialog.setModal(true);340 dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);341 dialog.setVisible(true);342 345 } 343 346 } … … 423 426 msg = lastException.toString(); 424 427 } 425 JOptionPane.showMessageDialog(null, msg, tr("Error"), JOptionPane.ERROR_MESSAGE); 428 OptionPaneUtil.showMessageDialog( 429 Main.parent, 430 msg, 431 tr("Error"), 432 JOptionPane.ERROR_MESSAGE 433 ); 426 434 } 427 435 … … 445 453 446 454 if (conflictsCount > 0) { 447 JOptionPane op = new JOptionPane( 455 OptionPaneUtil.showMessageDialog( 456 Main.parent, 448 457 tr("There were {0} conflicts during import.", conflictsCount), 458 tr("Conflicts in data"), 449 459 JOptionPane.WARNING_MESSAGE 450 460 ); 451 JDialog dialog = op.createDialog(ChildRelationBrowser.this, tr("Conflicts in data"));452 dialog.setAlwaysOnTop(true);453 dialog.setModal(true);454 dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);455 dialog.setVisible(true);456 461 } 457 462 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r1845 r1847 713 713 this.nameFormatter.getName(primitive) 714 714 ); 715 OptionPaneUtil.showMessageDialog(Main.parent, msg, tr("Warning"), JOptionPane.WARNING_MESSAGE); 715 OptionPaneUtil.showMessageDialog( 716 Main.parent, 717 msg, 718 tr("Warning"), 719 JOptionPane.WARNING_MESSAGE 720 ); 716 721 } 717 722 … … 986 991 Conflict<Relation> conflict = new Conflict<Relation>(getRelation(), editedRelation); 987 992 getLayer().getConflicts().add(conflict); 988 JOptionPane op = new JOptionPane( 993 OptionPaneUtil.showMessageDialog( 994 Main.parent, 989 995 tr("<html>The relation has changed outside of the editor.<br>" 990 996 + "Your edits can't be applied directly, a conflict has been created instead.</html>"), 997 tr("Warning"), 991 998 JOptionPane.WARNING_MESSAGE 992 999 ); 993 JDialog dialog = op.createDialog(GenericRelationEditor.this, tr("Conflict created"));994 dialog.setAlwaysOnTop(true);995 dialog.setModal(true);996 dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);997 dialog.setVisible(true);998 1000 } else { 999 1001 tagEditorModel.applyToPrimitive(editedRelation); … … 1292 1294 msg = lastException.toString(); 1293 1295 } 1294 JOptionPane.showMessageDialog(null, msg, tr("Error"), JOptionPane.ERROR_MESSAGE); 1296 OptionPaneUtil.showMessageDialog( 1297 Main.parent, 1298 msg, 1299 tr("Error"), 1300 JOptionPane.ERROR_MESSAGE 1301 ); 1295 1302 } 1296 1303 … … 1305 1312 1306 1313 if (conflictsCount > 0) { 1307 JOptionPane op = new JOptionPane(tr("There were {0} conflicts during import.", conflictsCount), 1308 JOptionPane.WARNING_MESSAGE); 1309 JDialog dialog = op.createDialog(GenericRelationEditor.this, tr("Conflicts in data")); 1310 dialog.setAlwaysOnTop(true); 1311 dialog.setModal(true); 1312 dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); 1313 dialog.setVisible(true); 1314 OptionPaneUtil.showMessageDialog( 1315 Main.parent, 1316 tr("There were {0} conflicts during import.", conflictsCount), 1317 tr("Warning"), 1318 JOptionPane.WARNING_MESSAGE 1319 ); 1314 1320 } 1315 1321 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowser.java
r1836 r1847 32 32 import org.openstreetmap.josm.data.osm.Relation; 33 33 import org.openstreetmap.josm.data.osm.visitor.MergeVisitor; 34 import org.openstreetmap.josm.gui.OptionPaneUtil; 34 35 import org.openstreetmap.josm.gui.OsmPrimitivRenderer; 35 36 import org.openstreetmap.josm.gui.PleaseWaitRunnable; … … 202 203 msg = lastException.toString(); 203 204 } 204 JOptionPane.showMessageDialog(205 null,205 OptionPaneUtil.showMessageDialog( 206 Main.parent, 206 207 msg, 207 208 tr("Error"), … … 259 260 return; 260 261 getLayer().getConflicts().add(visitor.getConflicts()); 261 JOptionPane op = new JOptionPane( 262 OptionPaneUtil.showMessageDialog( 263 Main.parent, 262 264 tr("There were {0} conflicts during import.", 263 265 visitor.getConflicts().size()), 266 tr("Warning"), 264 267 JOptionPane.WARNING_MESSAGE 265 268 ); 266 JDialog dialog = op.createDialog(ReferringRelationsBrowser.this, tr("Conflicts in data"));267 dialog.setAlwaysOnTop(true);268 dialog.setModal(true);269 dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);270 dialog.setVisible(true);271 269 } 272 270 } catch(Exception e) { -
trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java
r1169 r1847 23 23 import org.openstreetmap.josm.data.Preferences; 24 24 import org.openstreetmap.josm.gui.BookmarkList; 25 import org.openstreetmap.josm.gui.OptionPaneUtil; 25 26 import org.openstreetmap.josm.tools.GBC; 26 27 … … 78 79 79 80 if (tempBookmark == null) { 80 JOptionPane.showMessageDialog(Main.parent, tr("Please enter the desired coordinates first.")); 81 OptionPaneUtil.showMessageDialog( 82 Main.parent, 83 tr("Please enter the desired coordinates first."), 84 tr("Information"), 85 JOptionPane.INFORMATION_MESSAGE 86 ); 81 87 return; 82 88 } … … 94 100 Object sel = bookmarks.getSelectedValue(); 95 101 if (sel == null) { 96 JOptionPane.showMessageDialog(Main.parent,tr("Select a bookmark first.")); 102 OptionPaneUtil.showMessageDialog( 103 Main.parent, 104 tr("Select a bookmark first."), 105 tr("Information"), 106 JOptionPane.INFORMATION_MESSAGE 107 ); 97 108 return; 98 109 } -
trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java
r1349 r1847 32 32 33 33 import org.openstreetmap.josm.Main; 34 import org.openstreetmap.josm.gui.OptionPaneUtil; 34 35 import org.openstreetmap.josm.gui.download.DownloadDialog; 35 36 import org.openstreetmap.josm.gui.download.DownloadSelection; … … 166 167 if(searchtext.length()==0) 167 168 { 168 JOptionPane.showMessageDialog(Main.parent,tr("Please enter a search string")); 169 OptionPaneUtil.showMessageDialog( 170 Main.parent, 171 tr("Please enter a search string"), 172 tr("Information"), 173 JOptionPane.INFORMATION_MESSAGE 174 ); 169 175 } 170 176 else … … 173 179 component.repaint(); 174 180 URL url = new URL("http://gazetteer.openstreetmap.org/namefinder/search.xml?find=" 175 +java.net.URLEncoder.encode(searchTerm.getText(), "UTF-8"));181 +java.net.URLEncoder.encode(searchTerm.getText(), "UTF-8")); 176 182 HttpURLConnection activeConnection = (HttpURLConnection)url.openConnection(); 177 183 //System.out.println("got return: "+activeConnection.getResponseCode()); … … 318 324 // if bounding box selected on other tab, de-select item 319 325 public void boundingBoxChanged(DownloadDialog gui) { 320 if (!updatingSelf) searchResultDisplay.clearSelection(); 326 if (!updatingSelf) { 327 searchResultDisplay.clearSelection(); 328 } 321 329 } 322 330 } -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarker.java
r1169 r1847 61 61 public void actionPerformed(ActionEvent ev) { 62 62 p.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); 63 if (scale.getModel().isSelected()) 63 if (scale.getModel().isSelected()) { 64 64 ((JLabel)vp.getView()).setIcon(loadScaledImage(imageUrl, Math.max(vp.getWidth(), vp.getHeight()))); 65 else65 } else { 66 66 ((JLabel)vp.getView()).setIcon(new ImageIcon(imageUrl)); 67 } 67 68 p.setCursor(Cursor.getDefaultCursor()); 68 69 } … … 72 73 JDialog dlg = pane.createDialog(Main.parent, imageUrl.toString()); 73 74 dlg.setModal(false); 75 dlg.toFront(); 74 76 dlg.setVisible(true); 75 77 }
Note:
See TracChangeset
for help on using the changeset viewer.