diff --git a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/ScanMonitor.java b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/ScanMonitor.java
index 96b41090a1..2b10d095e5 100644
--- a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/ScanMonitor.java
+++ b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/ScanMonitor.java
@@ -113,6 +113,7 @@ import com.vividsolutions.jts.io.WKBReader;
* to avoid !TimeStamp.equals(Date) issue
* Apr 26, 2013 1926 njensen Optimized getAvailableUris()
* Jul 24, 2013 2218 mpduff Improved error handling, optimizations
+ * Jul 30, 2013 2143 skorolev Changes for non-blocking dialogs.
*
*
* @author dhladky
@@ -753,48 +754,54 @@ public class ScanMonitor extends ResourceMonitor implements IScanDialogListener
if (cellDialogs.isEmpty()) {
getScanConfig().reload(ScanTables.CELL);
}
- if (cellDialogs.get(icao) == null) {
+ if (cellDialogs.get(icao) == null||cellDialogs.get(icao).isDisposed()) {
SCANCellTableDlg cellDialog = new SCANCellTableDlg(shell, icao,
new SCANTableData(ScanTables.CELL));
cellDialogs.put(icao, cellDialog);
monitor.addMonitorListener(cellDialog);
cellDialog.addMonitorControlListener(monitor);
+ } else {
+ cellDialogs.get(icao).bringToTop();
}
} else if (table.equals(ScanTables.DMD)) {
if (dmdDialogs.isEmpty()) {
getScanConfig().reload(ScanTables.DMD);
}
- if (dmdDialogs.get(icao) == null) {
+ if (dmdDialogs.get(icao) == null||dmdDialogs.get(icao).isDisposed()) {
SCANDmdTableDlg dmdDialog = new SCANDmdTableDlg(shell, icao,
new SCANTableData(ScanTables.DMD));
dmdDialogs.put(icao, dmdDialog);
monitor.addMonitorListener(dmdDialog);
dmdDialog.addMonitorControlListener(monitor);
+ }else{
+ dmdDialogs.get(icao).bringToTop();
}
} else if (table.equals(ScanTables.MESO)) {
if (mesoDialogs.isEmpty()) {
getScanConfig().reload(ScanTables.MESO);
}
- if (mesoDialogs.get(icao) == null) {
+ if (mesoDialogs.get(icao) == null || mesoDialogs.get(icao).isDisposed()) {
SCANMesoTableDlg mesoDialog = new SCANMesoTableDlg(shell, icao,
new SCANTableData(ScanTables.MESO));
mesoDialogs.put(icao, mesoDialog);
monitor.addMonitorListener(mesoDialog);
mesoDialog.addMonitorControlListener(monitor);
} else {
+ mesoDialogs.get(icao).bringToTop();
return;
}
} else if (table.equals(ScanTables.TVS)) {
if (tvsDialogs.isEmpty()) {
getScanConfig().reload(ScanTables.TVS);
}
- if (tvsDialogs.get(icao) == null) {
+ if (tvsDialogs.get(icao) == null||tvsDialogs.get(icao).isDisposed()) {
SCANTvsTableDlg tvsDialog = new SCANTvsTableDlg(shell, icao,
new SCANTableData(ScanTables.TVS));
tvsDialogs.put(icao, tvsDialog);
monitor.addMonitorListener(tvsDialog);
tvsDialog.addMonitorControlListener(monitor);
} else {
+ tvsDialogs.get(icao).bringToTop();
return;
}
}
diff --git a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/DmdDisplayFilterDlg.java b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/DmdDisplayFilterDlg.java
index f20ed14bc9..71b89eb3f4 100644
--- a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/DmdDisplayFilterDlg.java
+++ b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/DmdDisplayFilterDlg.java
@@ -39,6 +39,7 @@ import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
import com.raytheon.uf.common.monitor.scan.xml.SCANAttributesXML;
import com.raytheon.uf.common.monitor.scan.xml.SCANConfigDmdXML;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
+import com.raytheon.viz.ui.dialogs.CaveSWTDialogBase.CAVE;
/**
* This class displays the DMD Display Filter Control dialog.
@@ -49,6 +50,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 12, 2009 3039 lvenable Initial creation.
+ * 24 Jul 2013 #2143 skorolev Changes for non-blocking dialog.
*
*
*
@@ -102,12 +104,17 @@ public class DmdDisplayFilterDlg extends CaveSWTDialog implements
* Callback that is called when changes are made.
*/
public DmdDisplayFilterDlg(Shell parentShell, IDisplayFilterUpdate cb) {
- super(parentShell);
+ super(parentShell, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.DO_NOT_BLOCK);
setText("DMD Display Filter Control");
displayFilterUpdateCB = cb;
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#constructShellLayout()
+ */
@Override
protected Layout constructShellLayout() {
// Create the main layout for the shell.
@@ -117,12 +124,24 @@ public class DmdDisplayFilterDlg extends CaveSWTDialog implements
return mainLayout;
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#disposed()
+ */
@Override
protected void disposed() {
lrgLabelFont.dispose();
smLabelFont.dispose();
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org
+ * .eclipse.swt.widgets.Shell)
+ */
@Override
protected void initializeComponents(Shell shell) {
// Initialize all of the controls and layouts
@@ -241,7 +260,7 @@ public class DmdDisplayFilterDlg extends CaveSWTDialog implements
@Override
public void widgetSelected(SelectionEvent e) {
applyAction();
- shell.dispose();
+ close();
}
});
@@ -364,9 +383,15 @@ public class DmdDisplayFilterDlg extends CaveSWTDialog implements
displayFilterUpdateCB.displayFilterUpdated();
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.raytheon.uf.viz.monitor.scan.commondialogs.ICommonDialogAction#
+ * closeDialog()
+ */
@Override
public void closeDialog() {
- shell.dispose();
+ close();
}
/**
diff --git a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/EditCreateTrendDlg.java b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/EditCreateTrendDlg.java
index fec4bdf53d..55ec8f93f8 100644
--- a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/EditCreateTrendDlg.java
+++ b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/EditCreateTrendDlg.java
@@ -41,6 +41,7 @@ import com.raytheon.uf.common.monitor.scan.config.SCANConfig;
import com.raytheon.uf.common.monitor.scan.config.TrendSetConfigMgr;
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
+import com.raytheon.viz.ui.dialogs.CaveSWTDialogBase.CAVE;
/**
*
@@ -52,6 +53,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 3, 2009 #3039 lvenable Initial creation
+ * 24 Jul 2013 #2143 skorolev Changes for non-blocking dialog.
*
*
*
@@ -135,12 +137,15 @@ public class EditCreateTrendDlg extends CaveSWTDialog implements
* SCAN table identifier.
*/
public EditCreateTrendDlg(Shell parentShell, ScanTables scanTable) {
- super(parentShell);
+ super(parentShell, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.DO_NOT_BLOCK);
setText("Edit/Create Trend Sets");
this.scanTable = scanTable;
}
+ /* (non-Javadoc)
+ * @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#constructShellLayout()
+ */
@Override
protected Layout constructShellLayout() {
// Create the main layout for the shell.
@@ -150,6 +155,9 @@ public class EditCreateTrendDlg extends CaveSWTDialog implements
return mainLayout;
}
+ /* (non-Javadoc)
+ * @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org.eclipse.swt.widgets.Shell)
+ */
@Override
protected void initializeComponents(Shell shell) {
/*
@@ -565,7 +573,7 @@ public class EditCreateTrendDlg extends CaveSWTDialog implements
scanCfg.getTrendConfigMgr(scanTable).saveTrendSets();
okSelected = true;
- shell.dispose();
+ close();
}
/**
@@ -642,7 +650,7 @@ public class EditCreateTrendDlg extends CaveSWTDialog implements
@Override
public void closeDialog() {
handleCancelAction();
- shell.dispose();
+ close();
}
}
diff --git a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/LoadSaveConfigDlg.java b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/LoadSaveConfigDlg.java
index f8bdaefb73..f260897808 100644
--- a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/LoadSaveConfigDlg.java
+++ b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/LoadSaveConfigDlg.java
@@ -45,35 +45,60 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.monitor.scan.config.SCANConfig;
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
+import com.raytheon.viz.ui.dialogs.CaveSWTDialogBase.CAVE;
+/**
+ * Open and Save Dialog for configuration files.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * 24 Jul 2013 #2143 skorolev Changes for non-blocking dialogs.
+ *
+ *
+ *
+ * @author
+ * @version 1.0
+ */
public class LoadSaveConfigDlg extends CaveSWTDialog {
public static enum DialogType {
OPEN, SAVE_AS
};
+ /* Type of dialog */
private DialogType dialogType;
-
+ /* Font type */
private Font controlFont;
-
+ /* File list control */
private List cfgFileList;
-
+ /* LocalizationFile */
private LocalizationFile selectedFile;
-
+ /* Localization Files */
private LocalizationFile[] locFiles;
-
+ /* Tree map of localization files */
private TreeMap locFileMap;
-
+ /* Name of new file */
private Text newFileNameTF;
-
+ /* Action button */
private Button actionBtn;
-
+ /* SCAN Table */
private ScanTables scanTable;
-
+ /* SCAN configuration */
private SCANConfig scanCfg;
+ /**
+ * Constructor
+ *
+ * @param parent
+ * @param type
+ * @param scanTable
+ */
public LoadSaveConfigDlg(Shell parent, DialogType type, ScanTables scanTable) {
- super(parent, SWT.TITLE);
+ super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.DO_NOT_BLOCK);
if (type == DialogType.OPEN) {
setText("Load " + scanTable.name() + " Configuration");
} else {
@@ -85,6 +110,9 @@ public class LoadSaveConfigDlg extends CaveSWTDialog {
scanCfg = SCANConfig.getInstance();
}
+ /* (non-Javadoc)
+ * @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#constructShellLayout()
+ */
@Override
protected Layout constructShellLayout() {
// Create the main layout for the shell.
@@ -95,12 +123,18 @@ public class LoadSaveConfigDlg extends CaveSWTDialog {
return mainLayout;
}
+ /* (non-Javadoc)
+ * @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#disposed()
+ */
@Override
protected void disposed() {
controlFont.dispose();
setReturnValue(selectedFile);
}
+ /* (non-Javadoc)
+ * @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org.eclipse.swt.widgets.Shell)
+ */
@Override
protected void initializeComponents(Shell shell) {
locFileMap = new TreeMap();
@@ -114,6 +148,9 @@ public class LoadSaveConfigDlg extends CaveSWTDialog {
getAvailableConfigFiles();
}
+ /**
+ * Create List control.
+ */
private void createListControl() {
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
Composite controlComp = new Composite(shell, SWT.NONE);
@@ -161,6 +198,9 @@ public class LoadSaveConfigDlg extends CaveSWTDialog {
}
}
+ /**
+ * Create bottom buttons.
+ */
private void createBottomButtons() {
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
Composite mainButtonComp = new Composite(shell, SWT.NONE);
@@ -189,7 +229,7 @@ public class LoadSaveConfigDlg extends CaveSWTDialog {
public void widgetSelected(SelectionEvent event) {
if (validateFileName() == true) {
saveAction();
- shell.dispose();
+ close();
}
}
});
@@ -202,18 +242,26 @@ public class LoadSaveConfigDlg extends CaveSWTDialog {
cancelBtn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
selectedFile = null;
- shell.dispose();
+ setReturnValue(null);
+ close();
}
});
}
+ /**
+ * Open action.
+ */
private void openAction() {
int selectedIndex = cfgFileList.getSelectionIndex();
String str = cfgFileList.getItem(selectedIndex);
selectedFile = locFileMap.get(str);
- shell.dispose();
+ setReturnValue(selectedFile);
+ close();
}
+ /**
+ * Save action.
+ */
private void saveAction() {
// TODO : need to save a file
@@ -224,10 +272,15 @@ public class LoadSaveConfigDlg extends CaveSWTDialog {
LocalizationType.COMMON_STATIC, LocalizationLevel.SITE);
String newFileName = getConfigPath() + fileName;
selectedFile = pm.getLocalizationFile(context, newFileName);
-
- shell.dispose();
+ setReturnValue(selectedFile);
+ close();
}
+ /**
+ * Validate file.
+ *
+ * @return
+ */
private boolean validateFileName() {
StringBuffer strBuf = new StringBuffer(newFileNameTF.getText().trim());
@@ -278,6 +331,9 @@ public class LoadSaveConfigDlg extends CaveSWTDialog {
return true;
}
+ /**
+ * Get available configuration files.
+ */
private void getAvailableConfigFiles() {
String[] extensions = new String[] { ".xml" };
locFiles = PathManagerFactory.getPathManager().listStaticFiles(
@@ -288,11 +344,6 @@ public class LoadSaveConfigDlg extends CaveSWTDialog {
}
for (int i = 0; i < locFiles.length; i++) {
- System.out.println("Get file, get name --- "
- + locFiles[i].getFile().getName());
- System.out.println("Get name *** "
- + locFiles[i].getName());
- // locFileMap.put(locFiles[i].getName(), locFiles[i]);
locFileMap.put(locFiles[i].getFile().getName(), locFiles[i]);
}
@@ -305,10 +356,20 @@ public class LoadSaveConfigDlg extends CaveSWTDialog {
}
}
+ /**
+ * Get path.
+ *
+ * @return
+ */
private String getConfigPath() {
return scanCfg.getConfigurationPath(scanTable);
}
+ /**
+ * Get localization file.
+ *
+ * @return
+ */
public LocalizationFile getSelectedFile() {
return selectedFile;
}
diff --git a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/SCANAlarmThreshDlg.java b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/SCANAlarmThreshDlg.java
index 17fb90f90a..5557676069 100644
--- a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/SCANAlarmThreshDlg.java
+++ b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/SCANAlarmThreshDlg.java
@@ -19,8 +19,6 @@
**/
package com.raytheon.uf.viz.monitor.scan.commondialogs;
-import java.util.Set;
-
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
@@ -45,49 +43,71 @@ import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
import com.raytheon.uf.viz.monitor.scan.ScanMonitor;
import com.raytheon.uf.viz.monitor.scan.tables.AbstractTableDlg;
import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager;
-import com.raytheon.uf.viz.monitor.scan.tables.SCANCellTableDlg;
import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager.AlarmType;
-import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager.AlertedAlarms;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
+/**
+ * SCAN Alarm Threshold Dialog.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * 24 Jul 2013 #2143 skorolev Changes for non-blocking dialogs.
+ *
+ *
+ *
+ * @author
+ * @version 1.0
+ */
public class SCANAlarmThreshDlg extends CaveSWTDialog implements
ICommonDialogAction {
+ /* SCAN Table */
private ScanTables scanTable;
-
+ /* SCAN Configuration */
private SCANConfig scanCfg;
-
+ /* Attribute combo control */
private Combo attributeCbo;
-
+ /* Disable All Alarms Checkbox */
private Button disableAllAlarmChk;
-
+ /* Absolute Value Rdo */
private Button absValueRdo;
-
+ /* Rate Of Change Rdo */
private Button rateOfChangeRdo;
-
+ /* Selected Choice Label */
private Label selectedChoiceLbl;
-
+ /* Time Frame Value */
private Text valueTF;
-
+ /* Unit Label */
private Label unitsLbl;
-
+ /* "Absolute Value" */
private final String absValStr = "Absolute Value";
-
+ /* "Rate of Change" */
private final String rocStr = "Rate of Change";
-
+ /* Bell Checkbox */
private Button bellChk;
-
+ /* SCAN Alarm Alert Manager */
private SCANAlarmAlertManager mgr;
-
+ /* Alarm Type */
private AlarmType type;
-
+ /* prevAttr */
private String prevAttr;
-
+ /* Site */
private String site = null;
+ /**
+ * Constructor
+ *
+ * @param site
+ * @param parentShell
+ * @param scanTable
+ */
public SCANAlarmThreshDlg(String site, Shell parentShell,
ScanTables scanTable) {
- super(parentShell);
+ super(parentShell, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.DO_NOT_BLOCK);
if (scanTable == ScanTables.CELL) {
setText("CELL Alarm Thresh");
} else {
@@ -99,6 +119,9 @@ public class SCANAlarmThreshDlg extends CaveSWTDialog implements
this.site = site;
}
+ /* (non-Javadoc)
+ * @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#constructShellLayout()
+ */
@Override
protected Layout constructShellLayout() {
// Create the main layout for the shell.
@@ -108,6 +131,9 @@ public class SCANAlarmThreshDlg extends CaveSWTDialog implements
return mainLayout;
}
+ /* (non-Javadoc)
+ * @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org.eclipse.swt.widgets.Shell)
+ */
@Override
protected void initializeComponents(Shell shell) {
// Initialize all of the controls and layouts
@@ -119,6 +145,9 @@ public class SCANAlarmThreshDlg extends CaveSWTDialog implements
attributeChanged();
}
+ /**
+ * Create Dialog Controls
+ */
private void createControls() {
Composite controlComp = new Composite(shell, SWT.NONE);
controlComp.setLayout(new GridLayout(3, false));
@@ -230,6 +259,9 @@ public class SCANAlarmThreshDlg extends CaveSWTDialog implements
unitsLbl.setLayoutData(gd);
}
+ /**
+ * Create Bottom Buttons.
+ */
private void createBottomButtons() {
Composite buttonComp = new Composite(shell, SWT.NONE);
buttonComp.setLayout(new GridLayout(2, true));
@@ -255,7 +287,7 @@ public class SCANAlarmThreshDlg extends CaveSWTDialog implements
} else {
tableDlg.turnOnAlarm();
}
- shell.dispose();
+ close();
}
});
@@ -272,6 +304,11 @@ public class SCANAlarmThreshDlg extends CaveSWTDialog implements
});
}
+ /**
+ * Add Separator.
+ *
+ * @param parentComp
+ */
private void addSeparator(Composite parentComp) {
GridLayout gl = (GridLayout) parentComp.getLayout();
@@ -281,6 +318,9 @@ public class SCANAlarmThreshDlg extends CaveSWTDialog implements
sepLbl.setLayoutData(gd);
}
+ /**
+ * Populate Attribute Combo control.
+ */
private void populateAttributeCombo() {
AbsConfigMgr absCfgMgr = scanCfg.getAbsConfigMgr(scanTable);
@@ -293,17 +333,12 @@ public class SCANAlarmThreshDlg extends CaveSWTDialog implements
attributeCbo.select(0);
}
+ /**
+ * Attribute Changed.
+ */
private void attributeChanged() {
String attrName = attributeCbo
.getItem(attributeCbo.getSelectionIndex());
- /*
- * Check if the alarm is disabled and enable/disable the controls.
- */
- // boolean alarmDisabled = scanCfg.getAlarmsDisabled(scanTable);
- // System.out.println("alarmDisabled = " + alarmDisabled);
- // disableAllAlarmChk.setSelection(alarmDisabled);
- //
- // disableSelectedAttributeAlarm(alarmDisabled);
/*
* Set the value text control with the proper abs/roc value.
@@ -316,15 +351,12 @@ public class SCANAlarmThreshDlg extends CaveSWTDialog implements
unitsLbl.setText(scanCfg.getAbsConfigMgr(scanTable).getUnit(attrName));
}
+ /**
+ * Disable Selected Attribute Alarm.
+ *
+ * @param alarmDisabled
+ */
private void disableSelectedAttributeAlarm(boolean alarmDisabled) {
- // String attrName =
- // attributeCbo.getItem(attributeCbo.getSelectionIndex());
- // boolean alarmEnabled = !disableAlarmChk.getSelection();
- //
- // scanCfg.getAbsConfigMgr(scanTable).setAlarmDisabled(attrName,
- // alarmEnabled);
-
- System.out.println("alarmDisabled = " + alarmDisabled);
absValueRdo.setEnabled(!alarmDisabled);
@@ -341,6 +373,9 @@ public class SCANAlarmThreshDlg extends CaveSWTDialog implements
valueTF.setEnabled(!alarmDisabled);
}
+ /**
+ * Alarm Choice Changed.
+ */
private void alarmChoiceChanged() {
if (!valueTF.getText().isEmpty()) {
mgr.updateScheduledAlarm(site, scanTable, prevAttr, type,
@@ -366,6 +401,9 @@ public class SCANAlarmThreshDlg extends CaveSWTDialog implements
prevAttr = attrName;
}
+ /**
+ * Validate And Set Time Frame Value.
+ */
private void validateAndSetValue() {
int newValue = 0;
String valueStr = valueTF.getText().trim();
@@ -406,8 +444,11 @@ public class SCANAlarmThreshDlg extends CaveSWTDialog implements
}
}
+ /* (non-Javadoc)
+ * @see com.raytheon.uf.viz.monitor.scan.commondialogs.ICommonDialogAction#closeDialog()
+ */
@Override
public void closeDialog() {
- shell.dispose();
+ close();
}
}
diff --git a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/SCANAlarmTimeLimitDlg.java b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/SCANAlarmTimeLimitDlg.java
index eb3c10aac0..4e3cc7d848 100644
--- a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/SCANAlarmTimeLimitDlg.java
+++ b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/SCANAlarmTimeLimitDlg.java
@@ -43,6 +43,7 @@ import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
import com.raytheon.uf.common.monitor.scan.xml.ScanAlarmXML;
import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
+import com.raytheon.viz.ui.dialogs.CaveSWTDialogBase.CAVE;
/**
*
@@ -53,6 +54,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 22, 2010 lvenable Initial creation
+ * 24 Jul 2013 #2143 skorolev Changes for non-blocking dialogs.
*
*
*
@@ -62,30 +64,64 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
public class SCANAlarmTimeLimitDlg extends CaveSWTDialog implements
ICommonDialogAction {
+ /**
+ * Scan Tables
+ */
private ScanTables scanTable;
+ /**
+ * Cell Spinner
+ */
private Spinner cellSpnr;
+ /**
+ * Meso Spinner
+ */
private Spinner mesoSpnr;
+ /**
+ * TVS Spinner
+ */
private Spinner tvsSpnr;
+ /**
+ * DMD Spinner
+ */
private Spinner dmdSpnr;
+ /**
+ * Label Width
+ */
private int labelWidth = 80;
+ /**
+ * Width Spinner
+ */
private int spinnerWidth = 70;
+ /**
+ * SCAN Alarm XML
+ */
private ScanAlarmXML dataXML;
+ /**
+ * Constructor
+ *
+ * @param parentShell
+ * @param scanTable
+ * @param site
+ */
public SCANAlarmTimeLimitDlg(Shell parentShell, ScanTables scanTable,
String site) {
- super(parentShell);
+ super(parentShell, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.DO_NOT_BLOCK);
setText("Alarm Time Limit for: " + site);
this.scanTable = scanTable;
}
+ /* (non-Javadoc)
+ * @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#constructShellLayout()
+ */
@Override
protected Layout constructShellLayout() {
// Create the main layout for the shell.
@@ -95,6 +131,9 @@ public class SCANAlarmTimeLimitDlg extends CaveSWTDialog implements
return mainLayout;
}
+ /* (non-Javadoc)
+ * @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org.eclipse.swt.widgets.Shell)
+ */
@Override
protected void initializeComponents(Shell shell) {
@@ -114,6 +153,9 @@ public class SCANAlarmTimeLimitDlg extends CaveSWTDialog implements
createBottomButtons();
}
+ /**
+ * Create CELL, MESO, TVS Controls.
+ */
private void createCellMesoTvsControls() {
Composite controlComp = new Composite(shell, SWT.NONE);
GridLayout gl = new GridLayout(3, false);
@@ -195,6 +237,9 @@ public class SCANAlarmTimeLimitDlg extends CaveSWTDialog implements
}
}
+ /**
+ * Create DMD Controls
+ */
private void createDmdControls() {
Composite controlComp = new Composite(shell, SWT.NONE);
GridLayout gl = new GridLayout(3, false);
@@ -231,6 +276,9 @@ public class SCANAlarmTimeLimitDlg extends CaveSWTDialog implements
}
}
+ /**
+ * Create Bottom Buttons.
+ */
private void createBottomButtons() {
Composite buttonComp = new Composite(shell, SWT.NONE);
buttonComp.setLayout(new GridLayout(2, true));
@@ -247,7 +295,7 @@ public class SCANAlarmTimeLimitDlg extends CaveSWTDialog implements
public void widgetSelected(SelectionEvent e) {
saveAlarmData();
- shell.dispose();
+ close();
}
});
@@ -259,16 +307,22 @@ public class SCANAlarmTimeLimitDlg extends CaveSWTDialog implements
cancelBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- shell.dispose();
+ close();
}
});
}
+ /* (non-Javadoc)
+ * @see com.raytheon.uf.viz.monitor.scan.commondialogs.ICommonDialogAction#closeDialog()
+ */
@Override
public void closeDialog() {
- shell.dispose();
+ close();
}
+ /**
+ * Read Alarm Data.
+ */
private void readAlarmData()
{
try
@@ -281,12 +335,14 @@ public class SCANAlarmTimeLimitDlg extends CaveSWTDialog implements
}
catch (Exception e)
{
-// e.printStackTrace();
System.out.println("*** ScanAlarms.xml not available.");
dataXML = null;
}
}
+ /**
+ * Save Alarm Data.
+ */
private void saveAlarmData()
{
if (dataXML == null)
@@ -329,6 +385,11 @@ public class SCANAlarmTimeLimitDlg extends CaveSWTDialog implements
}
}
+ /**
+ * Get Full Path And File Name.
+ *
+ * @return file name
+ */
public String getFullPathAndFileName()
{
String fs = String.valueOf(File.separatorChar);
diff --git a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/SCANAttributesDlg.java b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/SCANAttributesDlg.java
index 5b49443101..43ef853250 100644
--- a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/SCANAttributesDlg.java
+++ b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/SCANAttributesDlg.java
@@ -35,25 +35,61 @@ import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.monitor.scan.config.SCANConfig;
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
+import com.raytheon.viz.ui.dialogs.CaveSWTDialogBase.CAVE;
+/**
+ * SCAN Attributes Dialog.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * 24 Jul 2013 #2143 skorolev Changes for non-blocking dialogs.
+ *
+ *
+ *
+ * @author
+ * @version 1.0
+ */
public class SCANAttributesDlg extends CaveSWTDialog implements
ICommonDialogAction {
+ /**
+ * Attribute checkboxes.
+ */
private ArrayList