Changeset 10124 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2016-04-09T16:08:55+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/dialogs
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java
r10055 r10124 35 35 import org.openstreetmap.josm.Main; 36 36 import org.openstreetmap.josm.actions.AbstractInfoAction; 37 import org.openstreetmap.josm.actions.downloadtasks.ChangesetHeaderDownloadTask; 38 import org.openstreetmap.josm.actions.downloadtasks.PostDownloadHandler; 37 39 import org.openstreetmap.josm.data.osm.Changeset; 38 40 import org.openstreetmap.josm.data.osm.ChangesetCache; … … 44 46 import org.openstreetmap.josm.gui.SideButton; 45 47 import org.openstreetmap.josm.gui.dialogs.changeset.ChangesetCacheManager; 46 import org.openstreetmap.josm.gui.dialogs.changeset.ChangesetHeaderDownloadTask;47 48 import org.openstreetmap.josm.gui.dialogs.changeset.ChangesetInSelectionListModel; 48 49 import org.openstreetmap.josm.gui.dialogs.changeset.ChangesetListCellRenderer; … … 330 331 331 332 @Override 332 public void itemStateChanged(ItemEvent arg0) {333 public void itemStateChanged(ItemEvent e) { 333 334 updateEnabledState(); 334 335 … … 354 355 355 356 @Override 356 public void actionPerformed(ActionEvent arg0) {357 public void actionPerformed(ActionEvent e) { 357 358 ChangesetListModel model = getCurrentChangesetListModel(); 358 359 Set<Integer> sel = model.getSelectedChangesetIds(); … … 360 361 return; 361 362 ChangesetHeaderDownloadTask task = new ChangesetHeaderDownloadTask(sel); 362 Main.worker.submit( task);363 Main.worker.submit(new PostDownloadHandler(task, task.download())); 363 364 } 364 365 … … 368 369 369 370 @Override 370 public void itemStateChanged(ItemEvent arg0) { 371 updateEnabledState(); 372 371 public void itemStateChanged(ItemEvent e) { 372 updateEnabledState(); 373 373 } 374 374 … … 392 392 393 393 @Override 394 public void actionPerformed(ActionEvent arg0) {394 public void actionPerformed(ActionEvent e) { 395 395 List<Changeset> sel = getCurrentChangesetListModel().getSelectedOpenChangesets(); 396 396 if (sel.isEmpty()) … … 404 404 405 405 @Override 406 public void itemStateChanged(ItemEvent arg0) {406 public void itemStateChanged(ItemEvent e) { 407 407 updateEnabledState(); 408 408 } … … 427 427 428 428 @Override 429 public void actionPerformed(ActionEvent arg0) {429 public void actionPerformed(ActionEvent e) { 430 430 Set<Changeset> sel = getCurrentChangesetListModel().getSelectedChangesets(); 431 431 if (sel.isEmpty()) … … 435 435 String baseUrl = Main.getBaseBrowseUrl(); 436 436 for (Changeset cs: sel) { 437 String url = baseUrl + "/changeset/" + cs.getId(); 438 OpenBrowser.displayUrl( 439 url 440 ); 437 OpenBrowser.displayUrl(baseUrl + "/changeset/" + cs.getId()); 441 438 } 442 439 } … … 447 444 448 445 @Override 449 public void itemStateChanged(ItemEvent arg0) {446 public void itemStateChanged(ItemEvent e) { 450 447 updateEnabledState(); 451 448 } … … 469 466 470 467 @Override 471 public void actionPerformed(ActionEvent arg0) {468 public void actionPerformed(ActionEvent e) { 472 469 ChangesetListModel model = getCurrentChangesetListModel(); 473 470 Set<Integer> sel = model.getSelectedChangesetIds(); … … 521 518 } else { 522 519 task = new ChangesetHeaderDownloadTask(toDownload); 523 future = Main.worker.submit( task);520 future = Main.worker.submit(new PostDownloadHandler(task, task.download())); 524 521 } 525 522 -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManager.java
r9916 r10124 40 40 41 41 import org.openstreetmap.josm.Main; 42 import org.openstreetmap.josm.actions.downloadtasks.AbstractChangesetDownloadTask; 43 import org.openstreetmap.josm.actions.downloadtasks.ChangesetContentDownloadTask; 44 import org.openstreetmap.josm.actions.downloadtasks.ChangesetHeaderDownloadTask; 45 import org.openstreetmap.josm.actions.downloadtasks.ChangesetQueryTask; 46 import org.openstreetmap.josm.actions.downloadtasks.PostDownloadHandler; 42 47 import org.openstreetmap.josm.data.osm.Changeset; 43 48 import org.openstreetmap.josm.data.osm.ChangesetCache; … … 46 51 import org.openstreetmap.josm.gui.SideButton; 47 52 import org.openstreetmap.josm.gui.dialogs.changeset.query.ChangesetQueryDialog; 48 import org.openstreetmap.josm.gui.dialogs.changeset.query.ChangesetQueryTask;49 53 import org.openstreetmap.josm.gui.help.ContextSensitiveHelpAction; 50 54 import org.openstreetmap.josm.gui.help.HelpUtil; … … 652 656 public void setSelectedChangesets(Collection<Changeset> changesets) { 653 657 model.setSelectedChangesets(changesets); 654 int idx = model.getSelectionModel().getMinSelectionIndex(); 655 if (idx < 0) return; 656 tblChangesets.scrollRectToVisible(tblChangesets.getCellRect(idx, 0, true)); 658 final int idx = model.getSelectionModel().getMinSelectionIndex(); 659 if (idx < 0) 660 return; 661 GuiHelper.runInEDTAndWait(new Runnable() { 662 @Override 663 public void run() { 664 tblChangesets.scrollRectToVisible(tblChangesets.getCellRect(idx, 0, true)); 665 } 666 }); 657 667 repaint(); 658 668 } … … 696 706 * @param task The changeset download task to run 697 707 */ 698 public void runDownloadTask(final ChangesetDownloadTask task) {699 Main.worker.submit( task);708 public void runDownloadTask(final AbstractChangesetDownloadTask task) { 709 Main.worker.submit(new PostDownloadHandler(task, task.download())); 700 710 Main.worker.submit(new Runnable() { 701 711 @Override 702 712 public void run() { 703 if (task.isCanceled() || task.isFailed()) return; 704 setSelectedChangesets(task.getDownloadedChangesets()); 713 if (task.isCanceled() || task.isFailed()) 714 return; 715 setSelectedChangesets(task.getDownloadedData()); 705 716 } 706 717 }); -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanel.java
r10055 r10124 34 34 import org.openstreetmap.josm.Main; 35 35 import org.openstreetmap.josm.actions.AutoScaleAction; 36 import org.openstreetmap.josm.actions.downloadtasks.ChangesetContentDownloadTask; 36 37 import org.openstreetmap.josm.data.osm.Changeset; 37 38 import org.openstreetmap.josm.data.osm.OsmPrimitive; -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java
r9493 r10124 29 29 import org.openstreetmap.josm.Main; 30 30 import org.openstreetmap.josm.actions.AutoScaleAction; 31 import org.openstreetmap.josm.actions.downloadtasks.ChangesetHeaderDownloadTask; 32 import org.openstreetmap.josm.actions.downloadtasks.PostDownloadHandler; 31 33 import org.openstreetmap.josm.data.osm.Changeset; 32 34 import org.openstreetmap.josm.data.osm.ChangesetCache; … … 298 300 @Override 299 301 public void actionPerformed(ActionEvent evt) { 300 if (currentChangeset == null) return; 301 Main.worker.submit( 302 new ChangesetHeaderDownloadTask( 303 ChangesetDetailPanel.this, 304 Collections.singleton(currentChangeset.getId()) 305 ) 302 if (currentChangeset == null) 303 return; 304 ChangesetHeaderDownloadTask task = new ChangesetHeaderDownloadTask( 305 ChangesetDetailPanel.this, 306 Collections.singleton(currentChangeset.getId()) 306 307 ); 308 Main.worker.submit(new PostDownloadHandler(task, task.download())); 307 309 } 308 310 … … 313 315 314 316 /** 315 * Selects the primitives in the content of this changeset in the current 316 * data layer. 317 * Selects the primitives in the content of this changeset in the current data layer. 317 318 * 318 319 */ -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDiscussionPanel.java
r8840 r10124 21 21 22 22 import org.openstreetmap.josm.Main; 23 import org.openstreetmap.josm.actions.downloadtasks.ChangesetHeaderDownloadTask; 24 import org.openstreetmap.josm.actions.downloadtasks.PostDownloadHandler; 23 25 import org.openstreetmap.josm.data.osm.Changeset; 24 26 import org.openstreetmap.josm.io.OnlineResource; … … 68 70 @Override 69 71 public void actionPerformed(ActionEvent evt) { 70 if (current == null) return; 71 Main.worker.submit( 72 new ChangesetHeaderDownloadTask( 73 ChangesetDiscussionPanel.this, 74 Collections.singleton(current.getId()), 75 true /* include discussion */ 76 ) 72 if (current == null) 73 return; 74 ChangesetHeaderDownloadTask task = new ChangesetHeaderDownloadTask( 75 ChangesetDiscussionPanel.this, 76 Collections.singleton(current.getId()), 77 true /* include discussion */ 77 78 ); 79 Main.worker.submit(new PostDownloadHandler(task, task.download())); 78 80 } 79 81 -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/DownloadChangesetContentAction.java
r9665 r10124 9 9 import javax.swing.AbstractAction; 10 10 11 import org.openstreetmap.josm.actions.downloadtasks.ChangesetContentDownloadTask; 11 12 import org.openstreetmap.josm.tools.CheckParameterUtil; 12 13 -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/SingleChangesetDownloadPanel.java
r9059 r10124 17 17 18 18 import org.openstreetmap.josm.Main; 19 import org.openstreetmap.josm.actions.downloadtasks.ChangesetContentDownloadTask; 19 20 import org.openstreetmap.josm.gui.SideButton; 20 21 import org.openstreetmap.josm.gui.widgets.ChangesetIdTextField;
Note:
See TracChangeset
for help on using the changeset viewer.