Changeset 2592 in josm for trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
- Timestamp:
- 2009-12-07T21:16:15+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r2566 r2592 37 37 import javax.swing.ButtonGroup; 38 38 import javax.swing.JButton; 39 import javax.swing.JCheckBox; 39 40 import javax.swing.JComboBox; 40 41 import javax.swing.JFileChooser; … … 149 150 if (!sel.getName().equals(wrapper.name)) { 150 151 JOptionPane.showMessageDialog( 151 152 Main.parent, 152 153 tr("File {0} is loaded yet under the name \"{1}\"", sel.getName(), wrapper.name), 153 154 tr("Error"), … … 173 174 x.printStackTrace(); 174 175 JOptionPane.showMessageDialog( 175 Main.parent,176 177 178 179 176 Main.parent, 177 tr("Error while parsing {0}",sel.getName())+": "+x.getMessage(), 178 tr("Error"), 179 JOptionPane.ERROR_MESSAGE 180 ); 180 181 return; 181 182 } catch (IOException x) { 182 183 x.printStackTrace(); 183 184 JOptionPane.showMessageDialog( 184 Main.parent,185 186 187 188 185 Main.parent, 186 tr("Could not read \"{0}\"",sel.getName())+"\n"+x.getMessage(), 187 tr("Error"), 188 JOptionPane.ERROR_MESSAGE 189 ); 189 190 return; 190 191 } … … 293 294 cbTimezones = new JComboBox(vtTimezones); 294 295 295 String tzId = Main.pref.get(" tagimages.timezoneid", "");296 String tzId = Main.pref.get("geoimage.timezoneid", ""); 296 297 TimeZone defaultTz; 297 298 if (tzId.length() == 0) { … … 351 352 352 353 public void actionPerformed(ActionEvent arg0) { 353 JFileChooser fc = new JFileChooser(Main.pref.get(" tagimages.lastdirectory"));354 JFileChooser fc = new JFileChooser(Main.pref.get("geoimage.lastdirectory")); 354 355 fc.setAcceptAllFileFilterUsed(false); 355 356 fc.setMultiSelectionEnabled(false); … … 387 388 while (! isOk) { 388 389 int answer = JOptionPane.showConfirmDialog( 389 Main.parent, panel,390 tr("Synchronize time from a photo of the GPS receiver"),391 392 393 390 Main.parent, panel, 391 tr("Synchronize time from a photo of the GPS receiver"), 392 JOptionPane.OK_CANCEL_OPTION, 393 JOptionPane.QUESTION_MESSAGE 394 ); 394 395 if (answer == JOptionPane.CANCEL_OPTION) { 395 396 return; … … 413 414 String tzValue = selectedTz.substring(pos + 1, selectedTz.length() - 1); 414 415 415 Main.pref.put(" tagimages.timezoneid", tzId);416 Main.pref.put("geoimage.timezoneid", tzId); 416 417 tfOffset.setText(Long.toString(delta / 1000)); 417 418 tfTimezone.setText(tzValue); … … 476 477 panelTf.add(new JLabel(tr("Timezone: ")), gc); 477 478 478 float gpstimezone = Float.parseFloat(Main.pref.get(" tagimages.doublegpstimezone", "0.0"));479 float gpstimezone = Float.parseFloat(Main.pref.get("geoimage.doublegpstimezone", "0.0")); 479 480 if (gpstimezone == 0.0) { 480 gpstimezone = - Long.parseLong(Main.pref.get(" tagimages.gpstimezone", "0"));481 gpstimezone = - Long.parseLong(Main.pref.get("geoimage.gpstimezone", "0")); 481 482 } 482 483 tfTimezone = new JTextField(); … … 498 499 panelTf.add(new JLabel(tr("Offset:")), gc); 499 500 500 long delta = Long.parseLong(Main.pref.get(" tagimages.delta", "0")) / 1000;501 long delta = Long.parseLong(Main.pref.get("geoimage.delta", "0")) / 1000; 501 502 tfOffset = new JTextField(); 502 503 tfOffset.setText(Long.toString(delta)); … … 557 558 panelTf.add(rbUntaggedImg, gc); 558 559 560 gc.gridx = 0; 561 gc.gridy = 5; 562 gc.gridwidth = 2; 563 gc.gridheight = 1; 564 gc.fill = GridBagConstraints.NONE; 565 gc.weightx = gc.weighty = 0.0; 566 yLayer.loadThumbs = Main.pref.getBoolean("geoimage.showThumbs", false); 567 JCheckBox cbShowThumbs = new JCheckBox(tr("Show Thumbnail images on the map"), yLayer.loadThumbs); 568 panelTf.add(cbShowThumbs, gc); 569 559 570 ButtonGroup group = new ButtonGroup(); 560 571 group.add(rbAllImg); … … 573 584 GpxDataWrapper selectedGpx = null; 574 585 while (! isOk) { 575 576 586 ExtendedDialog dialog = new ExtendedDialog( 587 Main.parent, 577 588 tr("Correlate images with GPX track"), 578 589 new String[] { tr("Correlate"), tr("Auto-Guess"), tr("Cancel") } 579 580 581 582 583 584 590 ); 591 592 dialog.setContent(panel); 593 dialog.setButtonIcons(new String[] { "ok.png", "dialogs/geoimage/gpx2imgManual.png", "cancel.png" }); 594 dialog.showDialog(); 595 int answer = dialog.getValue(); 585 596 if(answer != 1 && answer != 2) 586 597 return; … … 624 635 } 625 636 626 Main.pref.put("tagimages.doublegpstimezone", Double.toString(gpstimezone)); 627 Main.pref.put("tagimages.gpstimezone", Long.toString(- ((long) gpstimezone))); 628 Main.pref.put("tagimages.delta", Long.toString(delta * 1000)); 629 637 yLayer.loadThumbs = cbShowThumbs.isSelected(); 638 639 Main.pref.put("geoimage.doublegpstimezone", Double.toString(gpstimezone)); 640 Main.pref.put("geoimage.gpstimezone", Long.toString(- ((long) gpstimezone))); 641 Main.pref.put("geoimage.delta", Long.toString(delta * 1000)); 642 Main.pref.put("geoimage.showThumbs", yLayer.loadThumbs); 630 643 isOk = true; 644 645 if (yLayer.loadThumbs) { 646 Thread tl = new Thread(new ThumbsLoader(yLayer.data)); 647 tl.setPriority(Thread.MIN_PRIORITY); 648 tl.start(); 649 } 650 631 651 } 632 652
Note:
See TracChangeset
for help on using the changeset viewer.