Issue #2592 - Fixed SWT checkbox issue with colored background/foreground.

Change-Id: I94e9c691ca68c0d22e27ba107d99b8397f1d942b

Former-commit-id: 931d3ca0a1 [formerly d420f11832] [formerly 9c64148733] [formerly 9c64148733 [formerly 266d4884da]] [formerly a385ec612c [formerly 9c64148733 [formerly 266d4884da] [formerly a385ec612c [formerly a1624e9bcf8677d6edd76a68122aa07690383b34]]]]
Former-commit-id: a385ec612c
Former-commit-id: 90695136c9e69f6732330532cca7999d5f9551d7 [formerly a8a45bbbf444fd2b11c872dd17abd893d3419ecd] [formerly cddca699c6 [formerly d433717c8c]]
Former-commit-id: cddca699c6
Former-commit-id: 35352350b7
This commit is contained in:
Lee Venable 2013-12-04 16:35:54 -06:00
parent 1305571156
commit f231694cef
7 changed files with 322 additions and 288 deletions

View file

@ -20,9 +20,6 @@
package com.raytheon.uf.viz.monitor.scan.commondialogs;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseMoveListener;
import org.eclipse.swt.events.MouseTrackAdapter;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Font;
@ -37,8 +34,8 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Spinner;
import com.raytheon.uf.common.monitor.scan.config.SCANConfig;
import com.raytheon.uf.common.monitor.scan.config.UnwarnedConfig;
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanColors;
import com.raytheon.uf.common.monitor.scan.config.UnwarnedConfig;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
/**
@ -51,6 +48,10 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 25, 2009 lvenable Initial creation
* 04 Dec 2013 #2592 lvenable Update how the checkboxes are handled
* (background/foreground colors) since the Redhat
* 6 upgrade causes the check in the checkbox to be
* colored the same as the background.
*
* </pre>
*
@ -221,21 +222,14 @@ public class SCANUnwarnedDlg extends CaveSWTDialog implements
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
gd.horizontalSpan = 4;
gd.verticalIndent = 20;
unwarnedTorChk = new Button(controlComp, SWT.CHECK);
unwarnedTorChk.setText("Unwarned TOR");
unwarnedTorChk = createCheckLabelColor(controlComp, gd, "Unwarned TOR");
unwarnedTorChk.setSelection(cfgData.getUnwarnedTor());
unwarnedTorChk.setBackground(SCANConfig.getInstance().getScanColor(
ScanColors.Unwarned));
unwarnedTorChk.setForeground(getDisplay().getSystemColor(
SWT.COLOR_WHITE));
unwarnedTorChk.setLayoutData(gd);
unwarnedTorChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
enableTorControls();
}
});
setupButtonMouseListeners(unwarnedTorChk);
gd = new GridData(SWT.LEFT, SWT.CENTER, false, true);
gd.horizontalSpan = 2;
@ -284,21 +278,14 @@ public class SCANUnwarnedDlg extends CaveSWTDialog implements
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
gd.horizontalSpan = 4;
gd.verticalIndent = 20;
unwarnedSvrChk = new Button(controlComp, SWT.CHECK);
unwarnedSvrChk.setText("Unwarned SVR");
unwarnedSvrChk = createCheckLabelColor(controlComp, gd, "Unwarned SVR");
unwarnedSvrChk.setSelection(cfgData.getUnwarnedSvr());
unwarnedSvrChk.setBackground(SCANConfig.getInstance().getScanColor(
ScanColors.Unwarned));
unwarnedSvrChk.setForeground(getDisplay().getSystemColor(
SWT.COLOR_WHITE));
unwarnedSvrChk.setLayoutData(gd);
unwarnedSvrChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
enableSvrControls();
}
});
setupButtonMouseListeners(unwarnedSvrChk);
gd = new GridData(SWT.LEFT, SWT.CENTER, false, true);
gd.horizontalSpan = 2;
@ -549,59 +536,58 @@ public class SCANUnwarnedDlg extends CaveSWTDialog implements
infoText.append("SCAN identifies those storm cells that contain a\n");
infoText.append("Tornado Vortex Signature (TVS) and to some extent\n");
infoText
.append("severe weather (based on various storm cell parameters).\n");
infoText
.append("Now SCAN can determine which storm cells currently have\n");
infoText.append("severe weather (based on various storm cell parameters).\n");
infoText.append("Now SCAN can determine which storm cells currently have\n");
infoText.append("an active TOR or SVR warning and which do not. For\n");
infoText
.append("those that do not, the SCAN user can set various storm\n");
infoText
.append("cell parameter thresholds (see below). If these thresholds\n");
infoText
.append("are met or exceeded and no TOR and/or SVR is in effect\n");
infoText
.append("in the polygon where the cell is located, an Unwarned Storm\n");
infoText.append("those that do not, the SCAN user can set various storm\n");
infoText.append("cell parameter thresholds (see below). If these thresholds\n");
infoText.append("are met or exceeded and no TOR and/or SVR is in effect\n");
infoText.append("in the polygon where the cell is located, an Unwarned Storm\n");
infoText.append("Alarm will be issued.\n\n");
infoText
.append("To turn this functionality on for TOR and/or SVR warnings,\n");
infoText
.append("simply click the toggle below on and then check and specify\n");
infoText
.append("the thresholds you would like be used in order to issue a TOR\n");
infoText
.append("and/or SVR Unwarned Storm Cell Alarm. You will know that\n");
infoText
.append("an Unwarned Storm Alarm has been issued when the storm\n");
infoText
.append("cell identifier in the Storm Cell Table changes color to\n");
infoText
.append("magenta for TOR warnings and yellow for SVR warnings.");
infoText.append("To turn this functionality on for TOR and/or SVR warnings,\n");
infoText.append("simply click the toggle below on and then check and specify\n");
infoText.append("the thresholds you would like be used in order to issue a TOR\n");
infoText.append("and/or SVR Unwarned Storm Cell Alarm. You will know that\n");
infoText.append("an Unwarned Storm Alarm has been issued when the storm\n");
infoText.append("cell identifier in the Storm Cell Table changes color to\n");
infoText.append("magenta for TOR warnings and yellow for SVR warnings.");
}
private void setupButtonMouseListeners(final Button btn) {
btn.addMouseMoveListener(new MouseMoveListener() {
@Override
public void mouseMove(MouseEvent e) {
btn.setForeground(shell.getDisplay().getSystemColor(
SWT.COLOR_BLACK));
}
/**
* Create a composite that contains a checkbox with no text and a colored
* label.
*
* @param parentComp
* Parent composite.
* @param gd
* GridData used for the composite.
* @param labelText
* Text for the label.
* @return The checkbox that is created.
*/
private Button createCheckLabelColor(Composite parentComp, GridData gd,
String labelText) {
});
GridLayout gl = new GridLayout(2, false);
gl.marginHeight = 2;
gl.marginWidth = 2;
gl.horizontalSpacing = 0;
btn.addMouseTrackListener(new MouseTrackAdapter() {
@Override
public void mouseExit(MouseEvent e) {
btn.setForeground(shell.getDisplay().getSystemColor(
SWT.COLOR_WHITE));
}
Composite chkLblComp = new Composite(parentComp, SWT.NONE);
chkLblComp.setLayout(gl);
chkLblComp.setLayoutData(gd);
@Override
public void mouseEnter(MouseEvent e) {
btn.setForeground(shell.getDisplay().getSystemColor(
SWT.COLOR_BLACK));
}
});
gd = new GridData(18, SWT.DEFAULT);
Button chkBox = new Button(chkLblComp, SWT.CHECK);
chkBox.setLayoutData(gd);
Label lbl = new Label(chkLblComp, SWT.NONE);
lbl.setBackground(SCANConfig.getInstance().getScanColor(
ScanColors.Unwarned));
lbl.setForeground(getDisplay().getSystemColor(SWT.COLOR_WHITE));
lbl.setText(" " + labelText);
return chkBox;
}
@Override

