Merge "Issue #1353 Changes for non-blocking AlertAlarmValuesDlg, GetAppsDefaults, SHEFAppsDefaultsDlg and BestEstimateQpeDlg." into development

Former-commit-id: a494177cff [formerly 3a4eb415f2] [formerly 59b2cf8872] [formerly a494177cff [formerly 3a4eb415f2] [formerly 59b2cf8872] [formerly 8e7143967b [formerly 59b2cf8872 [formerly 050d9cebb8de520c7ed0d27c686ebf84dc6d084c]]]]
Former-commit-id: 8e7143967b
Former-commit-id: 7b4033f4f4 [formerly 17b9e0077c] [formerly 734ccd218f6db5c98ef93ca7c3ed02548f8ef5ba [formerly f3b9d1cb38]]
Former-commit-id: 02b213241de9f87d67936e3bc2157c566db5c545 [formerly b6e267419c]
Former-commit-id: 5e23a89003
This commit is contained in:
Lee Venable 2012-12-10 11:28:34 -06:00 committed by Gerrit Code Review
commit 6b1bb76de2
7 changed files with 175 additions and 157 deletions

View file

@ -36,6 +36,7 @@ import org.eclipse.ui.PlatformUI;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 6/27/07 lvenable Initial creation. * 6/27/07 lvenable Initial creation.
* 12/05/12 1353 rferrel Changes for non-blocking AlertAlarmValuesDlg.
* *
* </pre> * </pre>
* *
@ -43,13 +44,16 @@ import org.eclipse.ui.PlatformUI;
* *
*/ */
public class AlertAlarmValuesAction extends AbstractHandler { public class AlertAlarmValuesAction extends AbstractHandler {
private AlertAlarmValuesDlg alertAlarmDlg;
@Override @Override
public Object execute(ExecutionEvent arg0) throws ExecutionException { public Object execute(ExecutionEvent arg0) throws ExecutionException {
if (alertAlarmDlg == null) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell(); .getShell();
AlertAlarmValuesDlg alertAlarmDlg = new AlertAlarmValuesDlg(shell); alertAlarmDlg = new AlertAlarmValuesDlg(shell);
}
alertAlarmDlg.open(); alertAlarmDlg.open();
return null; return null;

View file

@ -27,8 +27,8 @@ import static com.raytheon.viz.hydro.alertalarm.AlertAlarmConstants.LOWER_CHECKS
import static com.raytheon.viz.hydro.alertalarm.AlertAlarmConstants.ROC_CHECKSTR; import static com.raytheon.viz.hydro.alertalarm.AlertAlarmConstants.ROC_CHECKSTR;
import static com.raytheon.viz.hydro.alertalarm.AlertAlarmConstants.UPPER_CHECKSTR; import static com.raytheon.viz.hydro.alertalarm.AlertAlarmConstants.UPPER_CHECKSTR;
import static com.raytheon.viz.hydro.alertalarm.AlertAlarmConstants.alertAlarmTimeFormat; import static com.raytheon.viz.hydro.alertalarm.AlertAlarmConstants.alertAlarmTimeFormat;
import static com.raytheon.viz.hydro.alertalarm.AlertAlarmConstants.dbDatabaseFormat;
import static com.raytheon.viz.hydro.alertalarm.AlertAlarmConstants.db2DatabaseFormat; import static com.raytheon.viz.hydro.alertalarm.AlertAlarmConstants.db2DatabaseFormat;
import static com.raytheon.viz.hydro.alertalarm.AlertAlarmConstants.dbDatabaseFormat;
import static com.raytheon.viz.hydro.alertalarm.AlertAlarmConstants.smallerTime; import static com.raytheon.viz.hydro.alertalarm.AlertAlarmConstants.smallerTime;
import java.util.ArrayList; import java.util.ArrayList;
@ -53,6 +53,9 @@ import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Text;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.catalog.DirectDbQuery; import com.raytheon.uf.viz.core.catalog.DirectDbQuery;
import com.raytheon.uf.viz.core.catalog.DirectDbQuery.QueryLanguage; import com.raytheon.uf.viz.core.catalog.DirectDbQuery.QueryLanguage;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
@ -60,7 +63,7 @@ import com.raytheon.viz.hydro.alertalarm.AlertAlarmConstants.AaOption;
import com.raytheon.viz.hydro.alertalarm.AlertAlarmConstants.CheckOption; import com.raytheon.viz.hydro.alertalarm.AlertAlarmConstants.CheckOption;
import com.raytheon.viz.hydro.alertalarm.AlertAlarmConstants.TypeOption; import com.raytheon.viz.hydro.alertalarm.AlertAlarmConstants.TypeOption;
import com.raytheon.viz.hydro.timeseries.TimeSeriesDlg; import com.raytheon.viz.hydro.timeseries.TimeSeriesDlg;
import com.raytheon.viz.hydro.timeseries.util.*; import com.raytheon.viz.hydro.timeseries.util.TimeSeriesUtil;
import com.raytheon.viz.hydrocommon.HydroConstants; import com.raytheon.viz.hydrocommon.HydroConstants;
import com.raytheon.viz.hydrocommon.datamanager.IhfsAlertalarmvalData; import com.raytheon.viz.hydrocommon.datamanager.IhfsAlertalarmvalData;
import com.raytheon.viz.hydrocommon.datamanager.IhfsLocdatalimitsData; import com.raytheon.viz.hydrocommon.datamanager.IhfsLocdatalimitsData;
@ -79,6 +82,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* May, 2011 9359 Jingtao Deng Updated queryLocdatalimits(), check locdatalimits table * May, 2011 9359 Jingtao Deng Updated queryLocdatalimits(), check locdatalimits table
* first, is not existing, check for datalimits table as defaults. * first, is not existing, check for datalimits table as defaults.
* Both not existing, set as MISSING * Both not existing, set as MISSING
* Dec 07, 2012 1353 rferrel Make dialog non-blocking.
* *
* </pre> * </pre>
* *
@ -88,6 +92,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
*/ */
public class AlertAlarmValuesDlg extends CaveSWTDialog implements public class AlertAlarmValuesDlg extends CaveSWTDialog implements
IhfsAlertalarmvalData, IhfsLocdatalimitsData { IhfsAlertalarmvalData, IhfsLocdatalimitsData {
private final IUFStatusHandler statusHandler = UFStatus
.getHandler(AlertAlarmValuesDlg.class);
/** /**
* Font used for the data list. * Font used for the data list.
@ -128,6 +134,7 @@ public class AlertAlarmValuesDlg extends CaveSWTDialog implements
* List containing valid times in database format. * List containing valid times in database format.
*/ */
private java.util.List<String> dataValidTimes = new ArrayList<String>(); private java.util.List<String> dataValidTimes = new ArrayList<String>();
private java.util.List<String> dataBasisTimes = new ArrayList<String>(); private java.util.List<String> dataBasisTimes = new ArrayList<String>();
/** /**
@ -196,6 +203,7 @@ public class AlertAlarmValuesDlg extends CaveSWTDialog implements
private String selectedLid; private String selectedLid;
private String selectedPe; private String selectedPe;
private String selectedDur; private String selectedDur;
/** /**
@ -206,7 +214,7 @@ public class AlertAlarmValuesDlg extends CaveSWTDialog implements
*/ */
public AlertAlarmValuesDlg(Shell parent) { public AlertAlarmValuesDlg(Shell parent) {
super(parent); super(parent, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK);
setText("Alert and Alarm Data Values"); setText("Alert and Alarm Data Values");
} }
@ -494,19 +502,15 @@ public class AlertAlarmValuesDlg extends CaveSWTDialog implements
if (locationRdo.getSelection()) { if (locationRdo.getSelection()) {
if (getType() != TypeOption.FCST) { if (getType() != TypeOption.FCST) {
myQuery myQuery.append(" order by aav.lid, aav.validtime desc, aav.ts asc, aav.basistime desc");
.append(" order by aav.lid, aav.validtime desc, aav.ts asc, aav.basistime desc");
} else { } else {
myQuery myQuery.append(" order by aav.lid, aav.validtime asc, aav.ts asc, aav.basistime desc");
.append(" order by aav.lid, aav.validtime asc, aav.ts asc, aav.basistime desc");
} }
} else { } else {
if (getType() != TypeOption.FCST) { if (getType() != TypeOption.FCST) {
myQuery myQuery.append(" order by aav.validtime desc, aav.lid, aav.basistime desc");
.append(" order by aav.validtime desc, aav.lid, aav.basistime desc");
} else { } else {
myQuery myQuery.append(" order by aav.validtime asc, aav.lid, aav.basistime desc");
.append(" order by aav.validtime asc, aav.lid, aav.basistime desc");
} }
} }
@ -515,7 +519,6 @@ public class AlertAlarmValuesDlg extends CaveSWTDialog implements
dbDatabaseFormat.setTimeZone(TimeZone.getTimeZone("UTC")); dbDatabaseFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
db2DatabaseFormat.setTimeZone(TimeZone.getTimeZone("UTC")); db2DatabaseFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
try { try {
dataList.removeAll(); dataList.removeAll();
dataValidTimes.clear(); dataValidTimes.clear();
@ -553,25 +556,26 @@ public class AlertAlarmValuesDlg extends CaveSWTDialog implements
basisTimeValue = smallerTime.format((Date) rowData[11]); basisTimeValue = smallerTime.format((Date) rowData[11]);
} }
String QcSymbol=TimeSeriesUtil.buildQcSymbol(Long.parseLong(rowData[7].toString())); String QcSymbol = TimeSeriesUtil.buildQcSymbol(Long
.parseLong(rowData[7].toString()));
tmpStr = String.format(fmtStr, rowData[0].toString(), tmpStr = String.format(fmtStr, rowData[0].toString(),
rowData[12].toString(), rowData[1].toString(), rowData[12].toString(), rowData[1].toString(),
rowData[2], rowData[3].toString(), rowData[4] rowData[2], rowData[3].toString(),
.toString(), rowData[5], supplValue, rowData[4].toString(), rowData[5], supplValue,
QcSymbol, rowData[8].toString(), rowData[9] QcSymbol, rowData[8].toString(), rowData[9].toString(),
.toString(), smallerTime smallerTime.format((Date) rowData[10]), basisTimeValue,
.format((Date) rowData[10]), basisTimeValue,
rowData[11].toString()); rowData[11].toString());
/* load the list strings. */ /* load the list strings. */
dataList.add(tmpStr); dataList.add(tmpStr);
dataList.setSelection(0); dataList.setSelection(0);
dataValidTimes.add(dbDatabaseFormat.format((Date) rowData[10])); dataValidTimes.add(dbDatabaseFormat.format((Date) rowData[10]));
dataBasisTimes.add(db2DatabaseFormat.format((Date) rowData[11])); dataBasisTimes
.add(db2DatabaseFormat.format((Date) rowData[11]));
} }
} catch (VizException e) { } catch (VizException e) {
e.printStackTrace(); statusHandler.handle(Priority.PROBLEM, e.getMessage(), e);
} }
} }
@ -632,7 +636,7 @@ public class AlertAlarmValuesDlg extends CaveSWTDialog implements
} }
} }
} catch (VizException e) { } catch (VizException e) {
e.printStackTrace(); statusHandler.handle(Priority.PROBLEM, e.getMessage(), e);
} }
} }
@ -659,8 +663,7 @@ public class AlertAlarmValuesDlg extends CaveSWTDialog implements
mbFail.setText("Unable to Delete"); mbFail.setText("Unable to Delete");
mbFail.setMessage("Unable to Delete Record"); mbFail.setMessage("Unable to Delete Record");
mbFail.open(); mbFail.open();
statusHandler.handle(Priority.PROBLEM, e.getMessage(), e);
e.printStackTrace();
} }
} }
} else { } else {
@ -675,7 +678,8 @@ public class AlertAlarmValuesDlg extends CaveSWTDialog implements
// Delete the selected item in the data list from alertalarmval. // Delete the selected item in the data list from alertalarmval.
// ------------------------------------------------------------ // ------------------------------------------------------------
@Override @Override
public void deleteAlertalarmvalSelected(int alertAlarmIndex) throws VizException { public void deleteAlertalarmvalSelected(int alertAlarmIndex)
throws VizException {
// Query 'alertalarmval' table in ihfs database and delete selected item // Query 'alertalarmval' table in ihfs database and delete selected item
// using SQL. // using SQL.
StringBuilder myQuery = new StringBuilder( StringBuilder myQuery = new StringBuilder(
@ -744,10 +748,10 @@ public class AlertAlarmValuesDlg extends CaveSWTDialog implements
// ------------------------------------------------------------- // -------------------------------------------------------------
try { try {
int status = DirectDbQuery.executeStatement(myQuery.toString(), HydroConstants.IHFS, DirectDbQuery.executeStatement(myQuery.toString(),
QueryLanguage.SQL); HydroConstants.IHFS, QueryLanguage.SQL);
} catch (VizException e) { } catch (VizException e) {
e.printStackTrace(); statusHandler.handle(Priority.PROBLEM, e.getMessage(), e);
} }
} }
@ -772,7 +776,8 @@ public class AlertAlarmValuesDlg extends CaveSWTDialog implements
Boolean deflimitsFound = true; Boolean deflimitsFound = true;
// retrieve from general datalimits table // retrieve from general datalimits table
StringBuilder dlQuery = new StringBuilder("select dl.alert_upper_limit, dl.alert_lower_limit, dl.alert_roc_limit, dl.alert_diff_limit, dl.alarm_upper_limit, dl.alarm_lower_limit, dl.alarm_roc_limit, dl.alarm_diff_limit from datalimits dl"); StringBuilder dlQuery = new StringBuilder(
"select dl.alert_upper_limit, dl.alert_lower_limit, dl.alert_roc_limit, dl.alert_diff_limit, dl.alarm_upper_limit, dl.alarm_lower_limit, dl.alarm_roc_limit, dl.alarm_diff_limit from datalimits dl");
ArrayList<Object[]> dataLimits; ArrayList<Object[]> dataLimits;
dlQuery.append(" where dl.pe = '"); dlQuery.append(" where dl.pe = '");
dlQuery.append(selectedPe); dlQuery.append(selectedPe);
@ -781,7 +786,6 @@ public class AlertAlarmValuesDlg extends CaveSWTDialog implements
dlQuery.append(selectedDur); dlQuery.append(selectedDur);
dlQuery.append("'"); dlQuery.append("'");
// ------------------------------------------------------------- // -------------------------------------------------------------
// Query the Locdatalimits Table in the IHFS database using SQL. // Query the Locdatalimits Table in the IHFS database using SQL.
// ------------------------------------------------------------- // -------------------------------------------------------------
@ -789,18 +793,18 @@ public class AlertAlarmValuesDlg extends CaveSWTDialog implements
loclimitData = (ArrayList<Object[]>) DirectDbQuery.executeQuery( loclimitData = (ArrayList<Object[]>) DirectDbQuery.executeQuery(
myQuery.toString(), HydroConstants.IHFS, QueryLanguage.SQL); myQuery.toString(), HydroConstants.IHFS, QueryLanguage.SQL);
//if location specific range is not found, check the default range*/ // if location specific range is not found, check the default
if (loclimitData.size() == 0) // range*/
{ if (loclimitData.size() == 0) {
loclimitsFound = false; loclimitsFound = false;
try { try {
dataLimits = (ArrayList<Object[]>) DirectDbQuery.executeQuery( dataLimits = (ArrayList<Object[]>) DirectDbQuery
dlQuery.toString(), HydroConstants.IHFS, QueryLanguage.SQL); .executeQuery(dlQuery.toString(),
HydroConstants.IHFS, QueryLanguage.SQL);
if (dataLimits.size() == 0) if (dataLimits.size() == 0)
deflimitsFound = false; deflimitsFound = false;
else else {
{
deflimitsFound = true; deflimitsFound = true;
for (Object[] rowData : dataLimits) { for (Object[] rowData : dataLimits) {
setField(alertUpperLbl, (Double) rowData[0]); setField(alertUpperLbl, (Double) rowData[0]);
@ -818,7 +822,7 @@ public class AlertAlarmValuesDlg extends CaveSWTDialog implements
} }
} catch (VizException e) { } catch (VizException e) {
e.printStackTrace(); statusHandler.handle(Priority.PROBLEM, e.getMessage(), e);
} }
} }
@ -836,9 +840,9 @@ public class AlertAlarmValuesDlg extends CaveSWTDialog implements
setField(alarmDiffLbl, (Double) rowData[7]); setField(alarmDiffLbl, (Double) rowData[7]);
} }
} }
// both location specific range and default range are not found, set to MISSING // both location specific range and default range are not found, set
else if (!deflimitsFound) // to MISSING
{ else if (!deflimitsFound) {
alertUpperLbl.setText(" MISSING "); alertUpperLbl.setText(" MISSING ");
alertLowerLbl.setText(" MISSING "); alertLowerLbl.setText(" MISSING ");
alertRocLbl.setText(" MISSING "); alertRocLbl.setText(" MISSING ");
@ -850,7 +854,7 @@ public class AlertAlarmValuesDlg extends CaveSWTDialog implements
alarmDiffLbl.setText(" MISSING "); alarmDiffLbl.setText(" MISSING ");
} }
} catch (VizException e) { } catch (VizException e) {
e.printStackTrace(); statusHandler.handle(Priority.PROBLEM, e.getMessage(), e);
} }
} }
@ -1077,7 +1081,7 @@ public class AlertAlarmValuesDlg extends CaveSWTDialog implements
closeBtn.addSelectionListener(new SelectionAdapter() { closeBtn.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent event) { public void widgetSelected(SelectionEvent event) {
shell.dispose(); close();
} }
}); });
} }

