don't leak from DndEventImpl

This commit is contained in:
peter
2012-04-02 20:54:08 +02:00
parent d85a101ade
commit 8097de27d9
2 changed files with 4 additions and 6 deletions
@@ -52,14 +52,12 @@ public class DnDEventImpl extends UserDataHolderBase implements Transferable, Dn
private boolean myShouldRemoveHighlighter = true;
private Point myLocalPoint;
private Cursor myCursor;
private DnDSource mySource;
public DnDEventImpl(DnDManagerImpl manager, DnDAction action, Object attachedObject, Point point, DnDSource source) {
public DnDEventImpl(DnDManagerImpl manager, DnDAction action, Object attachedObject, Point point) {
myManager = manager;
myAction = action;
myAttachedObject = attachedObject;
myPoint = point;
mySource = source;
}
public DnDAction getAction() {
@@ -249,7 +247,7 @@ public class DnDEventImpl extends UserDataHolderBase implements Transferable, Dn
}
protected Object clone() {
final DnDEventImpl result = new DnDEventImpl(myManager, myAction, myAttachedObject, myPoint, mySource);
final DnDEventImpl result = new DnDEventImpl(myManager, myAction, myAttachedObject, myPoint);
result.myDropHandler = myDropHandler;
result.myDropPossible = myDropPossible;
result.myExpectedDropResult = myExpectedDropResult;
@@ -179,7 +179,7 @@ public class DnDManagerImpl extends DnDManager implements Disposable {
DnDEventImpl event = (DnDEventImpl)jComp.getClientProperty(DnDNativeTarget.EVENT_KEY);
if (event == null) {
DnDNativeTarget.EventInfo info = new DnDNativeTarget.EventInfo(flavors, transferable);
event = new DnDEventImpl(this, DnDAction.COPY, info, aPoint, null);
event = new DnDEventImpl(this, DnDAction.COPY, info, aPoint);
jComp.putClientProperty(DnDNativeTarget.EVENT_KEY, event);
}
@@ -556,7 +556,7 @@ public class DnDManagerImpl extends DnDManager implements Disposable {
LOG.debug("Starting dragging for " + action);
hideCurrentHighlighter();
final DnDDragStartBean dnDDragStartBean = source.startDragging(action, dge.getDragOrigin());
myCurrentEvent = new DnDEventImpl(DnDManagerImpl.this, action, dnDDragStartBean.getAttachedObject(), dnDDragStartBean.getPoint(), source);
myCurrentEvent = new DnDEventImpl(DnDManagerImpl.this, action, dnDDragStartBean.getAttachedObject(), dnDDragStartBean.getPoint());
myCurrentEvent.setOrgPoint(dge.getDragOrigin());
Pair<Image, Point> pair = source.createDraggedImage(action, dge.getDragOrigin());