View file

@ -63,6 +63,8 @@ import com.raytheon.uf.viz.monitor.scan.ScanMonitor;
* Feb 28, 2013 1731 bsteffen Optimize construction of scan resource.
* Apr 18, 2013 1926 njensen Reuse URIs in construction of resource
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* 04 Dec 2013 #2592 lvenable Added check to ensure the PluginDataObject
* array has at least one element.
*
* </pre>
*
@ -97,56 +99,37 @@ public class ScanResourceData extends AbstractRequestableResourceData {
protected AbstractVizResource<?, ?> constructResource(
LoadProperties loadProperties, PluginDataObject[] objects)
throws VizException {
List<String> uris = getScan().getAvailableUris(
ScanTables.valueOf(tableType), icao);
try {
long t0 = System.currentTimeMillis();
// Forces ScanMonitor to grab data back for one extra hour 1/2 past
// the first time.
Calendar firstCal = ((ScanRecord) objects[0]).getDataTime()
.getRefTimeAsCalendar();
firstCal.add(Calendar.MINUTE, -90);
Date firstDate = firstCal.getTime();
int count = 0;
List<ScanRecord> recordsToLoad = new ArrayList<ScanRecord>(
uris.size());
for (String uri : uris) {
ScanRecord record = new ScanRecord(uri);
if (record.getDataTime().getRefTime().after(firstDate)) {
recordsToLoad.add(record);
}
}
ScanRecord[] records = recordsToLoad.toArray(new ScanRecord[0]);
populateRecords(records);
for (ScanRecord record : records) {
if ((record.getTableData() != null)
&& (record.getDataTime() != null)
&& (record.getTableData().getVolScanTime() != null)) {
if (objects.length > 0) {
getScan().setTableData(icao, record.getTableData(),
/*
* TODO: This should be the volume scan time, but
* {Radar,Scan}Record.getVolScanTime is actually the radar
* product generation time.
*/
record.getDataTime().getRefTime(), record.getTilt(),
record.getDataTime().getRefTime(), tableType);
count++;
if (record.getType().equals(ScanTables.DMD.name())) {
if (dataObjectMap == null) {
dataObjectMap = new HashMap<DataTime, ScanRecord>();
}
dataObjectMap.put(record.getDataTime(), record);
List<String> uris = getScan().getAvailableUris(
ScanTables.valueOf(tableType), icao);
try {
long t0 = System.currentTimeMillis();
// Forces ScanMonitor to grab data back for one extra hour 1/2
// past
// the first time.
Calendar firstCal = ((ScanRecord) objects[0]).getDataTime()
.getRefTimeAsCalendar();
firstCal.add(Calendar.MINUTE, -90);
Date firstDate = firstCal.getTime();
int count = 0;
List<ScanRecord> recordsToLoad = new ArrayList<ScanRecord>(
uris.size());
for (String uri : uris) {
ScanRecord record = new ScanRecord(uri);
if (record.getDataTime().getRefTime().after(firstDate)) {
recordsToLoad.add(record);
}
}
}
ScanRecord[] records = recordsToLoad.toArray(new ScanRecord[0]);
populateRecords(records);
for (ScanRecord record : records) {
if ((record.getTableData() != null)
&& (record.getDataTime() != null)
&& (record.getTableData().getVolScanTime() != null)) {
// populate the DMD data map
if (tableType.equals(ScanTables.DMD.name())) {
if (dataObjectMap != null) {
for (ScanRecord record : dataObjectMap.values()) {
getScan().setTableData(icao, record.getTableData(),
/*
* TODO: This should be the volume scan time, but
@ -154,39 +137,64 @@ public class ScanResourceData extends AbstractRequestableResourceData {
* radar product generation time.
*/
record.getDataTime().getRefTime(), record.getTilt(),
record.getDataTime().getRefTime(),
record.getType());
getScan().setDmdTilt(record.getTilt(), icao);
getScan().addDmdScanRecord(record);
record.getDataTime().getRefTime(), tableType);
count++;
if (record.getType().equals(ScanTables.DMD.name())) {
if (dataObjectMap == null) {
dataObjectMap = new HashMap<DataTime, ScanRecord>();
}
dataObjectMap.put(record.getDataTime(), record);
}
}
}
}
long t4 = System.currentTimeMillis();
System.out.println("Loaded " + count + " out of " + uris.size()
+ " objects in " + (t4 - t0) + "ms");
// need to update the dialog here after the
// scanResourceData has been fully populated
getScan().setInstantiated(true);
if ((getScan().getDialog(ScanTables.valueOf(tableType), icao) != null)
&& !getScan()
.getDialog(ScanTables.valueOf(tableType), icao)
.getCurrentShell().isDisposed()) {
DataTime time = getScan().getMostRecent(getScan(), tableType,
icao);
if (time != null) {
getScan().updateDialog(
ScanTables.valueOf(tableType),
icao,
time.getRefTime(),
time.getRefTime(),
getScan().getTiltAngle(
ScanTables.valueOf(tableType), icao));
// populate the DMD data map
if (tableType.equals(ScanTables.DMD.name())) {
if (dataObjectMap != null) {
for (ScanRecord record : dataObjectMap.values()) {
getScan().setTableData(icao, record.getTableData(),
/*
* TODO: This should be the volume scan time, but
* {Radar,Scan}Record.getVolScanTime is actually the
* radar product generation time.
*/
record.getDataTime().getRefTime(),
record.getTilt(),
record.getDataTime().getRefTime(),
record.getType());
getScan().setDmdTilt(record.getTilt(), icao);
getScan().addDmdScanRecord(record);
}
}
}
long t4 = System.currentTimeMillis();
System.out.println("Loaded " + count + " out of " + uris.size()
+ " objects in " + (t4 - t0) + "ms");
// need to update the dialog here after the
// scanResourceData has been fully populated
getScan().setInstantiated(true);
if ((getScan().getDialog(ScanTables.valueOf(tableType), icao) != null)
&& !getScan()
.getDialog(ScanTables.valueOf(tableType), icao)
.getCurrentShell().isDisposed()) {
DataTime time = getScan().getMostRecent(getScan(),
tableType, icao);
if (time != null) {
getScan().updateDialog(
ScanTables.valueOf(tableType),
icao,
time.getRefTime(),
time.getRefTime(),
getScan().getTiltAngle(
ScanTables.valueOf(tableType), icao));
}
}
} catch (Exception e) {
e.printStackTrace();
getScan().closeDialog(icao);
}
} catch (Exception e) {
e.printStackTrace();
getScan().closeDialog(icao);
}
return new ScanResource(this, loadProperties);
}

View file

@ -40,8 +40,10 @@ import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.MessageBox;
@ -78,6 +80,10 @@ import com.raytheon.uf.viz.monitor.scan.commondialogs.LoadSaveConfigDlg.DialogTy
* Apr 26, 2013 #1945 lvenable Some code cleanup.
* 06 Jun 2013 #2065 lvenable Added convenience method to alert the user to use the clear
* button if they want to close the dialog.
* 04 Dec 2013 #2592 lvenable Update how the checkboxes are handled
* (background/foreground colors) since the Redhat
* 6 upgrade causes the check in the checkbox to be
* colored the same as the background.
* </pre>
*
* @author lvenable
@ -642,6 +648,62 @@ public abstract class AbstractTableDlg extends Dialog implements IMonitor,
// this will mean firing a get graphData Event back to the monitor
}
/**
* This is a method that will create a composite that contains a checkbox
* with no text and a label. Since the upgrade to Redhat 6, a checkbox that
* has its foreground and background color changed can cause the check in
* the checkbox to become invisible if the foreground color is too light.
* This method creates an ordinary checkbox with the label and composite
* background being colored.
*
* @param parentComp
* Parent composite.
* @param bgColor
* Background color.
* @param fgColor
* Foreground color.
* @param labelText
* Text for the label.
* @param colorComposite
* Flag indicating if the composite background color should be
* set.
* @param toolTipText
* Set the toolTipText
* @return The checkbox control that is created.
*/
protected final Button createCheckLabelComposite(Composite parentComp,
Color bgColor, Color fgColor, String labelText,
boolean colorComposite, String toolTipText) {
GridData gd = new GridData();
GridLayout gl = new GridLayout(2, false);
gl.marginHeight = 2;
gl.marginWidth = 2;
gl.horizontalSpacing = 0;
Composite chkLblComp = new Composite(parentComp, SWT.NONE);
chkLblComp.setLayout(gl);
chkLblComp.setLayoutData(gd);
if (colorComposite) {
chkLblComp.setBackground(bgColor);
}
gd = new GridData(18, SWT.DEFAULT);
Button chkBox = new Button(chkLblComp, SWT.CHECK);
chkBox.setLayoutData(gd);
Label lbl = new Label(chkLblComp, SWT.NONE);
lbl.setBackground(bgColor);
lbl.setForeground(fgColor);
lbl.setText(" " + labelText);
chkBox.setToolTipText(toolTipText);
lbl.setToolTipText(toolTipText);
return chkBox;
}
@Override
public ArrayList<IMonitor> getMonitorControlListeners() {
return controlListeners;

View file

@ -92,6 +92,10 @@ import com.raytheon.viz.ui.EditorUtil;
* some bad code, and some code cleanup.
* 06 Jun 2013 #2065 lvenable Added code to alert the user to use the clear
* button if they want to close the dialog.
* 04 Dec 2013 #2592 lvenable Update how the checkboxes are handled
* (background/foreground colors) since the Redhat
* 6 upgrade causes the check in the checkbox to be
* colored the same as the background.
*
* </pre>
*
@ -306,13 +310,11 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
}
});
gd = new GridData();
configBtn = new Button(controlComp, SWT.PUSH);
configBtn.setText("Configurations");
configBtn
.setBackground(scanCfg.getScanColor(ScanColors.Configurations));
configBtn.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
configBtn.setLayoutData(gd);
configBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@ -343,12 +345,10 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
});
setupButtonMouseListeners(rankBtn);
gd = new GridData();
attribBtn = new Button(controlComp, SWT.PUSH);
attribBtn.setText("Attributes");
attribBtn.setBackground(scanCfg.getScanColor(ScanColors.Attributes));
attribBtn.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
attribBtn.setLayoutData(gd);
attribBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@ -358,12 +358,10 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
});
setupButtonMouseListeners(attribBtn);
gd = new GridData();
tablesBtn = new Button(controlComp, SWT.PUSH);
tablesBtn.setText("Tables");
tablesBtn.setBackground(scanCfg.getScanColor(ScanColors.Default));
tablesBtn.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
tablesBtn.setLayoutData(gd);
tablesBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@ -376,55 +374,58 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
});
setupButtonMouseListeners(tablesBtn);
gd = new GridData();
linkToFrameChk = new Button(controlComp, SWT.CHECK);
linkToFrameChk.setText("Link to Frame ");
linkToFrameChk.setBackground(scanCfg
.getScanColor(ScanColors.LinkToFrame));
linkToFrameChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
/*
* Link to Frame
*/
linkToFrameChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.LinkToFrame),
display.getSystemColor(SWT.COLOR_WHITE), "Link to Frame ",
true, null);
linkToFrameChk.setSelection(cellCfgMgr.getScanCellCfgXML()
.getLinkToFrame());
linkToFrameChk.setLayoutData(gd);
linkToFrameChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleLinkToFrame();
}
});
setupButtonMouseListeners(linkToFrameChk);
/*
* CWA Filter
*/
StringBuilder tipText = new StringBuilder();
tipText.append("Activate to remove from the SCAN table all cells,\n");
tipText.append("MESOs, and TVS's that are outside your CWA.\n\n");
tipText.append("Deactivate to include in the SCAN table all cells,\n");
tipText.append("MESOs, and TVS's detected by radar.");
gd = new GridData();
cwaFilterChk = new Button(controlComp, SWT.CHECK);
cwaFilterChk.setText("CWA Filter ");
cwaFilterChk.setBackground(scanCfg.getScanColor(ScanColors.CWAFilter));
cwaFilterChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
cwaFilterChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.CWAFilter),
display.getSystemColor(SWT.COLOR_WHITE), "CWA Filter ", true,
tipText.toString());
cwaFilterChk.setSelection(cellCfgMgr.getScanCellCfgXML()
.getFilterOption());
cwaFilterChk.setLayoutData(gd);
cwaFilterChk.setToolTipText(tipText.toString());
cwaFilterChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleCWAFilterAction();
}
});
setupButtonMouseListeners(cwaFilterChk);
// Uses same back ground color as attributes.
gd = new GridData();
unwarnedChk = new Button(controlComp, SWT.CHECK);
unwarnedChk.setText("Unwarned ");
unwarnedChk.setBackground(scanCfg.getScanColor(ScanColors.Attributes));
unwarnedChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
/*
* Unwarned
*/
unwarnedChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.Attributes),
display.getSystemColor(SWT.COLOR_WHITE), "Unwarned ", true,
null);
unwarnedChk.setSelection(cellCfgMgr.getScanCellCfgXML()
.getFilterOption());
unwarnedChk.setLayoutData(gd);
unwarnedChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@ -432,41 +433,31 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
displayUnwarnedAlarmDialog();
}
});
setupButtonMouseListeners(unwarnedChk);
// Create/Recreate the unwarned config data since the ScanConfig is a
// singleton
// and the data clears out when the CELL table dialog get re-created.
// singleton and the data clears out when the CELL table dialog get
// re-created.
scanCfg.createUnwarnedConfig();
// Vertical tables are not supported at this time.
gd = new GridData();
vertChk = new Button(controlComp, SWT.CHECK);
vertChk.setText("Vert ");
vertChk.setEnabled(false);
vertChk.setBackground(scanCfg.getScanColor(ScanColors.Vert));
vertChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
/*
* Vertical - tech blocked
*/
vertChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.Vert),
display.getSystemColor(SWT.COLOR_WHITE), "Vert ", true, null);
vertChk.setSelection(cellCfgMgr.getScanCellCfgXML().getFilterOption());
vertChk.setLayoutData(gd);
vertChk.setEnabled(false);
/*
* The vertical table is a techblocked DR. This selection listener will
* be commented out until it is needed.
* Tool tips
*/
// vertChk.addSelectionListener(new SelectionAdapter() {
// @Override
// public void widgetSelected(SelectionEvent e) {
// }
// });
setupButtonMouseListeners(vertChk);
tipsChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.Tips),
display.getSystemColor(SWT.COLOR_WHITE), "Tips ", true, null);
gd = new GridData();
tipsChk = new Button(controlComp, SWT.CHECK);
tipsChk.setText("Tips ");
tipsChk.setBackground(scanCfg.getScanColor(ScanColors.Tips));
tipsChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
tipsChk.setSelection(cellCfgMgr.getScanCellCfgXML().getTipsOption());
tipsChk.setLayoutData(gd);
tipsChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@ -474,8 +465,10 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
scanTableComp.updateColumnTips();
}
});
setupButtonMouseListeners(tipsChk);
/*
* Alarm button
*/
gd = new GridData(SWT.RIGHT, SWT.DEFAULT, true, false);
gd.widthHint = 75;
alarmBtn = new Button(controlComp, SWT.PUSH);