View file

@ -35,6 +35,8 @@ import org.eclipse.ui.PlatformUI;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Jan 26, 2011 mpduff Initial creation * Jan 26, 2011 mpduff Initial creation
* Dec 06, 2012 1353 rferrel Changes for non blocking GetAppsDefaults.
* Changes for non blocking SHEFAppsDefaultsDlg.
* *
* </pre> * </pre>
* *
@ -43,6 +45,9 @@ import org.eclipse.ui.PlatformUI;
*/ */
public class AppsDefaultsAction extends AbstractHandler { public class AppsDefaultsAction extends AbstractHandler {
private GetAppsDefaults gad;
private SHEFAppsDefaultsDlg dlg;
/* /*
* (non-Javadoc) * (non-Javadoc)
@ -57,10 +62,14 @@ public class AppsDefaultsAction extends AbstractHandler {
.getShell(); .getShell();
String action = event.getParameter("Action"); String action = event.getParameter("Action");
if (action.equals("gad")) { if (action.equals("gad")) {
GetAppsDefaults gad = new GetAppsDefaults(shell); if (gad == null) {
gad = new GetAppsDefaults(shell);
}
gad.open(); gad.open();
} else { } else {
SHEFAppsDefaultsDlg dlg = new SHEFAppsDefaultsDlg(shell); if (dlg == null) {
dlg = new SHEFAppsDefaultsDlg(shell);
}
dlg.open(); dlg.open();
} }
return null; return null;

View file

@ -21,7 +21,6 @@ package com.raytheon.viz.hydro.appsdefaults;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.Font;
@ -37,7 +36,7 @@ import com.raytheon.uf.common.ohd.AppsDefaults;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog; import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
/** /**
* TODO Add Description * Dialog to allow user to display desired application defaults.
* *
* <pre> * <pre>
* *
@ -46,6 +45,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Jan 26, 2011 mpduff Initial creation * Jan 26, 2011 mpduff Initial creation
* Dec 07, 2012 1353 rferrel Make dialog non-blocking.
* *
* </pre> * </pre>
* *
@ -83,7 +83,7 @@ public class GetAppsDefaults extends CaveSWTDialog {
* Parent shell. * Parent shell.
*/ */
public GetAppsDefaults(Shell parent) { public GetAppsDefaults(Shell parent) {
super(parent); super(parent, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK);
setText("GAD"); setText("GAD");
} }
@ -109,7 +109,8 @@ public class GetAppsDefaults extends CaveSWTDialog {
textArea.setFont(font); textArea.setFont(font);
textArea.setEditable(false); textArea.setEditable(false);
textArea.setLayoutData(gd); textArea.setLayoutData(gd);
textArea.getVerticalBar().setSelection(textArea.getVerticalBar().getMaximum()); textArea.getVerticalBar().setSelection(
textArea.getVerticalBar().getMaximum());
// Initialize search area // Initialize search area
Composite searchComp = new Composite(shell, SWT.NONE); Composite searchComp = new Composite(shell, SWT.NONE);
@ -127,22 +128,15 @@ public class GetAppsDefaults extends CaveSWTDialog {
searchField.setLayoutData(gd); searchField.setLayoutData(gd);
searchField.setEditable(true); searchField.setEditable(true);
searchField.setFocus(); searchField.setFocus();
searchField.addKeyListener(new KeyListener() { searchField.addKeyListener(new org.eclipse.swt.events.KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
}
@Override @Override
public void keyReleased(KeyEvent e) { public void keyReleased(KeyEvent e) {
if ((e.keyCode == 13) || (e.keyCode == 16777296)) { if ((e.keyCode == 13) || (e.keyCode == 16777296)) {
gad(); gad();
} }
} }
}); });
gd = new GridData(35, SWT.DEFAULT); gd = new GridData(35, SWT.DEFAULT);
gd.widthHint = 65; gd.widthHint = 65;
searchButton = new Button(searchComp, SWT.NONE); searchButton = new Button(searchComp, SWT.NONE);
@ -169,7 +163,7 @@ public class GetAppsDefaults extends CaveSWTDialog {
closeBtn.addSelectionListener(new SelectionAdapter() { closeBtn.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent event) { public void widgetSelected(SelectionEvent event) {
shell.dispose(); close();
} }
}); });
} }

