~ubuntu-branches/ubuntu/utopic/gpsprune/utopic

« back to all changes in this revision

Viewing changes to tim/prune/function/srtm/LookupSrtmFunction.java

  • Committer: Bazaar Package Importer
  • Author(s): David Paleino
  • Date: 2011-10-20 21:54:34 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20111020215434-fqphir79ryum5mea
Tags: 13.1-1
* New upstream version
  + now defaults looking in ~ for the configuration (Closes: #598983)
  + added OpenSeaMap to background images (Closes: #639502)
* Upstream author renamed it gpsprune, fix various files
* Fix Main-Class in debian/manifest

Show diffs side-by-side

added added

removed removed

Lines of Context:
104
104
                cancelButton.addActionListener(new ActionListener() {
105
105
                        public void actionPerformed(ActionEvent e) {
106
106
                                _cancelled = true;
 
107
                                _dialog.dispose();
107
108
                        }
108
109
                });
109
110
                buttonPanel.add(cancelButton);
178
179
                _progressBar.setMaximum(inTileList.size());
179
180
                _progressBar.setIndeterminate(inTileList.size() <= 1);
180
181
                _progressBar.setValue(0);
 
182
                String errorMessage = null;
181
183
                // Get urls for each tile
182
184
                URL[] urls = TileFinder.getUrls(inTileList);
183
185
                for (int t=0; t<inTileList.size() && !_cancelled; t++)
185
187
                        if (urls[t] != null)
186
188
                        {
187
189
                                SrtmTile tile = inTileList.get(t);
188
 
                                // System.out.println("tile " + t + " of " + tileList.size() + " = " + urls[t].toString());
189
 
                                try {
 
190
                                try
 
191
                                {
190
192
                                        _progressBar.setValue(t);
191
193
                                        final int ARRLENGTH = 1201*1201;
192
194
                                        int[] heights = new int[ARRLENGTH];
247
249
                                        }
248
250
                                }
249
251
                                catch (IOException ioe) {
250
 
                                        //System.err.println("eek - " + ioe.getMessage());
 
252
                                        errorMessage = ioe.getClass().getName() + " - " + ioe.getMessage();
251
253
                                }
252
254
                        }
253
255
                }
254
256
                _dialog.dispose();
 
257
                if (_cancelled) {return;}
255
258
                if (numAltitudesFound > 0)
256
259
                {
257
260
                        // Inform app including undo information
260
263
                        _app.completeFunction(undo, I18nManager.getText("confirm.lookupsrtm1") + " " + numAltitudesFound
261
264
                                + " " + I18nManager.getText("confirm.lookupsrtm2"));
262
265
                }
 
266
                else if (errorMessage != null) {
 
267
                        _app.showErrorMessageNoLookup(getNameKey(), errorMessage);
 
268
                }
263
269
                else if (inTileList.size() > 0) {
264
270
                        _app.showErrorMessage(getNameKey(), "error.lookupsrtm.nonefound");
265
271
                }