Issue #1977: Fix merge issue with WarngenDialog

Former-commit-id: 7c03fc955b [formerly ddfc06eb9753e893ece28e1718c5e4550e82b053]
Former-commit-id: a5383dbfa4
This commit is contained in:
Richard Peter 2013-08-14 15:33:02 -05:00
parent e867472bf6
commit 951bb37cd7

View file

@ -69,6 +69,7 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.viz.core.IDisplayPaneContainer; import com.raytheon.uf.viz.core.IDisplayPaneContainer;
import com.raytheon.uf.viz.core.VizApp; import com.raytheon.uf.viz.core.VizApp;
@ -193,11 +194,11 @@ public class WarngenDialog extends CaveSWTDialog implements
final DateFormat df = new SimpleDateFormat("HH:mm EEE d-MMM"); final DateFormat df = new SimpleDateFormat("HH:mm EEE d-MMM");
private java.util.List<String> mapsLoaded = new ArrayList<String>(); private final java.util.List<String> mapsLoaded = new ArrayList<String>();
private Button okButton; private Button okButton;
private BulletListManager bulletListManager; private final BulletListManager bulletListManager;
private List bulletList; private List bulletList;
@ -277,7 +278,7 @@ public class WarngenDialog extends CaveSWTDialog implements
private boolean invalidFollowUpAction = false; private boolean invalidFollowUpAction = false;
private IWarngenObserver wed = new WarningSender(); private final IWarngenObserver wed = new WarningSender();
public WarngenDialog(Shell parentShell, WarngenLayer layer) { public WarngenDialog(Shell parentShell, WarngenLayer layer) {
super(parentShell, SWT.CLOSE | SWT.MODELESS | SWT.BORDER | SWT.TITLE, super(parentShell, SWT.CLOSE | SWT.MODELESS | SWT.BORDER | SWT.TITLE,
@ -480,7 +481,7 @@ public class WarngenDialog extends CaveSWTDialog implements
String defaultTemplate = warngenLayer.getDialogConfig() String defaultTemplate = warngenLayer.getDialogConfig()
.getDefaultTemplate(); .getDefaultTemplate();
if (defaultTemplate == null || defaultTemplate.equals("")) { if ((defaultTemplate == null) || defaultTemplate.equals("")) {
defaultTemplate = mainProducts.get(0).split("/")[1]; defaultTemplate = mainProducts.get(0).split("/")[1];
} }
@ -819,7 +820,7 @@ public class WarngenDialog extends CaveSWTDialog implements
createTextButtonEnabled = false; createTextButtonEnabled = false;
} else if (warngenLayer.getStormTrackState().mode == Mode.NONE) { } else if (warngenLayer.getStormTrackState().mode == Mode.NONE) {
createTextButtonEnabled = false; createTextButtonEnabled = false;
} else if (warngenLayer.getPolygon() == null } else if ((warngenLayer.getPolygon() == null)
|| warngenLayer.getPolygon().isEmpty()) { || warngenLayer.getPolygon().isEmpty()) {
str += WarngenConstants.INSTRUCTION_NO_SHADED_AREA; str += WarngenConstants.INSTRUCTION_NO_SHADED_AREA;
createTextButtonEnabled = false; createTextButtonEnabled = false;
@ -888,9 +889,9 @@ public class WarngenDialog extends CaveSWTDialog implements
newYes = true; newYes = true;
} else if (act == WarningAction.EXT) { } else if (act == WarningAction.EXT) {
extYes = true; extYes = true;
} else if (act == WarningAction.CON } else if ((act == WarningAction.CON)
|| act == WarningAction.CAN || (act == WarningAction.CAN)
|| act == WarningAction.EXP) { || (act == WarningAction.EXP)) {
follow = true; follow = true;
} else if (act == WarningAction.COR) { } else if (act == WarningAction.COR) {
corYes = true; corYes = true;
@ -1041,13 +1042,13 @@ public class WarngenDialog extends CaveSWTDialog implements
return; return;
} }
if (followupData != null if ((followupData != null)
&& WarningAction.valueOf(followupData.getAct()) == WarningAction.NEW) { && (WarningAction.valueOf(followupData.getAct()) == WarningAction.NEW)) {
redrawFromWarned(); redrawFromWarned();
} }
if ((followupData == null || (WarningAction.valueOf(followupData if (((followupData == null) || ((WarningAction.valueOf(followupData
.getAct()) == WarningAction.CON && warngenLayer .getAct()) == WarningAction.CON) && warngenLayer
.conWarnAreaChanged(followupData))) .conWarnAreaChanged(followupData)))
&& !polygonLocked) { && !polygonLocked) {
redrawFromWarned(); redrawFromWarned();
@ -1062,6 +1063,7 @@ public class WarngenDialog extends CaveSWTDialog implements
try { try {
pmd.run(false, false, new IRunnableWithProgress() { pmd.run(false, false, new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException { throws InvocationTargetException, InterruptedException {
try { try {
@ -1131,7 +1133,7 @@ public class WarngenDialog extends CaveSWTDialog implements
private boolean checkDamSelection() { private boolean checkDamSelection() {
if (bulletListManager.isDamNameSeletcted() if (bulletListManager.isDamNameSeletcted()
&& bulletListManager.isDamCauseSelected() == false) { && (bulletListManager.isDamCauseSelected() == false)) {
/* /*
* On WES 'Instructions' became 'Warning' but didn't prevent a * On WES 'Instructions' became 'Warning' but didn't prevent a
* created text * created text
@ -1152,9 +1154,9 @@ public class WarngenDialog extends CaveSWTDialog implements
} }
private void updateWarngenUIState(String result) { private void updateWarngenUIState(String result) {
if (VtecUtil.parseMessage(result) != null if ((VtecUtil.parseMessage(result) != null)
&& WarningAction.valueOf(VtecUtil.parseMessage(result) && (WarningAction.valueOf(VtecUtil.parseMessage(result)
.getAction()) != WarningAction.NEW) { .getAction()) != WarningAction.NEW)) {
// TODO Use warningsArrived method to set old // TODO Use warningsArrived method to set old
// polygon and warning area // polygon and warning area
warngenLayer.state.setOldWarningPolygon((Polygon) warngenLayer warngenLayer.state.setOldWarningPolygon((Polygon) warngenLayer
@ -1169,7 +1171,7 @@ public class WarngenDialog extends CaveSWTDialog implements
// An error dialog is to appear if a user tries to press Create Text // An error dialog is to appear if a user tries to press Create Text
// again after a product was issued.AWIPS I does not auto update their // again after a product was issued.AWIPS I does not auto update their
// update list, this is their solution. // update list, this is their solution.
if (followupData != null && totalSegments > 1) { if ((followupData != null) && (totalSegments > 1)) {
multiSegmentMessage(followupData.getEquvialentString()); multiSegmentMessage(followupData.getEquvialentString());
return false; return false;
} }
@ -1237,8 +1239,8 @@ public class WarngenDialog extends CaveSWTDialog implements
warngenLayer.getStormTrackState().mode = Mode.TRACK; warngenLayer.getStormTrackState().mode = Mode.TRACK;
warngenLayer.lastMode = Mode.DRAG_ME; warngenLayer.lastMode = Mode.DRAG_ME;
} }
if (warngenLayer.getConfiguration().isTrackEnabled() == false if ((warngenLayer.getConfiguration().isTrackEnabled() == false)
|| warngenLayer.getConfiguration().getPathcastConfig() == null) { || (warngenLayer.getConfiguration().getPathcastConfig() == null)) {
warngenLayer.getStormTrackState().setInitiallyMotionless(true); warngenLayer.getStormTrackState().setInitiallyMotionless(true);
} }
warngenLayer.resetInitialFrame(); warngenLayer.resetInitialFrame();
@ -1258,8 +1260,8 @@ public class WarngenDialog extends CaveSWTDialog implements
* Action for when something is selected from the backup site combo * Action for when something is selected from the backup site combo
*/ */
private void backupSiteSelected() { private void backupSiteSelected() {
if (backupSiteCbo.getSelectionIndex() >= 0 if ((backupSiteCbo.getSelectionIndex() >= 0)
&& backupSiteCbo.getItemCount() > 0) { && (backupSiteCbo.getItemCount() > 0)) {
warngenLayer.setBackupSite(backupSiteCbo.getItems()[backupSiteCbo warngenLayer.setBackupSite(backupSiteCbo.getItems()[backupSiteCbo
.getSelectionIndex()]); .getSelectionIndex()]);
// Refresh template // Refresh template
@ -1367,8 +1369,8 @@ public class WarngenDialog extends CaveSWTDialog implements
DamInfoBullet damBullet = bulletListManager.getSelectedDamInfoBullet(); DamInfoBullet damBullet = bulletListManager.getSelectedDamInfoBullet();
if (damBullet != null) { if (damBullet != null) {
if (damBullet.getCoords() == null if ((damBullet.getCoords() == null)
|| damBullet.getCoords().length() == 0) { || (damBullet.getCoords().length() == 0)) {
damBreakInstruct = "LAT...LON can not be found in 'coords' parameter"; damBreakInstruct = "LAT...LON can not be found in 'coords' parameter";
} else { } else {
ArrayList<Coordinate> coordinates = new ArrayList<Coordinate>(); ArrayList<Coordinate> coordinates = new ArrayList<Coordinate>();
@ -1381,8 +1383,8 @@ public class WarngenDialog extends CaveSWTDialog implements
if (m.find()) { if (m.find()) {
m = latLonPtrn.matcher(damBullet.getCoords()); m = latLonPtrn.matcher(damBullet.getCoords());
while (m.find()) { while (m.find()) {
coordinates.add(new Coordinate(-1 coordinates.add(new Coordinate((-1 * Double
* Double.parseDouble(m.group(2)) / 100, Double .parseDouble(m.group(2))) / 100, Double
.parseDouble(m.group(1)) / 100)); .parseDouble(m.group(1)) / 100));
} }
@ -1448,8 +1450,9 @@ public class WarngenDialog extends CaveSWTDialog implements
private void changeTemplate(String templateName) { private void changeTemplate(String templateName) {
// DR 14515 // DR 14515
if (templateName.equals(warngenLayer.getTemplateName())) if (templateName.equals(warngenLayer.getTemplateName())) {
return; return;
}
String lastAreaSource = warngenLayer.getConfiguration() String lastAreaSource = warngenLayer.getConfiguration()
.getHatchedAreaSource().getAreaSource(); .getHatchedAreaSource().getAreaSource();
@ -1503,9 +1506,9 @@ public class WarngenDialog extends CaveSWTDialog implements
.getSelection() ? DisplayType.POLY : DisplayType.POINT; .getSelection() ? DisplayType.POLY : DisplayType.POINT;
} }
warngenLayer.getStormTrackState().setInitiallyMotionless( warngenLayer.getStormTrackState().setInitiallyMotionless(
warngenLayer.getConfiguration().isTrackEnabled() == false (warngenLayer.getConfiguration().isTrackEnabled() == false)
|| warngenLayer.getConfiguration() || (warngenLayer.getConfiguration()
.getPathcastConfig() == null); .getPathcastConfig() == null));
if (warngenLayer.getStormTrackState().isInitiallyMotionless()) { if (warngenLayer.getStormTrackState().isInitiallyMotionless()) {
warngenLayer.getStormTrackState().speed = 0; warngenLayer.getStormTrackState().speed = 0;
warngenLayer.getStormTrackState().angle = 0; warngenLayer.getStormTrackState().angle = 0;
@ -1608,10 +1611,10 @@ public class WarngenDialog extends CaveSWTDialog implements
// (AWIPS 1) // (AWIPS 1)
if (warngenLayer.state.followupData != null) { if (warngenLayer.state.followupData != null) {
if (data.equals(warngenLayer.state.followupData)) { if (data.equals(warngenLayer.state.followupData)) {
if (WarningAction if ((WarningAction
.valueOf(warngenLayer.state.followupData .valueOf(warngenLayer.state.followupData
.getAct()) == WarningAction.CON .getAct()) == WarningAction.CON)
&& totalSegments > 1) { && (totalSegments > 1)) {
sameProductMessage(warngenLayer.state.followupData sameProductMessage(warngenLayer.state.followupData
.getEquvialentString()); .getEquvialentString());
} }
@ -1678,7 +1681,7 @@ public class WarngenDialog extends CaveSWTDialog implements
if (warngenLayer.getConfiguration().getEnableDamBreakThreat()) { if (warngenLayer.getConfiguration().getEnableDamBreakThreat()) {
for (BulletActionGroup bulletActionGroup : warngenLayer for (BulletActionGroup bulletActionGroup : warngenLayer
.getConfiguration().getBulletActionGroups()) { .getConfiguration().getBulletActionGroups()) {
if (bulletActionGroup.getAction() != null if ((bulletActionGroup.getAction() != null)
&& bulletActionGroup.getAction().equals( && bulletActionGroup.getAction().equals(
data.getAct())) { data.getAct())) {
warngenLayer.getConfiguration().setDamInfoBullets( warngenLayer.getConfiguration().setDamInfoBullets(
@ -1699,14 +1702,14 @@ public class WarngenDialog extends CaveSWTDialog implements
bulletListManager.recreateBulletsFromFollowup( bulletListManager.recreateBulletsFromFollowup(
warngenLayer.getConfiguration(), action, oldWarning); warngenLayer.getConfiguration(), action, oldWarning);
if (bulletListManager.isDamNameSeletcted() if (bulletListManager.isDamNameSeletcted()
&& action != WarningAction.NEW) { && (action != WarningAction.NEW)) {
setPolygonLocked(true); setPolygonLocked(true);
} }
} }
refreshBulletList(); refreshBulletList();
recreateUpdates(); recreateUpdates();
if (action == null || action == WarningAction.NEW if ((action == null) || (action == WarningAction.NEW)
|| action == WarningAction.EXT) { || (action == WarningAction.EXT)) {
recreateDurations(durationList); recreateDurations(durationList);
} }
} }
@ -1741,7 +1744,7 @@ public class WarngenDialog extends CaveSWTDialog implements
} }
private void changeSelected() { private void changeSelected() {
if (validPeriodDlg == null || validPeriodDlg.isDisposed()) { if ((validPeriodDlg == null) || validPeriodDlg.isDisposed()) {
validPeriodDlg = new ValidPeriodDialog(shell, startTime, endTime); validPeriodDlg = new ValidPeriodDialog(shell, startTime, endTime);
validPeriodDlg.setCloseCallback(new ICloseCallback() { validPeriodDlg.setCloseCallback(new ICloseCallback() {
@ -1846,6 +1849,7 @@ public class WarngenDialog extends CaveSWTDialog implements
public void run() { public void run() {
getDisplay().syncExec(new Runnable() { getDisplay().syncExec(new Runnable() {
@Override
public void run() { public void run() {
try { try {
changeStartEndTimes(); changeStartEndTimes();
@ -1872,6 +1876,7 @@ public class WarngenDialog extends CaveSWTDialog implements
public void run() { public void run() {
getDisplay().syncExec(new Runnable() { getDisplay().syncExec(new Runnable() {
@Override
public void run() { public void run() {
try { try {
recreateUpdates(); recreateUpdates();
@ -1887,7 +1892,7 @@ public class WarngenDialog extends CaveSWTDialog implements
// Update the follow up list every minute // Update the follow up list every minute
long currentTimeInSeconds = SimulatedTime.getSystemTime().getMillis() / 1000; long currentTimeInSeconds = SimulatedTime.getSystemTime().getMillis() / 1000;
long secondsToNextMinute = 0; long secondsToNextMinute = 0;
if (currentTimeInSeconds % 60 != 0) { if ((currentTimeInSeconds % 60) != 0) {
secondsToNextMinute = 60 - (currentTimeInSeconds % 60); secondsToNextMinute = 60 - (currentTimeInSeconds % 60);
} }
timer.schedule(recreateUpdatesTask, secondsToNextMinute * 1000, timer.schedule(recreateUpdatesTask, secondsToNextMinute * 1000,
@ -1909,7 +1914,7 @@ public class WarngenDialog extends CaveSWTDialog implements
FollowupData fd = (FollowupData) updateListCbo FollowupData fd = (FollowupData) updateListCbo
.getData(updateListCbo.getItem(updateListCbo .getData(updateListCbo.getItem(updateListCbo
.getSelectionIndex())); .getSelectionIndex()));
if (fd == null if ((fd == null)
|| (WarningAction.valueOf(fd.getAct()) == WarningAction.NEW)) { || (WarningAction.valueOf(fd.getAct()) == WarningAction.NEW)) {
startTime = TimeUtil.newCalendar(); startTime = TimeUtil.newCalendar();
endTime = DurationUtil.calcEndTime(this.startTime, duration); endTime = DurationUtil.calcEndTime(this.startTime, duration);
@ -2179,7 +2184,7 @@ public class WarngenDialog extends CaveSWTDialog implements
* Set the shell to visible and then move it on top of the CAVE dialog. * Set the shell to visible and then move it on top of the CAVE dialog.
*/ */
public void showDialog(boolean show) { public void showDialog(boolean show) {
if (shell != null && shell.isDisposed() == false) { if ((shell != null) && (shell.isDisposed() == false)) {
if (show) { if (show) {
if (shell.isVisible() == false) { if (shell.isVisible() == false) {
shell.setVisible(true); shell.setVisible(true);
@ -2266,8 +2271,9 @@ public class WarngenDialog extends CaveSWTDialog implements
Polygon rval = gf.createPolygon(gf.createLinearRing(points Polygon rval = gf.createPolygon(gf.createLinearRing(points
.toArray(new Coordinate[points.size()])), null); .toArray(new Coordinate[points.size()])), null);
if (adjusted) if (adjusted) {
oldWarning.setGeometry(rval); oldWarning.setGeometry(rval);
}
boolean invalidPolyFlag = false; boolean invalidPolyFlag = false;
if (rval.isValid() == false) { if (rval.isValid() == false) {
@ -2292,10 +2298,12 @@ public class WarngenDialog extends CaveSWTDialog implements
int size = coords.length; int size = coords.length;
java.util.List<Coordinate> coords2 = new ArrayList<Coordinate>(); java.util.List<Coordinate> coords2 = new ArrayList<Coordinate>();
coords2.add(coords[0]); coords2.add(coords[0]);
for (int i = 1; i < size; i++) for (int i = 1; i < size; i++) {
if (Math.abs(coords[i].x - coords[i - 1].x) > MIN_LATLON_DIFF if ((Math.abs(coords[i].x - coords[i - 1].x) > MIN_LATLON_DIFF)
|| Math.abs(coords[i].y - coords[i - 1].y) > MIN_LATLON_DIFF) || (Math.abs(coords[i].y - coords[i - 1].y) > MIN_LATLON_DIFF)) {
coords2.add(coords[i]); coords2.add(coords[i]);
}
}
size = coords2.size(); size = coords2.size();
Coordinate[] coords3 = coords2.toArray(new Coordinate[size]); Coordinate[] coords3 = coords2.toArray(new Coordinate[size]);
return coords3; return coords3;
@ -2308,7 +2316,7 @@ public class WarngenDialog extends CaveSWTDialog implements
double diffx1, diffx2, diffy1, diffy2; double diffx1, diffx2, diffy1, diffy2;
double ratio1, ratio2; double ratio1, ratio2;
boolean adjusted = false; boolean adjusted = false;
for (int i = 2; i < coords.length - 2; i++) { for (int i = 2; i < (coords.length - 2); i++) {
diffx1 = coords[i - 1].x - coords[i].x; diffx1 = coords[i - 1].x - coords[i].x;
if (Math.abs(diffx1) > MIN_LATLON_DIFF) { if (Math.abs(diffx1) > MIN_LATLON_DIFF) {
ratio1 = (coords[i - 1].y - coords[i].y) / diffx1; ratio1 = (coords[i - 1].y - coords[i].y) / diffx1;
@ -2316,8 +2324,8 @@ public class WarngenDialog extends CaveSWTDialog implements
if (Math.abs(diffx2) > MIN_LATLON_DIFF) { if (Math.abs(diffx2) > MIN_LATLON_DIFF) {
ratio2 = (coords[i].y - coords[i + 1].y) / diffx2; ratio2 = (coords[i].y - coords[i + 1].y) / diffx2;
if (Math.abs(ratio1 - ratio2) < MIN_DIFF) { if (Math.abs(ratio1 - ratio2) < MIN_DIFF) {
if (diffx1 > 0.0 && diffx2 > 0.0 || diffx1 < 0.0 if (((diffx1 > 0.0) && (diffx2 > 0.0))
&& diffx2 < 0.0) { || ((diffx1 < 0.0) && (diffx2 < 0.0))) {
// three vertices on a straight line. Not overlaid. // three vertices on a straight line. Not overlaid.
} else { } else {
// two segments overlaid // two segments overlaid
@ -2335,8 +2343,8 @@ public class WarngenDialog extends CaveSWTDialog implements
if (Math.abs(diffy2) > MIN_LATLON_DIFF) { if (Math.abs(diffy2) > MIN_LATLON_DIFF) {
ratio2 = (coords[i].x - coords[i + 1].x) / diffy2; ratio2 = (coords[i].x - coords[i + 1].x) / diffy2;
if (Math.abs(ratio1 - ratio2) < MIN_DIFF) { if (Math.abs(ratio1 - ratio2) < MIN_DIFF) {
if (diffy1 > 0.0 && diffy2 > 0.0 || diffy1 < 0.0 if (((diffy1 > 0.0) && (diffy2 > 0.0))
&& diffy2 < 0.0) { || ((diffy1 < 0.0) && (diffy2 < 0.0))) {
// three vertices on a straight line. Not overlaid. // three vertices on a straight line. Not overlaid.
} else { } else {
// two segments overlaid // two segments overlaid
@ -2368,29 +2376,33 @@ public class WarngenDialog extends CaveSWTDialog implements
if (Math.abs(diffx) > MIN_LATLON_DIFF) { if (Math.abs(diffx) > MIN_LATLON_DIFF) {
if (coords[i - 1].y > coords[i].y) { if (coords[i - 1].y > coords[i].y) {
factor = 1; factor = 1;
} else } else {
factor = -1; factor = -1;
}
if (diffx < 0.0) { if (diffx < 0.0) {
coords[i + 1].x -= factor * adjustedValue; coords[i + 1].x -= factor * adjustedValue;
} else { } else {
coords[i - 1].x += factor * adjustedValue; coords[i - 1].x += factor * adjustedValue;
} }
if (i == n - 3) if (i == (n - 3)) {
coords[0].x = coords[i - 1].x; coords[0].x = coords[i - 1].x;
}
} else { } else {
diffx = coords[i + 2].x - coords[i + 1].x; diffx = coords[i + 2].x - coords[i + 1].x;
if (Math.abs(diffx) > MIN_LATLON_DIFF) { if (Math.abs(diffx) > MIN_LATLON_DIFF) {
if (coords[i + 1].y > coords[i].y) { if (coords[i + 1].y > coords[i].y) {
factor = -1; factor = -1;
} else } else {
factor = 1; factor = 1;
}
if (diffx < 0.0) { if (diffx < 0.0) {
coords[i - 1].x -= factor * adjustedValue; coords[i - 1].x -= factor * adjustedValue;
} else { } else {
coords[i + 1].x += factor * adjustedValue; coords[i + 1].x += factor * adjustedValue;
} }
if (i == n - 3) if (i == (n - 3)) {
coords[0].x = coords[i - 1].x; coords[0].x = coords[i - 1].x;
}
} }
} }
} else { } else {
@ -2399,29 +2411,33 @@ public class WarngenDialog extends CaveSWTDialog implements
if (Math.abs(diffy) > MIN_LATLON_DIFF) { if (Math.abs(diffy) > MIN_LATLON_DIFF) {
if (coords[i - 1].x > coords[i].x) { if (coords[i - 1].x > coords[i].x) {
factor = -1; factor = -1;
} else } else {
factor = 1; factor = 1;
}
if (diffy > 0.0) { if (diffy > 0.0) {
coords[i + 1].y -= factor * adjustedValue; coords[i + 1].y -= factor * adjustedValue;
} else { } else {
coords[i - 1].y += factor * adjustedValue; coords[i - 1].y += factor * adjustedValue;
} }
if (i == n - 3) if (i == (n - 3)) {
coords[0].y = coords[i - 1].y; coords[0].y = coords[i - 1].y;
}
} else { } else {
diffy = coords[i + 2].y - coords[i + 1].y; diffy = coords[i + 2].y - coords[i + 1].y;
if (Math.abs(diffy) > MIN_LATLON_DIFF) { if (Math.abs(diffy) > MIN_LATLON_DIFF) {
if (coords[i + 1].x > coords[i].x) { if (coords[i + 1].x > coords[i].x) {
factor = -1; factor = -1;
} else } else {
factor = 1; factor = 1;
}
if (diffy < 0.0) { if (diffy < 0.0) {
coords[i - 1].y -= factor * adjustedValue; coords[i - 1].y -= factor * adjustedValue;
} else { } else {
coords[i + 1].y += factor * adjustedValue; coords[i + 1].y += factor * adjustedValue;
} }
if (i == n - 3) if (i == (n - 3)) {
coords[0].y = coords[i - 1].y; coords[0].y = coords[i - 1].y;
}
} }
} }
} }