Issue #2141 - Fix envelope validation for DD areal filter and selection dialogs

Change-Id: I401f44d9a8392f97e1b6ab7c769e3fbfb23a36d6

Former-commit-id: 4ed69f8195 [formerly cd9f3dc0e1] [formerly 9454dd76a7] [formerly acf1f266e3 [formerly 9454dd76a7 [formerly b1ca1bb2ceb576e8e8664289e83e06708532bc97]]]
Former-commit-id: acf1f266e3
Former-commit-id: 6a696cad457c573ed9799e8791c695202eed53e7 [formerly bad75bd14c]
Former-commit-id: f2c5343ee2
This commit is contained in:
Mike Duff 2013-07-12 16:12:41 -05:00
parent d201642eca
commit d8fed3e4aa
2 changed files with 16 additions and 11 deletions

View file

@ -50,6 +50,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Oct 31, 2012 1278 mpduff Change validation method call.
* Dec 07, 2012 1278 bgonzale Coordinate Array initialization in ctor.
* Dec 10, 2012 1259 bsteffen Switch Data Delivery from LatLon to referenced envelopes.
* Jul 12, 2013 2141 mpduff Fix typo.
*
* </pre>
*
@ -92,7 +93,7 @@ public class ArealSelectionDlg extends CaveSWTDialog implements IDataSize {
/*
* (non-Javadoc)
*
*
* @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#constructShellLayout()
*/
@Override
@ -102,7 +103,7 @@ public class ArealSelectionDlg extends CaveSWTDialog implements IDataSize {
/*
* (non-Javadoc)
*
*
* @see
* com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#constructShellLayoutData()
*/
@ -113,7 +114,7 @@ public class ArealSelectionDlg extends CaveSWTDialog implements IDataSize {
/*
* (non-Javadoc)
*
*
* @see
* com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org
* .eclipse.swt.widgets.Shell)
@ -131,7 +132,7 @@ public class ArealSelectionDlg extends CaveSWTDialog implements IDataSize {
btnComp.setLayout(gl);
btnComp.setLayoutData(gd);
//OK button
// OK button
Button okBtn = new Button(btnComp, SWT.PUSH);
okBtn.setText("OK");
okBtn.setLayoutData(new GridData(70, SWT.DEFAULT));
@ -139,9 +140,10 @@ public class ArealSelectionDlg extends CaveSWTDialog implements IDataSize {
@Override
public void widgetSelected(SelectionEvent e) {
if (!areaComp.isEnvelopeValid()) {
DataDeliveryUtils.showMessage(getShell(), SWT.OK,
"Validation Error",
"The defined area area is invalid\nAdjust the selected area and try again.");
DataDeliveryUtils
.showMessage(getShell(), SWT.OK,
"Validation Error",
"The defined area is invalid\nAdjust the selected area and try again.");
return;
}
@ -154,15 +156,17 @@ public class ArealSelectionDlg extends CaveSWTDialog implements IDataSize {
}
});
//Cancel button
// Cancel button
Button cancelBtn = new Button(btnComp, SWT.PUSH);
cancelBtn.setText("Cancel");
cancelBtn.setLayoutData(new GridData(70, SWT.DEFAULT));
cancelBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
int answer = DataDeliveryUtils.showMessage(getShell(), SWT.YES | SWT.NO, "Cancel Changes?",
"Are you sure you wish to close without selecting an area?");
int answer = DataDeliveryUtils
.showMessage(getShell(), SWT.YES | SWT.NO,
"Cancel Changes?",
"Are you sure you wish to close without selecting an area?");
if (answer == SWT.YES) {
setReturnValue(false);
close();

View file

@ -92,6 +92,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* Mar 21, 2013 1638 mschenke Changed map scales not tied to d2d
* Jun 14, 2013 2064 mpduff Reset controls on load.
* Jun 21, 2013 2132 mpduff Swap target and source envelopes.
* Jul 12, 2013 2141 mpduff Valid envelope test happens as needed instead of when changes are made.
*
* </pre>
*
@ -1016,7 +1017,7 @@ public class AreaComp extends Composite implements ISubset {
* @return the envelopeValid
*/
public boolean isEnvelopeValid() {
return envelopeValid;
return validateBoundsText();
}
private class ValidatingFocusListener implements FocusListener {