View file

@ -93,6 +93,10 @@ import com.raytheon.viz.ui.EditorUtil;
* some bad code, and some code cleanup.
* 06 Jun 2013 #2065 lvenable Added code to alert the user to use the clear
* button if they want to close the dialog.
* 04 Dec 2013 #2592 lvenable Update how the checkboxes are handled
* (background/foreground colors) since the Redhat
* 6 upgrade causes the check in the checkbox to be
* colored the same as the background.
*
* </pre>
*
@ -428,74 +432,66 @@ public class SCANDmdTableDlg extends AbstractTableDlg implements
});
setupButtonMouseListeners(attribBtn);
gd = new GridData();
linkToFrameChk = new Button(controlComp, SWT.CHECK);
linkToFrameChk.setText("Link to Frame ");
linkToFrameChk.setBackground(scanCfg
.getScanColor(ScanColors.LinkToFrame));
linkToFrameChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
/*
* Link to frame
*/
linkToFrameChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.LinkToFrame),
display.getSystemColor(SWT.COLOR_WHITE), "Link to Frame ",
true, null);
linkToFrameChk.setSelection(dmdConfigMgr.getScanDmdCfgXML()
.getLinkToFrame());
linkToFrameChk.setLayoutData(gd);
linkToFrameChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleLinkToFrame();
}
});
setupButtonMouseListeners(linkToFrameChk);
/*
* CWA Filter
*/
StringBuilder tipText = new StringBuilder();
tipText.append("Activate to remove from the SCAN table all cells and\n");
tipText.append("DMDs that are outside your CWA.\n\n");
tipText.append("Deactivate to include in the SCAN table all cells and\n");
tipText.append("DMDs detected by radar.");
gd = new GridData();
cwaFilterChk = new Button(controlComp, SWT.CHECK);
cwaFilterChk.setText("CWA Filter ");
cwaFilterChk.setBackground(scanCfg.getScanColor(ScanColors.CWAFilter));
cwaFilterChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
cwaFilterChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.CWAFilter),
display.getSystemColor(SWT.COLOR_WHITE), "CWA Filter ", true,
tipText.toString());
cwaFilterChk.setSelection(dmdConfigMgr.getScanDmdCfgXML()
.getFilterOption());
cwaFilterChk.setLayoutData(gd);
cwaFilterChk.setToolTipText(tipText.toString());
cwaFilterChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleCWAFilterAction();
}
});
setupButtonMouseListeners(cwaFilterChk);
// Vertical tables are not supported at this time.
gd = new GridData();
vertChk = new Button(controlComp, SWT.CHECK);
vertChk.setText("Vert ");
vertChk.setEnabled(false);
vertChk.setBackground(scanCfg.getScanColor(ScanColors.Vert));
vertChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
vertChk.setSelection(dmdConfigMgr.getScanDmdCfgXML().getFilterOption());
vertChk.setLayoutData(gd);
/*
* The vertical table is a techblocked DR. This will be commented out
* until that is addressed.
* Vertical - tech blocked
*/
// vertChk.addSelectionListener(new SelectionAdapter() {
// @Override
// public void widgetSelected(SelectionEvent e) {
// }
// });
setupButtonMouseListeners(vertChk);
vertChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.Vert),
display.getSystemColor(SWT.COLOR_WHITE), "Vert ", true, null);
vertChk.setSelection(dmdConfigMgr.getScanDmdCfgXML().getFilterOption());
vertChk.setEnabled(false);
/*
* Tool tips
*/
tipsChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.Tips),
display.getSystemColor(SWT.COLOR_WHITE), "Tips ", true, null);
gd = new GridData();
tipsChk = new Button(controlComp, SWT.CHECK);
tipsChk.setText("Tips ");
tipsChk.setBackground(scanCfg.getScanColor(ScanColors.Tips));
tipsChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
tipsChk.setSelection(dmdConfigMgr.getScanDmdCfgXML().getTipsOption());
tipsChk.setLayoutData(gd);
tipsChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@ -504,8 +500,10 @@ public class SCANDmdTableDlg extends AbstractTableDlg implements
dmdTableComp.updateColumnTips();
}
});
setupButtonMouseListeners(tipsChk);
/*
* Alarm button
*/
gd = new GridData(SWT.RIGHT, SWT.DEFAULT, true, false);
alarmBtn = new Button(controlComp, SWT.PUSH);
alarmBtn.setText("Alarm");

