Issue #1229 Changes to make WeatherPlotDialog non-blocking.

Change-Id: Id4349e999c1ccf6e33e39cbae8fdc768491beb9f

Former-commit-id: 80a472645526d0e55ab66be7a768ba018cd94db2
This commit is contained in:
Roger Ferrel 2012-10-02 10:39:57 -05:00
parent ec9c804d5b
commit 82cef7d873
2 changed files with 25 additions and 21 deletions

View file

@ -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.
*
* </pre>
*
@ -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<String> 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;

View file

@ -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.
*
* </pre>
*
@ -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<ViewerTab> getViewerTabList() {
return tveDlg.getViewerTabList();
}
//------------------------- DR 14570:
public static Map<String,String> getCurrentAlertTimeMap(String siteID){
// ------------------------- DR 14570:
public static Map<String, String> getCurrentAlertTimeMap(String siteID) {
Map<String, String> alertTimeMap = null;
if (currentDlg != null) {
if (currentDlg.getDisplay().isDisposed()) {
@ -936,8 +947,9 @@ public class TafMonitorDlg extends CaveSWTDialog {
}
return alertTimeMap;
}
//20120711
public static Map<String,String[]> getCurrentTempoMap(String siteID){
// 20120711
public static Map<String, String[]> getCurrentTempoMap(String siteID) {
Map<String, String[]> 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();
}
}
}