Merge "Issue #2403 - fixed cursor memory leak." into development

Former-commit-id: 57ce2622b5 [formerly 13186727dd] [formerly 9795caee63] [formerly 23744696b3 [formerly 9795caee63 [formerly 3b53c91be0393123c7c73e6f7bf844f05d26b08d]]]
Former-commit-id: 23744696b3
Former-commit-id: ce171cada95f5a813ede6a42cb17a1af7a258321 [formerly ff34d8a183]
Former-commit-id: 4104b4018b
This commit is contained in:
Lee Venable 2013-09-24 12:10:59 -05:00 committed by Gerrit Code Review
commit 0b2f611ef9

View file

@ -66,6 +66,7 @@ import com.vividsolutions.jts.geom.Polygon;
* Mar 28, 2013 DR 15974 D. Friedman Do not track removed GIDs. * Mar 28, 2013 DR 15974 D. Friedman Do not track removed GIDs.
* Jun 25, 2013 DR 16013 Qinglu Lin Called setUniqueFip() in handleMouseUp(). * Jun 25, 2013 DR 16013 Qinglu Lin Called setUniqueFip() in handleMouseUp().
* Aug 15, 2013 DR 16418 D. Friedman Only raise dialog if editable. Don't call featureEdit if not editable. * Aug 15, 2013 DR 16418 D. Friedman Only raise dialog if editable. Don't call featureEdit if not editable.
* Sep 24, 2013 #2403 lvenable Fixed cursor memory leak.
* *
* </pre> * </pre>
* *
@ -94,8 +95,6 @@ public class WarngenUIManager extends InputAdapter {
private final Cursor movePoint; private final Cursor movePoint;
private final Cursor arrow;
/** The last mouse position - x */ /** The last mouse position - x */
private int lastMouseX; private int lastMouseX;
@ -113,15 +112,12 @@ public class WarngenUIManager extends InputAdapter {
Display display = Display.getCurrent(); Display display = Display.getCurrent();
movePolygon = new Cursor(display, SWT.CURSOR_SIZEALL); movePolygon = display.getSystemCursor(SWT.CURSOR_SIZEALL);
movePoint = new Cursor(display, SWT.CURSOR_HAND); movePoint = display.getSystemCursor(SWT.CURSOR_HAND);
arrow = new Cursor(display, SWT.CURSOR_ARROW);
} }
public void dispose() { public void dispose() {
warngenLayer.getResourceContainer().unregisterMouseHandler(this); warngenLayer.getResourceContainer().unregisterMouseHandler(this);
movePolygon.dispose();
movePoint.dispose();
} }
/* /*
@ -386,8 +382,9 @@ public class WarngenUIManager extends InputAdapter {
if (c2 != null) { if (c2 != null) {
PolygonUtil.truncate(c2, 2); PolygonUtil.truncate(c2, 2);
if (warngenLayer.isModifiedVertexNeedsToBeUpdated()) { if (warngenLayer.isModifiedVertexNeedsToBeUpdated()) {
int i = StormTrackUIManager.getCoordinateIndex(warngenLayer, int i = StormTrackUIManager.getCoordinateIndex(
state.getWarningPolygon().getCoordinates(), c2); warngenLayer, state.getWarningPolygon()
.getCoordinates(), c2);
if (i != -1) { if (i != -1) {
this.movePointIndex = i; this.movePointIndex = i;
} }
@ -669,7 +666,7 @@ public class WarngenUIManager extends InputAdapter {
public void setHandleInput(boolean handle) { public void setHandleInput(boolean handle) {
handleInput = handle; handleInput = handle;
if (!handle) { if (!handle) {
getShell().setCursor(arrow); getShell().setCursor(null);
} }
} }