View file

@ -71,6 +71,10 @@ import com.raytheon.uf.viz.monitor.scan.data.ScanDataGenerator;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 29, 2013 #1945 lvenable Code cleanup for SCAN performance.
* 04 Dec 2013 #2592 lvenable Update how the checkboxes are handled
* (background/foreground colors) since the Redhat
* 6 upgrade causes the check in the checkbox to be
* colored the same as the background.
*
* </pre>
*
@ -242,48 +246,38 @@ public class SCANMesoTableDlg extends AbstractTableDlg implements
});
setupButtonMouseListeners(attribBtn);
/*
* Vertical - tech blocked
*/
// Vertical tables are not supported at this time.
gd = new GridData();
vertChk = new Button(controlComp, SWT.CHECK);
vertChk.setText("Vert ");
vertChk.setEnabled(false);
vertChk.setBackground(scanCfg.getScanColor(ScanColors.Vert));
vertChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
vertChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.Vert),
display.getSystemColor(SWT.COLOR_WHITE), "Vert ", true, null);
vertChk.setSelection(mesoCfgMgr.getScanMesoCfgXML().getFilterOption());
vertChk.setLayoutData(gd);
vertChk.setEnabled(false);
/*
* The vertical table is a techblocked DR. This selection listener will
* be commented out until it is needed.
* Tool tips
*/
// vertChk.addSelectionListener(new SelectionAdapter() {
// @Override
// public void widgetSelected(SelectionEvent e) {
// }
// });
setupButtonMouseListeners(vertChk);
tipsChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.Tips),
display.getSystemColor(SWT.COLOR_WHITE), "Tips ", true, null);
gd = new GridData();
tipsChk = new Button(controlComp, SWT.CHECK);
tipsChk.setText("Tips ");
tipsChk.setBackground(scanCfg.getScanColor(ScanColors.Tips));
tipsChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
tipsChk.setSelection(mesoCfgMgr.getScanMesoCfgXML().getTipsOption());
tipsChk.setLayoutData(gd);
tipsChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
System.out.println(tipsChk.getSelection());
SCANConfig.getInstance().setShowTips(scanTable,
tipsChk.getSelection());
System.out
.println(SCANConfig.getInstance().showTips(scanTable));
System.out.println(scanTable.name());
scanTableComp.updateColumnTips();
}
});
setupButtonMouseListeners(tipsChk);
/*
* Time
*/
gd = new GridData(SWT.RIGHT, SWT.CENTER, true, true);
gd.widthHint = 160;
timeLbl = new Label(controlComp, SWT.RIGHT);

