Changeset 16603 in osm for applications/editors/josm/plugins/agpifoj/src
- Timestamp:
- 2009-07-21T07:42:53+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojLayer.java
r16315 r16603 30 30 import org.openstreetmap.josm.actions.RenameLayerAction; 31 31 import org.openstreetmap.josm.data.coor.CachedLatLon; 32 import org.openstreetmap.josm.data.coor.EastNorth;33 32 import org.openstreetmap.josm.data.coor.LatLon; 34 33 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; … … 103 102 private final File[] selection; 104 103 private HashSet<String> loadedDirectories = new HashSet<String>(); 104 private String errorMessage = ""; 105 105 106 106 public Loader(File[] selection) { … … 111 111 @Override protected void realRun() throws IOException { 112 112 113 Main.pleaseWaitDlg.currentAction.setText(tr("Starting directory scan"));113 progressMonitor.subTask(tr("Starting directory scan")); 114 114 List<File> files = new ArrayList<File>(); 115 115 try { … … 123 123 } 124 124 125 Main.pleaseWaitDlg.currentAction.setText(tr("Read photos...")); 125 progressMonitor.subTask(tr("Read photos...")); 126 progressMonitor.setTicksCount(files.size()); 126 127 127 128 // read the image files 128 129 ArrayList<ImageEntry> data = new ArrayList<ImageEntry>(files.size()); 129 130 130 int progress = 0;131 Main.pleaseWaitDlg.progress.setMaximum(files.size());132 Main.pleaseWaitDlg.progress.setValue(progress);133 134 131 for (File f : files) { 135 132 … … 138 135 } 139 136 140 Main.pleaseWaitDlg.currentAction.setText(tr("Reading {0}...", f.getName()));141 Main.pleaseWaitDlg.progress.setValue(progress++);137 progressMonitor.subTask(tr("Reading {0}...", f.getName())); 138 progressMonitor.worked(1); 142 139 143 140 ImageEntry e = new ImageEntry(); … … 157 154 layer = new AgpifojLayer(data); 158 155 files.clear(); 156 progressMonitor.setErrorMessage(errorMessage); 159 157 } 160 158 … … 189 187 File[] children = f.listFiles(AgpifojPlugin.JPEG_FILE_FILTER); 190 188 if (children != null) { 191 Main.pleaseWaitDlg.currentAction.setText(tr("Scanning directory {0}", f.getPath()));189 progressMonitor.subTask(tr("Scanning directory {0}", f.getPath())); 192 190 try { 193 191 addRecursiveFiles(files, children); … … 197 195 } 198 196 } else { 199 197 errorMessage += tr("Error while getting files from directory {0}\n", f.getPath()); 200 198 } 201 199 -
applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/CorrelateGpxWithImages.java
r16315 r16603 10 10 import java.awt.Cursor; 11 11 import java.awt.Dimension; 12 import java.awt.event.ActionEvent;13 import java.awt.event.ActionListener;14 12 import java.awt.FlowLayout; 15 13 import java.awt.GridBagConstraints; 16 14 import java.awt.GridBagLayout; 15 import java.awt.event.ActionEvent; 16 import java.awt.event.ActionListener; 17 17 import java.io.File; 18 18 import java.io.FileInputStream; 19 import java.io.IOException; 19 20 import java.io.InputStream; 20 import java.io.IOException;21 21 import java.text.ParseException; 22 22 import java.text.SimpleDateFormat; … … 35 35 import javax.swing.AbstractListModel; 36 36 import javax.swing.ButtonGroup; 37 import javax.swing.event.ChangeEvent;38 import javax.swing.event.ChangeListener;39 import javax.swing.event.ListSelectionEvent;40 import javax.swing.event.ListSelectionListener;41 import javax.swing.filechooser.FileFilter;42 37 import javax.swing.JButton; 43 38 import javax.swing.JComboBox; … … 52 47 import javax.swing.JTextField; 53 48 import javax.swing.ListSelectionModel; 54 55 import org.openstreetmap.josm.data.coor.EastNorth; 49 import javax.swing.event.ChangeEvent; 50 import javax.swing.event.ChangeListener; 51 import javax.swing.event.ListSelectionEvent; 52 import javax.swing.event.ListSelectionListener; 53 import javax.swing.filechooser.FileFilter; 54 55 import org.openstreetmap.josm.Main; 56 56 import org.openstreetmap.josm.data.gpx.GpxData; 57 57 import org.openstreetmap.josm.data.gpx.GpxTrack; … … 62 62 import org.openstreetmap.josm.gui.layer.Layer; 63 63 import org.openstreetmap.josm.io.GpxReader; 64 import org.openstreetmap.josm.Main;65 64 import org.openstreetmap.josm.plugins.agpifoj.AgpifojLayer.ImageEntry; 66 65 import org.openstreetmap.josm.tools.ExifReader; … … 678 677 } 679 678 680 // Free the user's vision681 Main.pleaseWaitDlg.setVisible(false);682 679 AgpifojDialog dialog = AgpifojDialog.getInstance(); 683 680 dialog.action.button.setSelected(true);
Note:
See TracChangeset
for help on using the changeset viewer.