src/share/classes/java/awt/dnd/DragSourceContext.java
Print this page
@@ -574,13 +574,13 @@
}
if (newTrigger.getComponent() == null) {
throw new InvalidObjectException("Null trigger component");
}
- int DGRActions = newTrigger.getSourceAsDragGestureRecognizer().getSourceActions()
+ int newSourceActions = f.get("sourceActions", 0)
& (DnDConstants.ACTION_COPY_OR_MOVE | DnDConstants.ACTION_LINK);
- if (DGRActions == DnDConstants.ACTION_NONE) {
+ if (newSourceActions == DnDConstants.ACTION_NONE) {
throw new InvalidObjectException("Invalid source actions");
}
int triggerActions = newTrigger.getDragAction();
if (triggerActions != DnDConstants.ACTION_COPY &&
triggerActions != DnDConstants.ACTION_MOVE &&
@@ -589,12 +589,11 @@
}
trigger = newTrigger;
cursor = (Cursor)f.get("cursor", null);
useCustomCursor = f.get("useCustomCursor", false);
- sourceActions = f.get("sourceActions", 0)
- & (DnDConstants.ACTION_COPY_OR_MOVE | DnDConstants.ACTION_LINK);
+ sourceActions = newSourceActions;
transferable = (Transferable)s.readObject();
listener = (DragSourceListener)s.readObject();
// Implementation assumes 'transferable' is never null.