From 6093802c1d4302a0bc6ae8b2e9ac1c709b001013 Mon Sep 17 00:00:00 2001 From: Roger Ferrel Date: Tue, 2 Oct 2012 10:39:57 -0500 Subject: [PATCH] Issue #1229 Changes to make WeatherPlotDialog non-blocking. Change-Id: Id4349e999c1ccf6e33e39cbae8fdc768491beb9f Former-commit-id: 82cef7d8736e8af0c65f4af47f9f5103e485e84a [formerly 87daa59717cc8c259415deaae0ce1ad0d4aa8f22 [formerly 80a472645526d0e55ab66be7a768ba018cd94db2]] Former-commit-id: 87daa59717cc8c259415deaae0ce1ad0d4aa8f22 Former-commit-id: 9e7d02c027a6b77d59dffce4b873b24180bf7ba6 --- .../climatology/WeatherPlotDialog.java | 14 ++------ .../viz/aviation/observer/TafMonitorDlg.java | 32 +++++++++++++------ 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/climatology/WeatherPlotDialog.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/climatology/WeatherPlotDialog.java index d8a56db8ca..15cca47ab5 100755 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/climatology/WeatherPlotDialog.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/climatology/WeatherPlotDialog.java @@ -84,6 +84,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; * 11/18/2010 6701 rferrel Now uses the same wxPlotCfg * as WeatherPlotDataManager. * 04/28/2011 8065 rferrel Use cache data. + * 10/02/2012 1229 rferrel Made dialog non-blocking. * * * @@ -173,16 +174,6 @@ public class WeatherPlotDialog extends CaveSWTDialog { */ private Label siteTimeLbl; - /** - * Scrolled composite width. - */ - private final int SCROLLED_COMP_WIDTH = 1120; - - /** - * Scrolled composite height. - */ - private final int SCROLLED_COMP_HEIGHT = 610; - /** * Scrolled composite containing plot data. */ @@ -234,7 +225,8 @@ public class WeatherPlotDialog extends CaveSWTDialog { public WeatherPlotDialog(Shell parent, StatusMessageType msgType, List stationList) { super(parent, SWT.DIALOG_TRIM | SWT.MODELESS | SWT.RESIZE, - CAVE.PERSPECTIVE_INDEPENDENT | CAVE.MODE_INDEPENDENT); + CAVE.PERSPECTIVE_INDEPENDENT | CAVE.MODE_INDEPENDENT + | CAVE.DO_NOT_BLOCK); setText("AvnFPS Weather Plot"); this.msgType = msgType; diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/observer/TafMonitorDlg.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/observer/TafMonitorDlg.java index 77186428b0..cb0a435a02 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/observer/TafMonitorDlg.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/observer/TafMonitorDlg.java @@ -88,6 +88,7 @@ import com.raytheon.viz.avnconfig.HelpUsageDlg; import com.raytheon.viz.avnconfig.IStatusSettable; import com.raytheon.viz.avnconfig.MessageStatusComp; import com.raytheon.viz.ui.dialogs.CaveSWTDialog; +import com.raytheon.viz.ui.dialogs.ICloseCallback; /** * TafMonitorDlg (Terminal Aerodome Forecast Monitor Dialog) class. @@ -128,7 +129,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; * 10/27/2010 7383 rferrel Save changed blink state in configMgr. * 3/14/2011 8588 rferrel Allow monitoring multiple products. * 11/29/2011 11612 rferrel Added observers to update viewer tabs. - * 20JUL2012 14570 gzhang/zhao Added methods for highlighting in TAF viewer + * 20JUL2012 14570 gzhang/zhao Added methods for highlighting in TAF viewer + * 10/02/2012 1229 rferrel Changes to work with non-blocking WeatherPlotDialog. * * * @@ -632,11 +634,20 @@ public class TafMonitorDlg extends CaveSWTDialog { @Override public void widgetSelected(SelectionEvent event) { - if (avnPlotDlg == null) { + if (avnPlotDlg == null || avnPlotDlg.getShell() == null + || avnPlotDlg.isDisposed()) { avnPlotDlg = new WeatherPlotDialog(shell, StatusMessageType.WeatherPlot, stationList); + avnPlotDlg.setCloseCallback(new ICloseCallback() { + + @Override + public void dialogClosed(Object returnValue) { + avnPlotDlg = null; + } + }); avnPlotDlg.open(); - avnPlotDlg = null; + } else { + avnPlotDlg.bringToTop(); } } }); @@ -918,10 +929,10 @@ public class TafMonitorDlg extends CaveSWTDialog { public final List getViewerTabList() { return tveDlg.getViewerTabList(); } - - //------------------------- DR 14570: - - public static Map getCurrentAlertTimeMap(String siteID){ + + // ------------------------- DR 14570: + + public static Map getCurrentAlertTimeMap(String siteID) { Map alertTimeMap = null; if (currentDlg != null) { if (currentDlg.getDisplay().isDisposed()) { @@ -936,8 +947,9 @@ public class TafMonitorDlg extends CaveSWTDialog { } return alertTimeMap; } - //20120711 - public static Map getCurrentTempoMap(String siteID){ + + // 20120711 + public static Map getCurrentTempoMap(String siteID) { Map tempoMap = null; if (currentDlg != null) { if (currentDlg.getDisplay().isDisposed()) { @@ -945,7 +957,7 @@ public class TafMonitorDlg extends CaveSWTDialog { } else { for (TafSiteComp siteRow : currentDlg.getTafSiteComps()) { if (siteRow.getStationName().equals(siteID)) { - tempoMap= siteRow.getTempoMap(); + tempoMap = siteRow.getTempoMap(); } } }