Merge remote-tracking branch 'vlab/ohd_16.2.2' into master_16.2.2

Former-commit-id: 621247965d7e00d548804e7f2871739b2a6867f6
This commit is contained in:
Shawn.Hooper 2016-05-13 13:16:13 -04:00
commit cb2a92c16d

View file

@ -84,7 +84,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Jul 06, 2015 #14104 lbousaidi increased textlimit to 15
* Nov 30, 2015 14228 wkwock Update remark limit to 510.
* Jan 13, 2016 #17652 jingtaoD use location lat/lon for 1st guess for new River Gage
*
* May 11, 2016 #18983 jingtaoD UELE when saving updates of River Gage data
* </pre>
*
* @author lvenable
@ -1038,7 +1038,7 @@ public class RiverGageDlg extends CaveSWTDialog implements
* Populate te display.
*/
private void updateDisplay() {
if (locData != null) {
if (riverGageData == null && locData != null) {
// Lat/Lon
latitudeTF
@ -1051,11 +1051,24 @@ public class RiverGageDlg extends CaveSWTDialog implements
.valueOf(locData.getLongitude()) : "");
origLon = longitudeTF.getText();
}
if (riverGageData != null) {
} else if (riverGageData != null) {
// Stream
streamTF.setText(riverGageData.getStream());
// Lat/Lon
latitudeTF
.setText((riverGageData.getLatitude() != HydroConstants.MISSING_VALUE) ? String
.valueOf(riverGageData.getLatitude()) : "");
origLat = latitudeTF.getText();
longitudeTF
.setText((riverGageData.getLongitude() != HydroConstants.MISSING_VALUE) ? String
.valueOf(riverGageData.getLongitude()) : "");
origLon = longitudeTF.getText();
// Drainage Area
drainageAreaTF.setText(HydroDataUtils
.getDisplayString(riverGageData.getDrainageArea()));
@ -1273,7 +1286,7 @@ public class RiverGageDlg extends CaveSWTDialog implements
// Latitude
String latTxt = latitudeTF.getText();
if (!latTxt.equals(origLat)) {
double lat = HydroConstants.MISSING_VALUE;
if (!latTxt.equals("")) {
boolean invalidLat = false;
@ -1282,11 +1295,12 @@ public class RiverGageDlg extends CaveSWTDialog implements
lat = GeoUtil.getInstance().cvt_spaced_format(latTxt, 0);
} catch (Exception e) {
invalidLat = true;
statusHandler.handle(Priority.PROBLEM,
"Unable to determine latitude ", e);
}
if ((lat < -90) || (lat > 90) || invalidLat) {
MessageBox mb = new MessageBox(shell, SWT.ICON_ERROR
| SWT.OK);
MessageBox mb = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
mb.setText("Invalid Value");
mb.setMessage("Please enter a VALID (-90 to 90) Latitude\nin the form: DD MM SS");
mb.open();
@ -1295,13 +1309,10 @@ public class RiverGageDlg extends CaveSWTDialog implements
}
}
newData.setLatitude(lat);
} else {
newData.setLatitude(this.riverGageData.getLatitude());
}
// Longitude
String lonTxt = longitudeTF.getText();
if (!lonTxt.equals(origLon)) {
double lon = HydroConstants.MISSING_VALUE;
if (!lonTxt.equals("")) {
boolean invalidLon = false;
@ -1315,8 +1326,7 @@ public class RiverGageDlg extends CaveSWTDialog implements
}
if ((lon > 180) || (lon < -180) || invalidLon) {
MessageBox mb = new MessageBox(shell, SWT.ICON_ERROR
| SWT.OK);
MessageBox mb = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
mb.setText("Invalid Value");
mb.setMessage("Please enter a VALID (-180 to 180) Longitude\nin the form: DD MM SS");
mb.open();
@ -1325,9 +1335,6 @@ public class RiverGageDlg extends CaveSWTDialog implements
}
}
newData.setLongitude(lon);
} else {
newData.setLongitude(riverGageData.getLongitude());
}
// Remarks
newData.setRemark(remarksTF.getText());