- Timestamp:
- 2016-02-14T23:11:00+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/DownloadAlongAction.java
r8929 r9804 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.GraphicsEnvironment; 6 7 import java.awt.GridBagLayout; 7 8 import java.awt.geom.Area; … … 110 111 tr("<html>This action will require {0} individual<br>" + "download requests. Do you wish<br>to continue?</html>", 111 112 toDownload.size())), GBC.eol()); 112 if ( JOptionPane.OK_OPTION != JOptionPane.showConfirmDialog(Main.parent, msg, title,113 JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE)) {113 if (!GraphicsEnvironment.isHeadless() && JOptionPane.OK_OPTION != JOptionPane.showConfirmDialog( 114 Main.parent, msg, title, JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE)) { 114 115 return; 115 116 } -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityAction.java
r9243 r9804 7 7 import java.awt.Component; 8 8 import java.awt.Dimension; 9 import java.awt.GraphicsEnvironment; 9 10 import java.awt.GridBagLayout; 10 11 import java.awt.event.ActionEvent; … … 271 272 msg.add(scrollPane, GBC.eol().fill(GBC.BOTH)); 272 273 273 // build dialog 274 ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Set track visibility for {0}", layer.getName()), 275 new String[]{tr("Show all"), tr("Show selected only"), tr("Cancel")}); 276 ed.setButtonIcons(new String[]{"eye", "dialogs/filter", "cancel"}); 277 ed.setContent(msg, false); 278 ed.setDefaultButton(2); 279 ed.setCancelButton(3); 280 ed.configureContextsensitiveHelp("/Action/ChooseTrackVisibility", true); 281 ed.setRememberWindowGeometry(getClass().getName() + ".geometry", WindowGeometry.centerInWindow(Main.parent, new Dimension(1000, 500))); 282 ed.showDialog(); 283 dateFilter.saveInPrefs(); 284 int v = ed.getValue(); 285 // cancel for unknown buttons and copy back original settings 286 if (v != 1 && v != 2) { 287 layer.trackVisibility = Arrays.copyOf(trackVisibilityBackup, layer.trackVisibility.length); 288 Main.map.repaint(); 289 return; 274 int v = 1; 275 if (!GraphicsEnvironment.isHeadless()) { 276 // build dialog 277 ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Set track visibility for {0}", layer.getName()), 278 new String[]{tr("Show all"), tr("Show selected only"), tr("Cancel")}); 279 ed.setButtonIcons(new String[]{"eye", "dialogs/filter", "cancel"}); 280 ed.setContent(msg, false); 281 ed.setDefaultButton(2); 282 ed.setCancelButton(3); 283 ed.configureContextsensitiveHelp("/Action/ChooseTrackVisibility", true); 284 ed.setRememberWindowGeometry(getClass().getName() + ".geometry", 285 WindowGeometry.centerInWindow(Main.parent, new Dimension(1000, 500))); 286 ed.showDialog(); 287 dateFilter.saveInPrefs(); 288 v = ed.getValue(); 289 // cancel for unknown buttons and copy back original settings 290 if (v != 1 && v != 2) { 291 layer.trackVisibility = Arrays.copyOf(trackVisibilityBackup, layer.trackVisibility.length); 292 Main.map.repaint(); 293 return; 294 } 290 295 } 291 296 // set visibility (1 = show all, 2 = filter). If no tracks are selected … … 299 304 layer.setVisible(v == 1 || !s.isSelectionEmpty()); 300 305 301 Main.map.mapView.preferenceChanged(null); 302 Main.map.repaint(); 303 } 304 306 if (Main.isDisplayingMapView()) { 307 Main.map.mapView.preferenceChanged(null); 308 } 309 if (Main.map != null) { 310 Main.map.repaint(); 311 } 312 } 305 313 } -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongPanel.java
r8672 r9804 5 5 6 6 import java.awt.Dimension; 7 import java.awt.GraphicsEnvironment; 7 8 import java.awt.GridBagLayout; 8 9 … … 185 186 }); 186 187 187 int ret = HelpAwareOptionPane.showOptionDialog(Main.parent, this, title, 188 JOptionPane.QUESTION_MESSAGE, null, options, options[0], helpTopic); 188 int ret = 0; 189 if (!GraphicsEnvironment.isHeadless()) { 190 ret = HelpAwareOptionPane.showOptionDialog(Main.parent, this, title, 191 JOptionPane.QUESTION_MESSAGE, null, options, options[0], helpTopic); 192 } 189 193 if (0 == ret) { 190 194 rememberSettings(); -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackAction.java
r9078 r9804 23 23 * 24 24 * @author fred 25 * @since 5715 25 26 */ 26 27 public class DownloadAlongTrackAction extends DownloadAlongAction { … … 48 49 } 49 50 50 @Override 51 public void actionPerformed(ActionEvent e) { 52 51 PleaseWaitRunnable createTask() { 53 52 final DownloadAlongPanel panel = new DownloadAlongPanel( 54 53 PREF_DOWNLOAD_ALONG_TRACK_OSM, PREF_DOWNLOAD_ALONG_TRACK_GPS, … … 56 55 57 56 if (0 != panel.showInDownloadDialog(tr("Download from OSM along this track"), HelpUtil.ht("/Action/DownloadAlongTrack"))) { 58 return ;57 return null; 59 58 } 60 59 … … 186 185 } 187 186 188 Main.worker.submit(new CalculateDownloadArea()); 187 return new CalculateDownloadArea(); 188 } 189 190 @Override 191 public void actionPerformed(ActionEvent e) { 192 Main.worker.submit(createTask()); 189 193 } 190 194 }
Note:
See TracChangeset
for help on using the changeset viewer.