- Timestamp:
- 2009-07-25T23:44:19+02:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AbstractInfoAction.java
r1820 r1847 13 13 import org.openstreetmap.josm.Main; 14 14 import org.openstreetmap.josm.data.osm.OsmPrimitive; 15 import org.openstreetmap.josm.gui.OptionPaneUtil; 15 16 import org.openstreetmap.josm.tools.OpenBrowser; 16 17 import org.openstreetmap.josm.tools.Shortcut; … … 58 59 59 60 if (primitivesToShow.isEmpty()) { 60 JOptionPane.showMessageDialog(61 OptionPaneUtil.showMessageDialog( 61 62 Main.parent, 62 63 tr("Please select at least one already uploaded node, way, or relation."), -
trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java
r1846 r1847 22 22 import org.openstreetmap.josm.data.osm.OsmPrimitive; 23 23 import org.openstreetmap.josm.data.osm.Way; 24 import org.openstreetmap.josm.gui.OptionPaneUtil; 24 25 import org.openstreetmap.josm.tools.Shortcut; 25 26 … … 132 133 133 134 if (nodes.size() < 4) { 134 JOptionPane.showMessageDialog(Main.parent, tr("Please select at least four nodes.")); 135 OptionPaneUtil.showMessageDialog( 136 Main.parent, 137 tr("Please select at least four nodes."), 138 tr("Information"), 139 JOptionPane.INFORMATION_MESSAGE 140 ); 135 141 return; 136 142 } -
trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java
r1820 r1847 18 18 import org.openstreetmap.josm.data.osm.OsmPrimitive; 19 19 import org.openstreetmap.josm.data.osm.Way; 20 import org.openstreetmap.josm.gui.OptionPaneUtil; 20 21 import org.openstreetmap.josm.tools.Shortcut; 21 22 … … 60 61 } 61 62 if (nodes.size() < 3) { 62 JOptionPane.showMessageDialog(Main.parent, tr("Please select at least three nodes.")); 63 OptionPaneUtil.showMessageDialog( 64 Main.parent, 65 tr("Please select at least three nodes."), 66 tr("Information"), 67 JOptionPane.INFORMATION_MESSAGE 68 ); 63 69 return; 64 70 } -
trunk/src/org/openstreetmap/josm/actions/ApiPreconditionChecker.java
r1843 r1847 15 15 import org.openstreetmap.josm.data.osm.OsmPrimitive; 16 16 import org.openstreetmap.josm.data.osm.Way; 17 import org.openstreetmap.josm.gui.OptionPaneUtil; 17 18 import org.openstreetmap.josm.io.OsmApi; 18 19 import org.openstreetmap.josm.io.OsmApiInitializationException; … … 47 48 total = add.size() + update.size() + delete.size(); 48 49 if(total > maxElements) { 49 JOptionPane.showMessageDialog(50 OptionPaneUtil.showMessageDialog( 50 51 Main.parent, 51 52 tr("Current number of changes exceeds the max. number of changes, current is {0}, max is {1}", … … 61 62 } catch (OsmApiInitializationException e) { 62 63 e.printStackTrace(); 63 JOptionPane.showMessageDialog(64 OptionPaneUtil.showMessageDialog( 64 65 Main.parent, 65 66 tr("Failed to initialize API. Please try again later."), … … 88 89 continue; 89 90 } 90 JOptionPane.showMessageDialog(Main.parent,91 OptionPaneUtil.showMessageDialog(Main.parent, 91 92 tr("Length of value for tag ''{0}'' on primitive {1} exceeds the max. allowed length {2}. Values length is {3}.", 92 93 e.getKey(), Long.toString(osmPrimitive.id), 255, e.getValue().length() … … 104 105 if (osmPrimitive instanceof Way && 105 106 ((Way)osmPrimitive).nodes.size() > maxNodes) { 106 JOptionPane.showMessageDialog(107 OptionPaneUtil.showMessageDialog( 107 108 Main.parent, 108 109 tr("{0} nodes in way {1} exceed the max. allowed number of nodes {2}", -
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r1820 r1847 16 16 import org.openstreetmap.josm.data.osm.OsmPrimitive; 17 17 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 18 import org.openstreetmap.josm.gui.OptionPaneUtil; 18 19 import org.openstreetmap.josm.gui.layer.Layer; 19 20 import org.openstreetmap.josm.tools.Shortcut; … … 86 87 } 87 88 if (sel.isEmpty()) { 88 JOptionPane.showMessageDialog(Main.parent, 89 mode.equals("selection") ? tr("Nothing selected to zoom to.") : tr("No conflicts to zoom to")); 89 OptionPaneUtil.showMessageDialog( 90 Main.parent, 91 (mode.equals("selection") ? tr("Nothing selected to zoom to.") : tr("No conflicts to zoom to")), 92 tr("Information"), 93 JOptionPane.INFORMATION_MESSAGE 94 ); 90 95 return null; 91 96 } -
trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
r1820 r1847 37 37 import org.openstreetmap.josm.data.osm.Way; 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; … … 65 66 66 67 if (selectedWays.size() < 2) { 67 JOptionPane.showMessageDialog(Main.parent, tr("Please select at least two ways to combine.")); 68 OptionPaneUtil.showMessageDialog( 69 Main.parent, 70 tr("Please select at least two ways to combine."), 71 tr("Information"), 72 JOptionPane.INFORMATION_MESSAGE 73 ); 68 74 return; 69 75 } … … 152 158 nodeList = (List<Node>) secondTry; 153 159 } else { 154 JOptionPane.showMessageDialog(Main.parent, secondTry); 160 OptionPaneUtil.showMessageDialog( 161 Main.parent, 162 secondTry, // FIXME: not sure whether this fits in a dialog 163 tr("Information"), 164 JOptionPane.INFORMATION_MESSAGE 165 ); 155 166 return; 156 167 } -
trunk/src/org/openstreetmap/josm/actions/CopyAction.java
r1820 r1847 24 24 import org.openstreetmap.josm.data.osm.Way; 25 25 import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor; 26 import org.openstreetmap.josm.gui.OptionPaneUtil; 26 27 import org.openstreetmap.josm.tools.Shortcut; 27 28 … … 136 137 Collection<OsmPrimitive> sel = getCurrentDataSet().getSelected(); 137 138 if (sel.isEmpty()) { 138 JOptionPane.showMessageDialog(139 OptionPaneUtil.showMessageDialog( 139 140 Main.parent, 140 tr("Please select something to copy.") 141 tr("Please select something to copy."), 142 tr("Information"), 143 JOptionPane.INFORMATION_MESSAGE 141 144 ); 142 145 return true; -
trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java
r1846 r1847 23 23 import org.openstreetmap.josm.data.osm.Way; 24 24 import org.openstreetmap.josm.data.osm.visitor.CollectBackReferencesVisitor; 25 import org.openstreetmap.josm.gui.OptionPaneUtil; 25 26 import org.openstreetmap.josm.tools.Shortcut; 26 27 … … 202 203 203 204 if (sUnder == 0) { 204 JOptionPane.showMessageDialog(Main.parent, tr("Those nodes are not in a circle.")); 205 OptionPaneUtil.showMessageDialog( 206 Main.parent, 207 tr("Those nodes are not in a circle. Aborting."), 208 tr("Warning"), 209 JOptionPane.WARNING_MESSAGE 210 ); 205 211 return; 206 212 } … … 261 267 262 268 } else { 263 JOptionPane.showMessageDialog(Main.parent, tr("Please select exactly two or three nodes or one way with exactly two or three nodes.")); 269 OptionPaneUtil.showMessageDialog( 270 Main.parent, 271 tr("Please select exactly two or three nodes or one way with exactly two or three nodes."), 272 tr("Information"), 273 JOptionPane.INFORMATION_MESSAGE 274 ); 264 275 return; 265 276 } -
trunk/src/org/openstreetmap/josm/actions/DistributeAction.java
r1820 r1847 18 18 import org.openstreetmap.josm.data.osm.OsmPrimitive; 19 19 import org.openstreetmap.josm.data.osm.Way; 20 import org.openstreetmap.josm.gui.OptionPaneUtil; 20 21 import org.openstreetmap.josm.tools.Shortcut; 21 22 … … 59 60 60 61 if (nodes.size() < 3) { 61 JOptionPane.showMessageDialog(Main.parent, tr("Please select at least three nodes.")); 62 OptionPaneUtil.showMessageDialog( 63 Main.parent, 64 tr("Please select at least three nodes."), 65 tr("Information"), 66 JOptionPane.INFORMATION_MESSAGE 67 ); 62 68 return; 63 69 } -
trunk/src/org/openstreetmap/josm/actions/DownloadAction.java
r1811 r1847 13 13 14 14 import org.openstreetmap.josm.Main; 15 import org.openstreetmap.josm.gui.OptionPaneUtil; 15 16 import org.openstreetmap.josm.gui.download.DownloadDialog; 16 17 import org.openstreetmap.josm.gui.download.DownloadDialog.DownloadTask; … … 32 33 public DownloadAction() { 33 34 super(tr("Download from OSM..."), "download", tr("Download map data from the OSM server."), 34 Shortcut.registerShortcut("file:download", tr("File: {0}", tr("Download from OSM...")), KeyEvent.VK_D, Shortcut.GROUPS_ALT1+Shortcut.GROUP_HOTKEY), true); 35 Shortcut.registerShortcut("file:download", tr("File: {0}", tr("Download from OSM...")), KeyEvent.VK_D, Shortcut.GROUPS_ALT1+Shortcut.GROUP_HOTKEY), true); 35 36 } 36 37 … … 46 47 dialog.setOptionPane(pane); 47 48 48 if (dlg.getWidth() > 1000) 49 if (dlg.getWidth() > 1000) { 49 50 dlg.setSize(1000, dlg.getHeight()); 50 if (dlg.getHeight() > 600) 51 } 52 if (dlg.getHeight() > 600) { 51 53 dlg.setSize(dlg.getWidth(),600); 54 } 52 55 53 56 boolean finish = false; … … 64 67 } 65 68 } 66 } else 69 } else { 67 70 finish = true; 68 if (!finish) 69 JOptionPane.showMessageDialog(Main.parent, tr("Please select at least one task to download")); 71 } 72 if (!finish) { 73 OptionPaneUtil.showMessageDialog( 74 Main.parent, 75 tr("Please select at least one task to download"), 76 tr("Error"), 77 JOptionPane.ERROR_MESSAGE 78 ); 79 } 70 80 } 71 81 72 82 dialog = null; 73 83 dlg.dispose(); 74 84 } -
trunk/src/org/openstreetmap/josm/actions/DownloadReferrersAction.java
r1820 r1847 18 18 import org.openstreetmap.josm.data.osm.OsmPrimitive; 19 19 import org.openstreetmap.josm.data.osm.visitor.MergeVisitor; 20 import org.openstreetmap.josm.gui.OptionPaneUtil; 20 21 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 21 22 import org.openstreetmap.josm.gui.layer.Layer; … … 85 86 msg = lastException.toString(); 86 87 } 87 JOptionPane.showMessageDialog(88 OptionPaneUtil.showMessageDialog( 88 89 Main.map, 89 90 msg, … … 121 122 return; 122 123 Main.map.mapView.getEditLayer().getConflicts().add(visitor.getConflicts()); 123 JOptionPane op = new JOptionPane( 124 OptionPaneUtil.showMessageDialog( 125 Main.parent, 124 126 tr("There were {0} conflicts during import.", 125 visitor.getConflicts().size()), 126 JOptionPane.WARNING_MESSAGE 127 visitor.getConflicts().size() 128 ), 129 tr("Conflicts during download"), 130 JOptionPane.WARNING_MESSAGE 127 131 ); 128 JDialog dialog = op.createDialog(null, tr("Conflicts in data"));129 dialog.setAlwaysOnTop(true);130 dialog.setModal(true);131 dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);132 dialog.setVisible(true);133 132 } 134 133 -
trunk/src/org/openstreetmap/josm/actions/GpxExportAction.java
r1820 r1847 29 29 import org.openstreetmap.josm.data.gpx.GpxData; 30 30 import org.openstreetmap.josm.gui.ExtendedDialog; 31 import org.openstreetmap.josm.gui.OptionPaneUtil; 31 32 import org.openstreetmap.josm.gui.layer.GpxLayer; 32 33 import org.openstreetmap.josm.gui.layer.Layer; … … 62 63 GpxLayer layer = getLayer(); 63 64 if (layer == null) { 64 JOptionPane.showMessageDialog(Main.parent, tr("Nothing to export. Get some data first.")); 65 OptionPaneUtil.showMessageDialog( 66 Main.parent, 67 tr("Nothing to export. Get some data first."), 68 tr("Information"), 69 JOptionPane.INFORMATION_MESSAGE 70 ); 65 71 return; 66 72 } -
trunk/src/org/openstreetmap/josm/actions/HelpAction.java
r1820 r1847 30 30 31 31 import org.openstreetmap.josm.Main; 32 import org.openstreetmap.josm.gui.OptionPaneUtil; 32 33 import org.openstreetmap.josm.tools.ImageProvider; 33 34 import org.openstreetmap.josm.tools.LanguageInfo; … … 110 111 } else if (tr("Edit").equals(e.getActionCommand())) { 111 112 if (!url.startsWith(baseurl)) { 112 JOptionPane.showMessageDialog(Main.parent, tr("Can only edit help pages from JOSM Online Help")); 113 OptionPaneUtil.showMessageDialog( 114 Main.parent, 115 tr("Can only edit help pages from JOSM Online Help"), 116 tr("Warning"), 117 JOptionPane.WARNING_MESSAGE 118 ); 113 119 return; 114 120 } -
trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
r1820 r1847 72 72 73 73 if (selectedNodes.size() < 2) { 74 JOptionPane.showMessageDialog(Main.parent, tr("Please select at least two nodes to merge.")); 74 JOptionPane.showMessageDialog( 75 Main.parent, 76 tr("Please select at least two nodes to merge."), 77 tr("Warning"), 78 JOptionPane.WARNING_MESSAGE 79 ); 75 80 return; 76 81 } -
trunk/src/org/openstreetmap/josm/actions/MirrorAction.java
r1820 r1847 49 49 50 50 if (nodes.size() == 0) { 51 JOptionPane.showMessageDialog(Main.parent, tr("Please select at least one node or way.")); 51 JOptionPane.showMessageDialog( 52 Main.parent, 53 tr("Please select at least one node or way."), 54 tr("Information"), 55 JOptionPane.INFORMATION_MESSAGE 56 ); 52 57 return; 53 58 } -
trunk/src/org/openstreetmap/josm/actions/MoveAction.java
r1820 r1847 17 17 import org.openstreetmap.josm.data.osm.OsmPrimitive; 18 18 import org.openstreetmap.josm.data.osm.visitor.AllNodesVisitor; 19 import org.openstreetmap.josm.gui.OptionPaneUtil; 19 20 import org.openstreetmap.josm.tools.Shortcut; 20 21 … … 102 103 // Revert move 103 104 ((MoveCommand) c).moveAgain(-distx, -disty); 104 JOptionPane.showMessageDialog(Main.parent, 105 tr("Cannot move objects outside of the world.")); 105 OptionPaneUtil.showMessageDialog( 106 Main.parent, 107 tr("Cannot move objects outside of the world."), 108 tr("Warning"), 109 JOptionPane.WARNING_MESSAGE 110 ); 106 111 return; 107 112 } -
trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java
r1637 r1847 13 13 14 14 import org.openstreetmap.josm.Main; 15 import org.openstreetmap.josm.gui.OptionPaneUtil; 15 16 import org.openstreetmap.josm.io.FileImporter; 16 17 import org.openstreetmap.josm.tools.Shortcut; … … 29 30 public OpenFileAction() { 30 31 super(tr("Open..."), "open", tr("Open a file."), 31 Shortcut.registerShortcut("system:open", tr("File: {0}", tr("Open...")), KeyEvent.VK_O, Shortcut.GROUP_MENU)); 32 Shortcut.registerShortcut("system:open", tr("File: {0}", tr("Open...")), KeyEvent.VK_O, Shortcut.GROUP_MENU)); 32 33 } 33 34 … … 37 38 return; 38 39 File[] files = fc.getSelectedFiles(); 39 for (int i = files.length; i > 0; --i) 40 for (int i = files.length; i > 0; --i) { 40 41 openFile(files[i-1]); 42 } 41 43 } 42 44 … … 48 50 System.out.println("Open file: " + file.getAbsolutePath() + " (" + file.length() + " bytes)"); 49 51 for (FileImporter importer : ExtensionFileFilter.importers) 50 if (importer.acceptFile(file)) 52 if (importer.acceptFile(file)) { 51 53 importer.importData(file); 54 } 52 55 } catch (IOException x) { 53 56 x.printStackTrace(); 54 JOptionPane.showMessageDialog(Main.parent, tr("Could not read \"{0}\"", file.getName()) + "\n" 55 + x.getMessage()); 57 OptionPaneUtil.showMessageDialog( 58 Main.parent, 59 tr("<html>Could not read file ''{0}\''. Error is: <br>{1}</html>", file.getName(), x.getMessage()), 60 tr("Error"), 61 JOptionPane.ERROR_MESSAGE 62 ); 63 56 64 } 57 65 } -
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r1838 r1847 12 12 13 13 import javax.swing.JOptionPane; 14 import javax.swing.text.html.Option; 14 15 15 16 import org.openstreetmap.josm.Main; … … 23 24 import org.openstreetmap.josm.data.osm.Way; 24 25 import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil; 26 import org.openstreetmap.josm.gui.OptionPaneUtil; 25 27 import org.openstreetmap.josm.tools.Shortcut; 26 28 … … 57 59 if(osm instanceof Node) { 58 60 if(dirnodes.size() == 2) { 59 JOptionPane.showMessageDialog(Main.parent, tr("Only two nodes allowed")); 61 OptionPaneUtil.showMessageDialog( 62 Main.parent, 63 tr("Only two nodes allowed"), 64 tr("Information"), 65 JOptionPane.INFORMATION_MESSAGE 66 ); 60 67 return; 61 68 } … … 65 72 // Check if selection consists now only of ways 66 73 if (!(osm instanceof Way)) { 67 JOptionPane.showMessageDialog(Main.parent, tr("Selection must consist only of ways.")); 74 OptionPaneUtil.showMessageDialog( 75 Main.parent, 76 tr("Selection must consist only of ways."), 77 tr("Information"), 78 JOptionPane.INFORMATION_MESSAGE 79 ); 68 80 return; 69 81 } … … 72 84 Way way = (Way)osm; 73 85 if ((way.nodes.size() < 5) || (!way.nodes.get(0).equals(way.nodes.get(way.nodes.size() - 1)))) { 74 JOptionPane.showMessageDialog(Main.parent, tr("Please select one or more closed ways of at least four nodes.")); 86 OptionPaneUtil.showMessageDialog( 87 Main.parent, 88 tr("Please select one or more closed ways of at least four nodes."), 89 tr("Information"), 90 JOptionPane.INFORMATION_MESSAGE 91 ); 75 92 return; 76 93 } … … 112 129 // Check, if selection held neither none nor two nodes 113 130 if(dirnodes.size() == 1) { 114 JOptionPane.showMessageDialog(Main.parent, tr("Only one node selected")); 131 OptionPaneUtil.showMessageDialog( 132 Main.parent, 133 tr("Only one node selected"), 134 tr("Warning"), 135 JOptionPane.WARNING_MESSAGE 136 ); 115 137 return; 116 138 } -
trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java
r1843 r1847 103 103 /* only enable if there is something selected to paste into and 104 104 if we don't have conflicting keys in the pastebuffer */ 105 setEnabled(selection != null && 106 ! selection.isEmpty() && 107 ! pasteBuffer.allPrimitives().isEmpty() && 108 (getCurrentDataSet().getSelectedNodes().isEmpty() || 109 ! containsSameKeysWithDifferentValues(pasteBuffer.nodes)) && 110 (getCurrentDataSet().getSelectedWays().isEmpty() || 111 ! containsSameKeysWithDifferentValues(pasteBuffer.ways)) && 112 (getCurrentDataSet().getSelectedRelations().isEmpty() || 113 ! containsSameKeysWithDifferentValues(pasteBuffer.relations))); 105 DataSet ds = getCurrentDataSet(); 106 if (ds == null || ds.getSelected().isEmpty() || pasteBuffer == null || pasteBuffer.allPrimitives().isEmpty()) { 107 setEnabled(false); 108 return; 109 } 110 setEnabled((!ds.getSelectedNodes().isEmpty() && ! containsSameKeysWithDifferentValues(pasteBuffer.nodes)) || 111 (!ds.getSelectedWays().isEmpty() && ! containsSameKeysWithDifferentValues(pasteBuffer.ways)) || 112 (! ds.getSelectedRelations().isEmpty() && ! containsSameKeysWithDifferentValues(pasteBuffer.relations))); 114 113 } 115 114 116 115 @Override public void pasteBufferChanged(DataSet newPasteBuffer) { 117 possiblyEnable(getCurrentDataSet().getSelected(), newPasteBuffer);116 updateEnabledState(); 118 117 } 119 118 -
trunk/src/org/openstreetmap/josm/actions/RenameLayerAction.java
r1646 r1847 15 15 16 16 import org.openstreetmap.josm.Main; 17 import org.openstreetmap.josm.gui.OptionPaneUtil; 17 18 import org.openstreetmap.josm.gui.layer.Layer; 18 19 import org.openstreetmap.josm.tools.ImageProvider; … … 52 53 filerename.setEnabled(file != null); 53 54 } 54 if (filerename.isEnabled()) 55 if (filerename.isEnabled()) { 55 56 filerename.setSelected(Main.pref.getBoolean("layer.rename-file", true)); 57 } 56 58 57 59 final JOptionPane optionPane = new JOptionPane(panel, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION){ … … 62 64 }; 63 65 final JDialog dlg = optionPane.createDialog(Main.parent, tr("Rename layer")); 66 dlg.setModal(true); 67 dlg.setAlwaysOnTop(true); 68 dlg.toFront(); 64 69 dlg.setVisible(true); 65 70 66 71 Object answer = optionPane.getValue(); 67 72 if (answer == null || answer == JOptionPane.UNINITIALIZED_VALUE || 68 (answer instanceof Integer && (Integer)answer != JOptionPane.OK_OPTION)) {73 (answer instanceof Integer && (Integer)answer != JOptionPane.OK_OPTION)) 69 74 return; 70 }71 75 72 76 String nameText = name.getText(); … … 75 79 if (filerename.isSelected()) { 76 80 String newname = nameText; 77 if (newname.indexOf("/") == -1 && newname.indexOf("\\") == -1) 81 if (newname.indexOf("/") == -1 && newname.indexOf("\\") == -1) { 78 82 newname = file.getParent() + File.separator + newname; 83 } 79 84 String oldname = file.getName(); 80 if (name.getText().indexOf('.') == -1 && oldname.indexOf('.') >= 0) 85 if (name.getText().indexOf('.') == -1 && oldname.indexOf('.') >= 0) { 81 86 newname += oldname.substring(oldname.lastIndexOf('.')); 87 } 82 88 File newFile = new File(newname); 83 89 if (file.renameTo(newFile)) { … … 85 91 nameText = newFile.getName(); 86 92 } else { 87 JOptionPane.showMessageDialog(Main.parent, tr("Could not rename the file \"{0}\".", file.getPath())); 93 OptionPaneUtil.showMessageDialog( 94 Main.parent, 95 tr("Could not rename file ''{0}''", file.getPath()), 96 tr("Error"), 97 JOptionPane.ERROR_MESSAGE 98 ); 88 99 return; 89 100 } -
trunk/src/org/openstreetmap/josm/actions/ReverseWayAction.java
r1844 r1847 21 21 import org.openstreetmap.josm.data.osm.OsmPrimitive; 22 22 import org.openstreetmap.josm.data.osm.Way; 23 import org.openstreetmap.josm.gui.OptionPaneUtil; 23 24 import org.openstreetmap.josm.tools.Shortcut; 24 25 … … 43 44 } 44 45 if (sel.isEmpty()) { 45 JOptionPane.showMessageDialog(Main.parent, 46 tr("Please select at least one way.")); 46 OptionPaneUtil.showMessageDialog( 47 Main.parent, 48 tr("Please select at least one way."), 49 tr("Information"), 50 JOptionPane.INFORMATION_MESSAGE 51 ); 47 52 return; 48 53 } -
trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java
r1820 r1847 23 23 import org.openstreetmap.josm.data.osm.OsmPrimitive; 24 24 import org.openstreetmap.josm.gui.ExtendedDialog; 25 import org.openstreetmap.josm.gui.OptionPaneUtil; 25 26 import org.openstreetmap.josm.gui.layer.GpxLayer; 26 27 import org.openstreetmap.josm.gui.layer.Layer; … … 90 91 } 91 92 if (Main.map == null) { 92 JOptionPane.showMessageDialog(Main.parent, tr("No document open so nothing to save.")); 93 JOptionPane.showMessageDialog( 94 Main.parent, 95 tr("No document open so nothing to save."), 96 tr("Warning"), 97 JOptionPane.WARNING_MESSAGE 98 ); 93 99 return false; 94 100 } … … 128 134 dstStream = new FileOutputStream(dst); 129 135 } catch (FileNotFoundException e) { 130 JOptionPane.showMessageDialog(Main.parent, tr("Could not back up file.")+"\n"+e.getMessage()); 136 OptionPaneUtil.showMessageDialog( 137 Main.parent, 138 tr("Could not back up file. Exception is: {0}", e.getMessage()), 139 tr("Error"), 140 JOptionPane.ERROR_MESSAGE 141 ); 131 142 return; 132 143 } … … 192 203 } 193 204 } else { 194 JOptionPane.showMessageDialog(Main.parent, tr("Unknown file extension.")); 205 OptionPaneUtil.showMessageDialog( 206 Main.parent, 207 tr("Unknown file extension for file ''{0}''", file.toString()), 208 tr("Error"), 209 JOptionPane.ERROR_MESSAGE 210 ); 195 211 return; 196 212 } … … 198 214 } catch (IOException e) { 199 215 e.printStackTrace(); 200 JOptionPane.showMessageDialog(Main.parent, tr("An error occurred while saving.")+"\n"+e.getMessage()); 216 OptionPaneUtil.showMessageDialog( 217 Main.parent, 218 tr("<html>An error occurred while saving. <br>Error is: <br>{0}</html>", e.getMessage()), 219 tr("Error"), 220 JOptionPane.ERROR_MESSAGE 221 ); 201 222 202 223 try { … … 208 229 } catch (IOException e2) { 209 230 e2.printStackTrace(); 210 JOptionPane.showMessageDialog(Main.parent, tr("An error occurred while restoring backup file.")+"\n"+e2.getMessage()); 231 OptionPaneUtil.showMessageDialog( 232 Main.parent, 233 tr("<html>An error occurred while restoring backup file.<br> Error is: <br>{0}</html>", e2.getMessage()), 234 tr("Error"), 235 JOptionPane.ERROR_MESSAGE 236 ); 211 237 } 212 238 } … … 235 261 } 236 262 } else { 237 JOptionPane.showMessageDialog(Main.parent, tr("Unknown file extension.")); 263 OptionPaneUtil.showMessageDialog( 264 Main.parent, 265 tr("Unknown file extension."), 266 tr("Error"), 267 JOptionPane.ERROR_MESSAGE 268 ); 238 269 return; 239 270 } … … 250 281 } catch (IOException e) { 251 282 e.printStackTrace(); 252 JOptionPane.showMessageDialog(Main.parent, tr("An error occurred while restoring backup file.")+"\n"+e.getMessage()); 283 OptionPaneUtil.showMessageDialog( 284 Main.parent, 285 tr("<html>An error occurred while restoring backup file.<br>Error is:<br>{0}</html>", e.getMessage()), 286 tr("Error"), 287 JOptionPane.ERROR_MESSAGE 288 );; 253 289 } 254 290 } -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTaskList.java
r1811 r1847 20 20 import org.openstreetmap.josm.data.osm.DataSet; 21 21 import org.openstreetmap.josm.data.osm.OsmPrimitive; 22 import org.openstreetmap.josm.gui.OptionPaneUtil; 22 23 import org.openstreetmap.josm.gui.download.DownloadDialog.DownloadTask; 23 24 import org.openstreetmap.josm.gui.layer.Layer; … … 100 101 101 102 if(! errors.equals("")) { 102 JOptionPane.showMessageDialog(Main.parent, 103 tr("The following errors occurred during mass download:") + "\r\n" + errors, 103 OptionPaneUtil.showMessageDialog( 104 Main.parent, 105 tr("<html>The following errors occurred during mass download: {0}</html>", errors), 104 106 tr("Errors during Download"), 105 107 JOptionPane.ERROR_MESSAGE); … … 167 169 ); 168 170 169 int ret = JOptionPane.showOptionDialog(171 int ret =OptionPaneUtil.showOptionDialog( 170 172 Main.parent, 171 173 message, … … 173 175 JOptionPane.YES_NO_OPTION, 174 176 JOptionPane.WARNING_MESSAGE, 175 null,176 177 options, 177 178 options[0] -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r1844 r1847 41 41 import org.openstreetmap.josm.gui.MapFrame; 42 42 import org.openstreetmap.josm.gui.MapView; 43 import org.openstreetmap.josm.gui.OptionPaneUtil; 43 44 import org.openstreetmap.josm.gui.SelectionManager; 44 45 import org.openstreetmap.josm.gui.SelectionManager.SelectionEnded; … … 246 247 ((MoveCommand) c).moveAgain(-dx, -dy); 247 248 248 JOptionPane.showMessageDialog(Main.parent, 249 tr("Cannot move objects outside of the world.")); 249 OptionPaneUtil.showMessageDialog( 250 Main.parent, 251 tr("Cannot move objects outside of the world."), 252 tr("Warning"), 253 JOptionPane.WARNING_MESSAGE 254 255 ); 250 256 restoreCursor(); 251 257 return; -
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r1820 r1847 23 23 import org.openstreetmap.josm.data.osm.OsmPrimitive; 24 24 import org.openstreetmap.josm.gui.ExtendedDialog; 25 import org.openstreetmap.josm.gui.OptionPaneUtil; 25 26 import org.openstreetmap.josm.tools.GBC; 26 27 import org.openstreetmap.josm.tools.Shortcut; … … 47 48 return; 48 49 if (Main.map == null) { 49 JOptionPane.showMessageDialog(Main.parent, tr("No data loaded.")); 50 OptionPaneUtil.showMessageDialog( 51 Main.parent, 52 tr("Can't search because there is no loaded data."), 53 tr("Warning"), 54 JOptionPane.WARNING_MESSAGE 55 ); 50 56 return; 51 57 } … … 190 196 } 191 197 Main.map.statusLine.setHelpText(msg); 192 JOptionPane.showMessageDialog(Main.parent, msg); 198 OptionPaneUtil.showMessageDialog( 199 Main.parent, 200 msg, 201 tr("Warning"), 202 JOptionPane.WARNING_MESSAGE 203 ); 193 204 } else { 194 205 Main.map.statusLine.setHelpText(tr("Found {0} matches", foundMatches)); 195 206 } 196 207 } catch (SearchCompiler.ParseError e) { 197 JOptionPane.showMessageDialog(Main.parent, e.getMessage()); 208 OptionPaneUtil.showMessageDialog( 209 Main.parent, 210 e.getMessage(), 211 tr("Error"), 212 JOptionPane.ERROR_MESSAGE 213 214 ); 198 215 } 199 216 } -
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.