Issue #3553 - Force redisplay of data set table after all labels are generated.

Change-Id: Ie8c0195414102d046e5348e778ba8d5e1053e5ec

Former-commit-id: 6f8c6d6aa1 [formerly 6f8c6d6aa1 [formerly bcc9b0a6352151dfdf3ba75063bb87308cb162b4]]
Former-commit-id: ef5dfb1f93
Former-commit-id: fe50853adb
This commit is contained in:
Roger Ferrel 2014-08-26 10:24:25 -05:00
parent 8e073ab401
commit 86d4730538
4 changed files with 44 additions and 18 deletions

View file

@ -53,6 +53,7 @@ import com.raytheon.uf.common.time.util.TimeUtil;
* Dec 11, 2013 #2624 rferrel Clear display variables when recomputing sizes.
* Mar 27, 2014 #2879 rferrel Loading Case no longer changes Start/End times.
* Apr 23, 2014 #3045 rferrel Changes to prevent race condition while getting labels.
* Aug 26, 2014 #3553 rferrel Option to force update of table's display data.
*
* </pre>
*
@ -157,7 +158,7 @@ public class SizeJob extends Job {
private boolean stopComputeSize;
/**
* Priority queue for getting display data all archive/category tables.
* Priority queue for getting display data for all archive/category tables.
*/
// Do not use a PriorityBlockingQueue since the load select and change
// display methods need to be notified when the display data is available.
@ -473,11 +474,11 @@ public class SizeJob extends Job {
* @return displayData
*/
public List<DisplayData> changeDisplay(String archiveName,
String categoryName, AtomicBoolean shutdown) {
String categoryName, AtomicBoolean shutdown, boolean forceUpdate) {
List<DisplayData> displayDatas = null;
// Only get data when the display really needs to be changed.
if (!archiveName.equals(displayArchive)
if (forceUpdate || !archiveName.equals(displayArchive)
|| !categoryName.equals(displayCategory)) {
// Update visible status of current display.

View file

@ -82,6 +82,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Apr 15, 2014 3034 lvenable Added dispose checks in runAsync calls.
* Apr 10, 2014 3023 rferrel Added setTotalSelectedSize method.
* Apr 23, 2014 3045 rferrel Changes to prevent race condition while getting labels.
* Aug 26, 2014 3553 rferrel Force redisplay of table after getting all display labels.
*
* </pre>
*
@ -146,6 +147,9 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
/** Job running to populate the currently selected archive/category. */
private Job populateTableJob = null;
/** Flag to indicate all labels for all tables are loaded. */
protected volatile boolean haveAllLabels = false;
/**
* @param parentShell
*/
@ -360,6 +364,9 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
*/
protected void createTable() {
tableComp = new ArchiveTableComp(shell, type, this, sizeJob);
// Indicate loading the table labels.
tableComp
.setCursor(shell.getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
sizeJob.addUpdateListener(this);
}
@ -491,6 +498,13 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
* adjust sizes on the display table.
*/
protected void populateTableComp() {
populateTableComp(false);
}
/**
* @param forceUpdate
*/
protected void populateTableComp(final boolean forceUpdate) {
final String archiveName = getSelectedArchiveName();
final String categoryName = getSelectedCategoryName();
@ -508,7 +522,8 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
@Override
protected IStatus run(IProgressMonitor monitor) {
getCategoryTableData(archiveName, categoryName, shutdown);
getCategoryTableData(archiveName, categoryName, shutdown,
forceUpdate);
// Just populated the current table update cursor.
if (!shutdown.get()) {
@ -543,7 +558,8 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
* @param shutdown
*/
private void getCategoryTableData(final String archiveName,
final String categoryName, final AtomicBoolean shutdown) {
final String categoryName, final AtomicBoolean shutdown,
boolean forceUpdate) {
if (!sizeJob.isCurrentDisplay(archiveName, categoryName)) {
VizApp.runAsync(new Runnable() {
@ -558,7 +574,7 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
}
final List<DisplayData> displayDatas = sizeJob.changeDisplay(
archiveName, categoryName, shutdown);
archiveName, categoryName, shutdown, forceUpdate);
VizApp.runAsync(new Runnable() {
@ -695,6 +711,8 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
.setToolTipText("Change display to show all case selections");
}
}
} else {
showingSelected = false;
}
}
@ -838,9 +856,23 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
}
/**
* Allows sub-class to perform updates once all the display data is loaded.
* Perform updates once all the display data is loaded.
*/
abstract public void loadedAllDisplayData();
public void loadedAllDisplayData() {
VizApp.runAsync(new Runnable() {
@Override
public void run() {
haveAllLabels = true;
if (showingSelected) {
populateSelectAllTable();
} else {
populateTableComp(true);
}
tableComp.setCursor(null);
}
});
}
/**
* When unsaved modifications this asks the user to verify the close.

View file

@ -59,6 +59,7 @@ import com.raytheon.uf.common.time.util.TimeUtil;
* Apr 14, 2014 #3023 rferrel Code clean up.
* Apr 24, 2014 #3045 rferrel Implement loadedAllDsipalyData.
* May 28, 2014 #3171 rferrel Change retention labels.
* Aug 26, 2014 #3553 rferrel No longer need to override loadedAllDisplayData.
*
* </pre>
*
@ -423,9 +424,4 @@ public class ArchiveRetentionDlg extends AbstractArchiveDlg {
archiveComboSelection();
categoryComboSelection();
}
@Override
public void loadedAllDisplayData() {
// nothing to update.
}
}

View file

@ -78,6 +78,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Mar 26, 2014 32880 rferrerl Implement case compression and split.
* Apr 23, 2014 #3045 rferrel To prevent race condition only allow a case
* load after all labels are loaded.
* Aug 26, 2014 #3553 rferrel loadedAllDisplayData must now call its super.
*
* </pre>
*
@ -171,9 +172,6 @@ public class CaseCreationDlg extends AbstractArchiveDlg {
/** Manager for configurable values for the dialog. */
private final CaseCreationManager ccManager;
/** Flag to indicate all labels for all tables are loaded. */
private volatile boolean haveAllLabels = false;
/**
* Constructor.
*
@ -1112,8 +1110,6 @@ public class CaseCreationDlg extends AbstractArchiveDlg {
*/
@Override
public void loadedAllDisplayData() {
haveAllLabels = true;
/*
* Restore the buttons' default background color and tooltip text. The
* buttons color is not the system standard and the tool tip text
@ -1133,6 +1129,7 @@ public class CaseCreationDlg extends AbstractArchiveDlg {
}
}
});
super.loadedAllDisplayData();
}
@Override