View file

@ -70,6 +70,10 @@ import com.raytheon.uf.viz.monitor.scan.data.ScanDataGenerator;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 29, 2013 #1945 lvenable Code cleanup for SCAN performance.
* 04 Dec 2013 #2592 lvenable Update how the checkboxes are handled
* (background/foreground colors) since the Redhat
* 6 upgrade causes the check in the checkbox to be
* colored the same as the background.
*
* </pre>
*
@ -233,48 +237,37 @@ public class SCANTvsTableDlg extends AbstractTableDlg implements
});
setupButtonMouseListeners(attribBtn);
// Vertical tables are not supported at this time.
gd = new GridData();
vertChk = new Button(controlComp, SWT.CHECK);
vertChk.setText("Vert ");
vertChk.setEnabled(false);
vertChk.setBackground(scanCfg.getScanColor(ScanColors.Vert));
vertChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
/*
* Vertical - tech blocked
*/
vertChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.Vert),
display.getSystemColor(SWT.COLOR_WHITE), "Vert ", true, null);
vertChk.setSelection(tvsCfgMgr.getScanTvsCfgXML().getFilterOption());
vertChk.setLayoutData(gd);
vertChk.setEnabled(false);
/*
* The vertical table is a techblocked DR. This selection listener will
* be commented out until it is needed.
* Tool tips
*/
// vertChk.addSelectionListener(new SelectionAdapter() {
// @Override
// public void widgetSelected(SelectionEvent e) {
// }
// });
setupButtonMouseListeners(vertChk);
tipsChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.Tips),
display.getSystemColor(SWT.COLOR_WHITE), "Tips ", true, null);
gd = new GridData();
tipsChk = new Button(controlComp, SWT.CHECK);
tipsChk.setText("Tips ");
tipsChk.setBackground(scanCfg.getScanColor(ScanColors.Tips));
tipsChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
tipsChk.setSelection(tvsCfgMgr.getScanTvsCfgXML().getTipsOption());
tipsChk.setLayoutData(gd);
tipsChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
System.out.println(tipsChk.getSelection());
SCANConfig.getInstance().setShowTips(scanTable,
tipsChk.getSelection());
System.out
.println(SCANConfig.getInstance().showTips(scanTable));
System.out.println(scanTable.name());
scanTableComp.updateColumnTips();
}
});
setupButtonMouseListeners(tipsChk);
/*
* Time
*/
gd = new GridData(SWT.RIGHT, SWT.CENTER, true, true);
gd.widthHint = 160;
timeLbl = new Label(controlComp, SWT.RIGHT);