Changeset 1397 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2009-02-14T12:25:54+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
r1169 r1397 38 38 import org.openstreetmap.josm.data.osm.TigerUtils; 39 39 import org.openstreetmap.josm.data.osm.Way; 40 import org.openstreetmap.josm.gui.ExtendedDialog; 40 41 import org.openstreetmap.josm.tools.GBC; 41 42 import org.openstreetmap.josm.tools.Pair; … … 108 109 for (HashSet<Way> waylinks : backlinks.values()) { 109 110 if (!waylinks.containsAll(selectedWays)) { 110 int option = JOptionPane.showConfirmDialog(Main.parent, 111 tr("The selected ways have differing relation memberships. " 112 + "Do you still want to combine them?"), 113 tr("Combine ways with different memberships?"), 114 JOptionPane.YES_NO_OPTION); 115 if (option == JOptionPane.YES_OPTION) 116 break; 111 int option = new ExtendedDialog(Main.parent, 112 tr("Combine ways with different memberships?"), 113 tr("The selected ways have differing relation memberships. " 114 + "Do you still want to combine them?"), 115 new String[] {tr("Combine Anyway"), tr("Cancel")}, 116 new String[] {"combineway.png", "cancel.png"}).getValue(); 117 if (option == 1) break; 118 117 119 return; 118 120 } … … 136 138 Object secondTry = actuallyCombineWays(selectedWays, true); 137 139 if (secondTry instanceof List) { 138 int option = JOptionPane.showConfirmDialog(Main.parent, 140 int option = new ExtendedDialog(Main.parent, 141 tr("Change directions?"), 139 142 tr("The ways can not be combined in their current directions. " 140 + "Do you want to reverse some of them?"), tr("Change directions?"), 141 JOptionPane.YES_NO_OPTION); 142 if (option != JOptionPane.YES_OPTION) { 143 return; 144 } 143 + "Do you want to reverse some of them?"), 144 new String[] {tr("Reverse and Combine"), tr("Cancel")}, 145 new String[] {"wayflip.png", "cancel.png"}).getValue(); 146 if (option != 1) return; 145 147 nodeList = (List<Node>) secondTry; 146 148 } else { … … 191 193 192 194 if (!components.isEmpty()) { 193 int answer = JOptionPane.showConfirmDialog(Main.parent, p, tr("Enter values for all conflicts."), JOptionPane.OK_CANCEL_OPTION); 194 if (answer != JOptionPane.OK_OPTION) 195 return; 195 int answer = new ExtendedDialog(Main.parent, 196 tr("Enter values for all conflicts."), 197 p, 198 new String[] {tr("Solve Conflicts"), tr("Cancel")}, 199 new String[] {"dialogs/conflict.png", "cancel.png"}).getValue(); 200 if (answer != 1) return; 201 196 202 for (Entry<String, JComboBox> e : components.entrySet()) 197 203 newWay.put(e.getKey(), e.getValue().getEditor().getItem().toString()); -
trunk/src/org/openstreetmap/josm/actions/DiskAccessAction.java
r1180 r1397 10 10 11 11 import org.openstreetmap.josm.Main; 12 import org.openstreetmap.josm.gui.ExtendedDialog; 12 13 import org.openstreetmap.josm.tools.Shortcut; 13 14 … … 43 44 if (!open) { 44 45 File file = fc.getSelectedFile(); 45 if (file == null || (file.exists() && JOptionPane.YES_OPTION != 46 JOptionPane.showConfirmDialog(Main.parent, tr("File exists. Overwrite?"), tr("Overwrite"), JOptionPane.YES_NO_OPTION))) 46 if (file == null || (file.exists() && 1 != 47 new ExtendedDialog(Main.parent, 48 tr("Overwrite"), 49 tr("File exists. Overwrite?"), 50 new String[] {tr("Overwrite"), tr("Cancel")}, 51 new String[] {"save_as.png", "cancel.png"}).getValue())) 47 52 return null; 48 53 } -
trunk/src/org/openstreetmap/josm/actions/GpxExportAction.java
r1212 r1397 32 32 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 33 33 import org.openstreetmap.josm.io.GpxWriter; 34 import org.openstreetmap.josm.gui.ExtendedDialog; 34 35 import org.openstreetmap.josm.tools.GBC; 35 36 import org.openstreetmap.josm.tools.Shortcut; … … 111 112 p.add(keywords, GBC.eop().fill(GBC.HORIZONTAL)); 112 113 113 int answer = JOptionPane.showConfirmDialog(Main.parent, p, tr("Export options"), JOptionPane.OK_CANCEL_OPTION); 114 if (answer != JOptionPane.OK_OPTION) 114 int answer = new ExtendedDialog(Main.parent, 115 tr("Export options"), 116 p, 117 new String[] {tr("Export and Save"), tr("Cancel")}, 118 new String[] {"exportgpx.png", "cancel.png"}).getValue(); 119 if (answer != 1) 115 120 return; 116 121 -
trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
r1169 r1397 38 38 import org.openstreetmap.josm.data.osm.Way; 39 39 import org.openstreetmap.josm.data.osm.visitor.CollectBackReferencesVisitor; 40 import org.openstreetmap.josm.gui.ExtendedDialog; 40 41 import org.openstreetmap.josm.tools.GBC; 41 42 import org.openstreetmap.josm.tools.Pair; … … 144 145 for (HashSet<Node> nodelinks : backlinks.values()) { 145 146 if (!nodelinks.containsAll(allNodes)) { 146 int option = JOptionPane.showConfirmDialog(Main.parent,147 tr("The selected nodes have differing relation memberships. "148 + "Do you still want to merge them?"),149 tr("Merge nodes with different memberships?"),150 JOptionPane.YES_NO_OPTION);151 if (option == JOptionPane.YES_OPTION)152 147 int option = new ExtendedDialog(Main.parent, 148 tr("Merge nodes with different memberships?"), 149 tr("The selected nodes have differing relation memberships. " 150 + "Do you still want to merge them?"), 151 new String[] {tr("Merge Anyway"), tr("Cancel")}, 152 new String[] {"mergenodes.png", "cancel.png"}).getValue(); 153 if (option == 1) break; 153 154 return null; 154 155 } … … 191 192 192 193 if (!components.isEmpty()) { 193 int answer = JOptionPane.showConfirmDialog(Main.parent, p, tr("Enter values for all conflicts."), JOptionPane.OK_CANCEL_OPTION); 194 if (answer != JOptionPane.OK_OPTION) 194 int answer = new ExtendedDialog(Main.parent, 195 tr("Enter values for all conflicts."), 196 p, 197 new String[] {tr("Solve Conflicts"), tr("Cancel")}, 198 new String[] {"dialogs/conflict.png", "cancel.png"}).getValue(); 199 if (answer != 1) 195 200 return null; 196 201 for (Entry<String, JComboBox> e : components.entrySet()) -
trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java
r1195 r1397 24 24 import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask; 25 25 import org.openstreetmap.josm.data.osm.DataSet; 26 import org.openstreetmap.josm.gui.ExtendedDialog; 26 27 import org.openstreetmap.josm.gui.layer.GpxLayer; 27 28 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 55 56 layer.setSelected(Main.pref.getBoolean("download.newlayer")); 56 57 JPanel all = new JPanel(new GridBagLayout()); 57 all.add(new JLabel( "Enter URL to download:"), GBC.eol());58 all.add(new JLabel(tr("Enter URL to download:")), GBC.eol()); 58 59 JTextField urltext = new JTextField(40); 59 60 all.add(urltext, GBC.eol()); 60 61 all.add(layer, GBC.eol()); 61 int answer = JOptionPane.showConfirmDialog(Main.parent, all, tr("Download Location"), JOptionPane.OK_CANCEL_OPTION); 62 if (answer != JOptionPane.OK_OPTION) 63 return; 62 int answer = new ExtendedDialog(Main.parent, 63 tr("Download Location"), 64 all, 65 new String[] {tr("Download URL"), tr("Cancel")}, 66 new String[] {"download.png", "cancel.png"}).getValue(); 67 if (answer != 1) return; 64 68 openUrl(layer.isSelected(), urltext.getText()); 65 69 } -
trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java
r1373 r1397 17 17 import org.openstreetmap.josm.Main; 18 18 import org.openstreetmap.josm.data.osm.OsmPrimitive; 19 import org.openstreetmap.josm.gui.ExtendedDialog; 19 20 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 20 21 import org.openstreetmap.josm.gui.layer.Layer; … … 78 79 } 79 80 80 if (layer instanceof OsmDataLayer && isDataSetEmpty((OsmDataLayer)layer) && JOptionPane.NO_OPTION == JOptionPane.showConfirmDialog(Main.parent,tr("The document contains no data. Save anyway?"), tr("Empty document"), JOptionPane.YES_NO_OPTION)) {81 if (layer instanceof OsmDataLayer && isDataSetEmpty((OsmDataLayer)layer) && 1 != new ExtendedDialog(Main.parent, tr("Empty document"), tr("The document contains no data."), new String[] {tr("Save anyway"), tr("Cancel")}, new String[] {"save.png", "cancel.png"}).getValue()) { 81 82 return false; 82 83 } … … 85 86 } 86 87 if (!Main.map.conflictDialog.conflicts.isEmpty()) { 87 int answer = JOptionPane.showConfirmDialog(Main.parent, 88 tr("There are unresolved conflicts. Conflicts will not be saved and handled as if you rejected all. Continue?"),tr("Conflicts"), JOptionPane.YES_NO_OPTION); 89 if (answer != JOptionPane.YES_OPTION) 90 return false; 88 int answer = new ExtendedDialog(Main.parent, 89 tr("Conflicts"), 90 tr("There are unresolved conflicts. Conflicts will not be saved and handled as if you rejected all. Continue?"), 91 new String[] {tr("Reject Conflicts and Save"), tr("Cancel")}, 92 new String[] {"save.png", "cancel.png"}).getValue(); 93 94 if (answer != 1) return false; 91 95 } 92 96 return true; -
trunk/src/org/openstreetmap/josm/actions/UploadAction.java
r1212 r1397 18 18 import org.openstreetmap.josm.Main; 19 19 import org.openstreetmap.josm.data.osm.OsmPrimitive; 20 import org.openstreetmap.josm.gui.ExtendedDialog; 20 21 import org.openstreetmap.josm.gui.OsmPrimitivRenderer; 21 22 import org.openstreetmap.josm.gui.PleaseWaitRunnable; … … 98 99 } 99 100 100 return JOptionPane.showConfirmDialog(Main.parent, p, tr("Upload these changes?"), 101 JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION; 101 return new ExtendedDialog(Main.parent, 102 tr("Upload these changes?"), 103 p, 104 new String[] {tr("Upload Changes"), tr("Cancel")}, 105 new String[] {"upload.png", "cancel.png"}).getValue() == 1; 102 106 } 103 107 }); -
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r1375 r1397 21 21 import org.openstreetmap.josm.actions.JosmAction; 22 22 import org.openstreetmap.josm.data.osm.OsmPrimitive; 23 import org.openstreetmap.josm.gui.ExtendedDialog; 23 24 import org.openstreetmap.josm.tools.GBC; 24 25 import org.openstreetmap.josm.tools.Shortcut; … … 55 56 JLabel label = new JLabel(tr("Please enter a search string.")); 56 57 final JTextField input = new JTextField(initialValues.text); 58 input.selectAll(); 59 input.requestFocusInWindow(); 57 60 JRadioButton replace = new JRadioButton(tr("replace selection"), initialValues.mode == SearchMode.replace); 58 61 JRadioButton add = new JRadioButton(tr("add to selection"), initialValues.mode == SearchMode.add); … … 99 102 p.add(left); 100 103 p.add(right); 101 102 JOptionPane pane = new JOptionPane(p, JOptionPane.INFORMATION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null) { 103 @Override 104 public void selectInitialValue() { 105 input.requestFocusInWindow(); 106 input.selectAll(); 107 } 108 }; 109 pane.createDialog(Main.parent, tr("Search")).setVisible(true); 110 if (!Integer.valueOf(JOptionPane.OK_OPTION).equals(pane.getValue())) 111 return; 104 105 int result = new ExtendedDialog(Main.parent, 106 tr("Search"), 107 p, 108 new String[] {tr("Start Search"), tr("Cancel")}, 109 new String[] {"dialogs/search.png", "cancel.png"}).getValue(); 110 if(result != 1) return; 111 112 112 // User pressed OK - let's perform the search 113 113 SearchMode mode = replace.isSelected() ? SearchAction.SearchMode.replace
Note:
See TracChangeset
for help on using the changeset viewer.