public JwGeographicCoordinate getValue(ScServletData data) { int degrees; int minutes; double seconds; Double d = _degrees.getValue(data); if (d == null) return null; if (isDecimal(d)) { if (_minutes.hasValue(data) && !JwUtility.isEqual(_minutes.getValue(data).doubleValue(), 0.0)) return null; if (_seconds.hasValue(data) && !JwUtility.isEqual(_seconds.getValue(data).doubleValue(), 0.0)) return null; degrees = (int) d.doubleValue(); d = d - degrees; d = d * 60; minutes = (int) d.doubleValue(); d = d - minutes; seconds = d * 60; } else { degrees = (int) d.doubleValue(); d = _minutes.getValue(data); if (d == null) return null; if (isDecimal(d)) { if (_seconds.hasValue(data) && !JwUtility.isEqual(_seconds.getValue(data).doubleValue(), 0.0)) return null; minutes = (int) d.doubleValue(); d = d - minutes; seconds = d * 60; } else { minutes = (int) d.doubleValue(); d = _seconds.getValue(data); if (d == null) return null; seconds = d; } } String direction = _direction.getSelectedString(); if (JwUtility.isEmpty(direction)) return null; return new JwGeographicCoordinate(degrees, minutes, seconds, direction, null, null); }
public boolean hasSecondsError(ScServletData data) { if (!_seconds.validate(data)) return false; if (_seconds.hasText(data)) return _seconds.getValue(data) == null; if (_minutes.hasText(data)) return isDecimal(_minutes.getValue(data)); return isDecimal(_degrees.getValue(data)); }
public boolean hasDegreesError(ScServletData data) { if (!_degrees.validate(data)) return false; return _degrees.getValue(data) == null; }