Changeset 16784 in osm for applications/editors/josm/plugins
- Timestamp:
- 2009-08-03T11:12:23+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/agpifoj
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/agpifoj/build.xml
r16603 r16784 34 34 <attribute name="Plugin-Early" value="false"/> 35 35 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/AgPifoJ"/> 36 <attribute name="Plugin-Mainversion" value="18 15"/>36 <attribute name="Plugin-Mainversion" value="1893"/> 37 37 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 38 38 </manifest> -
applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojLayer.java
r16603 r16784 121 121 if (cancelled) { 122 122 return; 123 } 123 } 124 progressMonitor.subTask(tr("Read photos...")); 125 progressMonitor.setTicksCount(files.size()); 124 126 125 127 progressMonitor.subTask(tr("Read photos...")); … … 154 156 layer = new AgpifojLayer(data); 155 157 files.clear(); 156 progressMonitor.setErrorMessage(errorMessage); 158 if (errorMessage != null && ! errorMessage.trim().equals("")) { 159 progressMonitor.setErrorMessage(errorMessage); 160 } 157 161 } 158 162 … … 194 198 errorMessage += tr("Found null file in directory {0}\n", f.getPath()); 195 199 } 200 progressMonitor.finishTask(); 196 201 } else { 197 202 errorMessage += tr("Error while getting files from directory {0}\n", f.getPath()); … … 264 269 265 270 return new Component[] { 266 new JMenuItem( new LayerListDialog.ShowHideLayerAction(this)),267 new JMenuItem( new LayerListDialog.DeleteLayerAction(this)),271 new JMenuItem(LayerListDialog.getInstance().createShowHideLayerAction(this)), 272 new JMenuItem(LayerListDialog.getInstance().createDeleteLayerAction(this)), 268 273 new JMenuItem(new RenameLayerAction(null, this)), 269 274 new JSeparator(), … … 323 328 } 324 329 325 name = l.name;330 setName(l.getName()); 326 331 327 332 } … … 471 476 return; 472 477 } 473 if ( visible)478 if (isVisible()) 474 479 Main.map.mapView.repaint(); 475 480 } … … 479 484 return; 480 485 } 481 if (! visible) {486 if (!isVisible()) { 482 487 return; 483 488 } -
applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojPlugin.java
r13927 r16784 82 82 * an alternative Painter. 83 83 */ 84 @Override 84 85 public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) { 85 86 if (newFrame != null) { -
applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/CorrelateGpxWithImages.java
r16603 r16784 59 59 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 60 60 import org.openstreetmap.josm.gui.ExtendedDialog; 61 import org.openstreetmap.josm.gui.OptionPaneUtil; 61 62 import org.openstreetmap.josm.gui.layer.GpxLayer; 62 63 import org.openstreetmap.josm.gui.layer.Layer; … … 147 148 cbGpx.setSelectedIndex(i); 148 149 if (!sel.getName().equals(wrapper.name)) { 149 JOptionPane.showMessageDialog(Main.parent, 150 tr("File {0} is loaded yet under the name \"{1}\"", sel.getName(), wrapper.name)); 150 OptionPaneUtil.showMessageDialog( 151 Main.parent, 152 tr("File {0} is loaded yet under the name \"{1}\"", sel.getName(), wrapper.name), 153 tr("Error"), 154 JOptionPane.ERROR_MESSAGE 155 ); 151 156 } 152 157 return; … … 167 172 } catch (SAXException x) { 168 173 x.printStackTrace(); 169 JOptionPane.showMessageDialog(Main.parent, tr("Error while parsing {0}",sel.getName())+": "+x.getMessage()); 174 OptionPaneUtil.showMessageDialog( 175 Main.parent, 176 tr("Error while parsing {0}",sel.getName())+": "+x.getMessage(), 177 tr("Error"), 178 JOptionPane.ERROR_MESSAGE 179 ); 170 180 return; 171 181 } catch (IOException x) { 172 182 x.printStackTrace(); 173 JOptionPane.showMessageDialog(Main.parent, tr("Could not read \"{0}\"",sel.getName())+"\n"+x.getMessage()); 183 OptionPaneUtil.showMessageDialog( 184 Main.parent, 185 tr("Could not read \"{0}\"",sel.getName())+"\n"+x.getMessage(), 186 tr("Error"), 187 JOptionPane.ERROR_MESSAGE 188 ); 174 189 return; 175 190 } … … 371 386 boolean isOk = false; 372 387 while (! isOk) { 373 int answer = JOptionPane.showConfirmDialog(Main.parent, panel, tr("Synchronize time from a photo of the GPS receiver"), JOptionPane.OK_CANCEL_OPTION); 388 int answer = OptionPaneUtil.showConfirmationDialog( 389 Main.parent, panel, 390 tr("Synchronize time from a photo of the GPS receiver"), 391 JOptionPane.OK_CANCEL_OPTION, 392 JOptionPane.QUESTION_MESSAGE 393 ); 374 394 if (answer == JOptionPane.CANCEL_OPTION) { 375 395 return; … … 382 402 - dateFormat.parse(tfGpsTime.getText()).getTime(); 383 403 } catch(ParseException e) { 384 JOptionPane.showMessageDialog(Main.parent, tr("Error while parsing the date.\n"404 OptionPaneUtil.showMessageDialog(Main.parent, tr("Error while parsing the date.\n" 385 405 + "Please use the requested format"), 386 406 tr("Invalid date"), JOptionPane.ERROR_MESSAGE ); … … 415 435 Layer cur = iterLayer.next(); 416 436 if (cur instanceof GpxLayer) { 417 gpxLst.add(new GpxDataWrapper(((GpxLayer) cur). name,437 gpxLst.add(new GpxDataWrapper(((GpxLayer) cur).getName(), 418 438 ((GpxLayer) cur).data, 419 439 ((GpxLayer) cur).data.storageFile)); … … 566 586 567 587 if (item == null || ! (item instanceof GpxDataWrapper)) { 568 JOptionPane.showMessageDialog(Main.parent, tr("You should select a GPX track"),588 OptionPaneUtil.showMessageDialog(Main.parent, tr("You should select a GPX track"), 569 589 tr("No selected GPX track"), JOptionPane.ERROR_MESSAGE ); 570 590 continue; … … 579 599 Float timezoneValue = parseTimezone(tfTimezone.getText().trim()); 580 600 if (timezoneValue == null) { 581 JOptionPane.showMessageDialog(Main.parent, tr("Error while parsing timezone.\nExpected format: {0}", "+H:MM"),601 OptionPaneUtil.showMessageDialog(Main.parent, tr("Error while parsing timezone.\nExpected format: {0}", "+H:MM"), 582 602 tr("Invalid timezone"), JOptionPane.ERROR_MESSAGE); 583 603 continue; … … 592 612 delta = Long.parseLong(deltaText); 593 613 } catch(NumberFormatException nfe) { 594 JOptionPane.showMessageDialog(Main.parent, tr("Error while parsing offset.\nExpected format: {0}", "number"),614 OptionPaneUtil.showMessageDialog(Main.parent, tr("Error while parsing offset.\nExpected format: {0}", "number"), 595 615 tr("Invalid offset"), JOptionPane.ERROR_MESSAGE); 596 616 continue; … … 671 691 // no images found, exit 672 692 if(autoImgs.size() <= 0) { 673 JOptionPane.showMessageDialog(Main.parent,693 OptionPaneUtil.showMessageDialog(Main.parent, 674 694 tr("The selected photos don't contain time information."), 675 695 tr("Photos don't contain time information"), JOptionPane.WARNING_MESSAGE); … … 707 727 // No GPX timestamps found, exit 708 728 if(firstGPXDate < 0) { 709 JOptionPane.showMessageDialog(Main.parent,729 OptionPaneUtil.showMessageDialog(Main.parent, 710 730 tr("The selected GPX track doesn't contain timestamps. Please select another one."), 711 731 tr("GPX Track has no time information"), JOptionPane.WARNING_MESSAGE); … … 804 824 sldTimezone = new JSlider(-24, 24, 0); 805 825 sldTimezone.setPaintLabels(true); 806 Hashtable labelTable = new Hashtable();826 Hashtable<Integer,JLabel> labelTable = new Hashtable<Integer, JLabel>(); 807 827 labelTable.put(-24, new JLabel("-12:00")); 808 828 labelTable.put(-12, new JLabel( "-6:00")); … … 844 864 sldSeconds.setValue(offset%60); 845 865 } catch(Exception e) { 846 JOptionPane.showMessageDialog(Main.parent,866 OptionPaneUtil.showMessageDialog(Main.parent, 847 867 tr("An error occurred while trying to match the photos to the GPX track." 848 868 +" You can adjust the sliders to manually match the photos."),
Note:
See TracChangeset
for help on using the changeset viewer.