Changeset 1811 in josm for trunk/src/org/openstreetmap/josm/gui/dialogs/HistoryDialog.java
- Timestamp:
- 2009-07-19T17:38:55+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/HistoryDialog.java
r1787 r1811 28 28 import javax.swing.JTable; 29 29 import javax.swing.ListSelectionModel; 30 import javax.swing.SwingUtilities;31 30 import javax.swing.event.ListSelectionEvent; 32 31 import javax.swing.event.ListSelectionListener; … … 87 86 * unregisters a {@see HistoryBrowserDialog} 88 87 * @param id the id of the primitive whose history dialog is to be unregistered 89 * 88 * 90 89 */ 91 90 public static void unregisterHistoryBrowserDialog(long id) { … … 98 97 * replies the history dialog for the primitive with id <code>id</code>; null, if 99 98 * no such {@see HistoryBrowserDialog} is currently showing 100 * 99 * 101 100 * @param id the id of the primitive 102 101 * @return the dialog; null, if no such dialog is showing … … 119 118 /** 120 119 * builds the row with the command buttons 121 * 120 * 122 121 * @return the rows with the command buttons 123 122 */ … … 209 208 /** 210 209 * shows the {@see HistoryBrowserDialog} for a given {@see History} 211 * 210 * 212 211 * @param h the history. Must not be null. 213 212 * @exception IllegalArgumentException thrown, if h is null … … 225 224 /** 226 225 * invoked after the asynchronous {@see HistoryLoadTask} is finished. 227 * 226 * 228 227 * @param task the task which is calling back. 229 228 */ … … 261 260 /** 262 261 * The table model with the history items 263 * 262 * 264 263 */ 265 264 class HistoryItemDataModel extends DefaultTableModel implements SelectionChangedListener{ … … 397 396 } 398 397 399 /**400 * update the title of the {@see PleaseWaitDialog} with information about401 * which primitive is currently loaded402 *403 * @param primitive the primitive to be loaded404 */405 protected void notifyStartLoadingHistory(final OsmPrimitive primitive) {406 SwingUtilities.invokeLater(407 new Runnable() {408 public void run() {409 Main.pleaseWaitDlg.setTitle(410 tr("Loading history for {0} with id {1}",411 OsmPrimitiveType.from(primitive).getLocalizedDisplayNameSingular(),412 Long.toString(primitive.id)413 )414 );415 }416 }417 );418 }419 420 /**421 * enables/disables interminate progress indication in the {@see PleaseWaitDialog}422 *423 * @param enabled true, if interminate progress indication is to enabled; false, otherwise424 */425 protected void setInterminateEnabled(final boolean enabled) {426 SwingUtilities.invokeLater(427 new Runnable() {428 public void run() {429 Main.pleaseWaitDlg.setIndeterminate(enabled);430 }431 }432 );433 }434 435 398 @Override 436 399 protected void realRun() throws SAXException, IOException, OsmTransferException { 437 400 Collection<OsmPrimitive> selection = Main.ds.getSelected(); 438 401 Iterator<OsmPrimitive> it = selection.iterator(); 439 setInterminateEnabled(true);440 402 try { 441 403 while(it.hasNext()) { … … 447 409 continue; 448 410 } 449 notifyStartLoadingHistory(primitive); 411 progressMonitor.indeterminateSubTask(tr("Loading history for {0} with id {1}", 412 OsmPrimitiveType.from(primitive).getLocalizedDisplayNameSingular(), 413 Long.toString(primitive.id))); 450 414 OsmServerHistoryReader reader = null; 451 415 HistoryDataSet ds = null; 452 416 try { 453 417 reader = new OsmServerHistoryReader(OsmPrimitiveType.from(primitive), primitive.id); 454 ds = reader.parseHistory( );418 ds = reader.parseHistory(progressMonitor.createSubTaskMonitor(1, false)); 455 419 } catch(OsmTransferException e) { 456 420 if (cancelled) … … 463 427 lastException = e; 464 428 return; 465 } finally {466 setInterminateEnabled(false);467 429 } 468 430 }
Note:
See TracChangeset
for help on using the changeset viewer.