View file

@ -41,6 +41,9 @@ import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.ohd.AppsDefaults; import com.raytheon.uf.common.ohd.AppsDefaults;
import com.raytheon.uf.common.serialization.SerializationException; import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog; import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
/** /**
@ -53,6 +56,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Jan 26, 2011 mpduff Initial creation * Jan 26, 2011 mpduff Initial creation
* Dec 07, 2012 1353 rferrel Make non-blocking dialog.
* *
* </pre> * </pre>
* *
@ -61,6 +65,9 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
*/ */
public class SHEFAppsDefaultsDlg extends CaveSWTDialog { public class SHEFAppsDefaultsDlg extends CaveSWTDialog {
private final IUFStatusHandler statusHandler = UFStatus
.getHandler(SHEFAppsDefaultsDlg.class);
private final String CONFIG_FILE_NAME = "hydro" + File.separatorChar private final String CONFIG_FILE_NAME = "hydro" + File.separatorChar
+ "shefGadTokens.xml"; + "shefGadTokens.xml";
@ -83,7 +90,7 @@ public class SHEFAppsDefaultsDlg extends CaveSWTDialog {
* Parent shell. * Parent shell.
*/ */
public SHEFAppsDefaultsDlg(Shell parent) { public SHEFAppsDefaultsDlg(Shell parent) {
super(parent); super(parent, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK);
setText("SHEF Apps_defaults Settings"); setText("SHEF Apps_defaults Settings");
populateTokenList(); populateTokenList();
} }
@ -166,13 +173,14 @@ public class SHEFAppsDefaultsDlg extends CaveSWTDialog {
if (file != null) { if (file != null) {
configPath = file.getAbsolutePath(); configPath = file.getAbsolutePath();
try { try {
SHEFAppsDefaultsXML xml = (SHEFAppsDefaultsXML) SerializationUtil SHEFAppsDefaultsXML xml = SerializationUtil
.jaxbUnmarshalFromXmlFile(configPath); .jaxbUnmarshalFromXmlFile(SHEFAppsDefaultsXML.class,
configPath);
for (String token : xml.getTokenList()) { for (String token : xml.getTokenList()) {
tokenList.add(token); tokenList.add(token);
} }
} catch (SerializationException e) { } catch (SerializationException e) {
e.printStackTrace(); statusHandler.handle(Priority.PROBLEM, e.getMessage(), e);
} }
} else { } else {
MessageBox messageBox = new MessageBox(this.getParent(), SWT.ERROR); MessageBox messageBox = new MessageBox(this.getParent(), SWT.ERROR);
@ -189,9 +197,6 @@ public class SHEFAppsDefaultsDlg extends CaveSWTDialog {
*/ */
@Override @Override
protected void disposed() { protected void disposed() {
super.disposed();
if (font.isDisposed() == false) {
font.dispose(); font.dispose();
} }
} }
}

View file

@ -40,6 +40,7 @@ import org.eclipse.ui.PlatformUI;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 6/27/06 randerso Initial Creation. * 6/27/06 randerso Initial Creation.
* 8/24/2009 2258 mpduff Removed not implemented message. * 8/24/2009 2258 mpduff Removed not implemented message.
* 12/05/1212 1363 rferrel Changes for non-blocking BestEstimateQpeDlg.
* *
* </pre> * </pre>
* *
@ -47,12 +48,15 @@ import org.eclipse.ui.PlatformUI;
* *
*/ */
public class BestEstimateQpeAction extends AbstractHandler { public class BestEstimateQpeAction extends AbstractHandler {
private BestEstimateQpeDlg bestEstimateDlg;
@Override @Override
public Object execute(ExecutionEvent arg0) throws ExecutionException { public Object execute(ExecutionEvent arg0) throws ExecutionException {
if (bestEstimateDlg == null) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell(); .getShell();
BestEstimateQpeDlg bestEstimateDlg = new BestEstimateQpeDlg(shell); bestEstimateDlg = new BestEstimateQpeDlg(shell);
}
bestEstimateDlg.open(); bestEstimateDlg.open();
return null; return null;

View file

@ -46,6 +46,9 @@ import org.eclipse.swt.widgets.Scale;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Text;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.viz.core.IDisplayPaneContainer; import com.raytheon.uf.viz.core.IDisplayPaneContainer;
import com.raytheon.uf.viz.core.drawables.IDescriptor; import com.raytheon.uf.viz.core.drawables.IDescriptor;
@ -67,6 +70,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* 29 NOV 2007 373 lvenable Initial creation. * 29 NOV 2007 373 lvenable Initial creation.
* 21 May 2009 mpduff Fixed typo in window title. * 21 May 2009 mpduff Fixed typo in window title.
* 24 Aug 2009 2258 mpduff Implemented dialog functionality. * 24 Aug 2009 2258 mpduff Implemented dialog functionality.
* 07 Dec 2012 1353 rferrel Make dialog non-blocking.
* *
* </pre> * </pre>
* *
@ -75,6 +79,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* *
*/ */
public class BestEstimateQpeDlg extends CaveSWTDialog { public class BestEstimateQpeDlg extends CaveSWTDialog {
private final IUFStatusHandler statusHandler = UFStatus
.getHandler(BestEstimateQpeDlg.class);
/** /**
* QPE source Local radio button. * QPE source Local radio button.
@ -231,11 +237,6 @@ public class BestEstimateQpeDlg extends CaveSWTDialog {
*/ */
private Calendar cal = new GregorianCalendar(); private Calendar cal = new GregorianCalendar();
/**
* Currently looping flag.
*/
private boolean looping = false;
/** /**
* Constructor. * Constructor.
* *
@ -243,7 +244,7 @@ public class BestEstimateQpeDlg extends CaveSWTDialog {
* Parent shell. * Parent shell.
*/ */
public BestEstimateQpeDlg(Shell parent) { public BestEstimateQpeDlg(Shell parent) {
super(parent); super(parent, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK);
setText("Display Best Estimate QPE"); setText("Display Best Estimate QPE");
cal.setTimeZone(TimeZone.getTimeZone("GMT")); cal.setTimeZone(TimeZone.getTimeZone("GMT"));
dateTimeFmt.setTimeZone(TimeZone.getTimeZone("GMT")); dateTimeFmt.setTimeZone(TimeZone.getTimeZone("GMT"));
@ -711,7 +712,6 @@ public class BestEstimateQpeDlg extends CaveSWTDialog {
.getActiveVizContainer(); .getActiveVizContainer();
if (container != null) { if (container != null) {
container.getLoopProperties().setLooping(false); container.getLoopProperties().setLooping(false);
looping = false;
} }
} }
}); });
@ -734,7 +734,7 @@ public class BestEstimateQpeDlg extends CaveSWTDialog {
closeBtn.addSelectionListener(new SelectionAdapter() { closeBtn.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent event) { public void widgetSelected(SelectionEvent event) {
shell.dispose(); close();
} }
}); });
} }
@ -786,10 +786,8 @@ public class BestEstimateQpeDlg extends CaveSWTDialog {
displayManager.setLabels(labelsChk.getSelection()); displayManager.setLabels(labelsChk.getSelection());
try { try {
displayManager.displayQPE(); displayManager.displayQPE();
looping = true;
} catch (VizException e) { } catch (VizException e) {
// TODO Auto-generated catch block statusHandler.handle(Priority.PROBLEM, e.getMessage(), e);
e.printStackTrace();
} }
} }
} }