From 6fcac050beeafd7043b0b6ac9adc7d84147a80d6 Mon Sep 17 00:00:00 2001 From: Roger Ferrel Date: Tue, 26 Aug 2014 10:24:25 -0500 Subject: [PATCH] Issue #3553 - Force redisplay of data set table after all labels are generated. Change-Id: Ie8c0195414102d046e5348e778ba8d5e1053e5ec Former-commit-id: 60d6b770aa52818a24757f84175e8eb6834d9500 [formerly 15c73be56ca9541974102a983314919a1fe6474a] [formerly 6f8c6d6aa156115ff73b24aa5f591a5761f733a8] [formerly ef5dfb1f9353148456dfaa07b692d12a8b1d02d4 [formerly 6f8c6d6aa156115ff73b24aa5f591a5761f733a8 [formerly bcc9b0a6352151dfdf3ba75063bb87308cb162b4]]] Former-commit-id: ef5dfb1f9353148456dfaa07b692d12a8b1d02d4 Former-commit-id: a75847a14ce68662ce3ae2487c06dcc0a6e1e748 [formerly fe50853adb486777541e11b00f03109d84b3d735] Former-commit-id: ffa95bce90073b078bee878f5c576bf5f2647db9 --- .../raytheon/uf/viz/archive/data/SizeJob.java | 7 ++-- .../uf/viz/archive/ui/AbstractArchiveDlg.java | 42 ++++++++++++++++--- .../viz/archive/ui/ArchiveRetentionDlg.java | 6 +-- .../uf/viz/archive/ui/CaseCreationDlg.java | 7 +--- 4 files changed, 44 insertions(+), 18 deletions(-) diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/SizeJob.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/SizeJob.java index a9735621ce..c73e9d5910 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/SizeJob.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/SizeJob.java @@ -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. * * * @@ -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 changeDisplay(String archiveName, - String categoryName, AtomicBoolean shutdown) { + String categoryName, AtomicBoolean shutdown, boolean forceUpdate) { List 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. diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/AbstractArchiveDlg.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/AbstractArchiveDlg.java index a095803415..1b2c576996 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/AbstractArchiveDlg.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/AbstractArchiveDlg.java @@ -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. * * * @@ -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 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. diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/ArchiveRetentionDlg.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/ArchiveRetentionDlg.java index 9f8214bcca..f8bb63956b 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/ArchiveRetentionDlg.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/ArchiveRetentionDlg.java @@ -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. * * * @@ -423,9 +424,4 @@ public class ArchiveRetentionDlg extends AbstractArchiveDlg { archiveComboSelection(); categoryComboSelection(); } - - @Override - public void loadedAllDisplayData() { - // nothing to update. - } } diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreationDlg.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreationDlg.java index 073216d7e8..910228e597 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreationDlg.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreationDlg.java @@ -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. * * * @@ -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