public class DnDSupport extends java.lang.Object implements DnDTarget, DnDSource, DnDDropHandler.WithResult, Disposable
DnDDropHandler.WithResult
Disposable.Parent
Modifier and Type | Method and Description |
---|---|
boolean |
canStartDragging(DnDAction action,
java.awt.Point dragOrigin) |
void |
cleanUpOnLeave() |
static DnDSupportBuilder |
createBuilder(javax.swing.JComponent component) |
Pair<java.awt.Image,java.awt.Point> |
createDraggedImage(DnDAction action,
java.awt.Point dragOrigin) |
void |
dispose()
Usually not invoked directly, see class javadoc.
|
void |
dragDropEnd() |
void |
dropActionChanged(int gestureModifiers) |
boolean |
possiblyDrop(DnDEvent aEvent) |
DnDDragStartBean |
startDragging(DnDAction action,
java.awt.Point dragOrigin) |
boolean |
update(DnDEvent event) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
updateDraggedImage
createDraggedImage
drop
public boolean canStartDragging(DnDAction action, java.awt.Point dragOrigin)
canStartDragging
in interface DnDSource
public DnDDragStartBean startDragging(DnDAction action, java.awt.Point dragOrigin)
startDragging
in interface DnDSource
public Pair<java.awt.Image,java.awt.Point> createDraggedImage(DnDAction action, java.awt.Point dragOrigin)
createDraggedImage
in interface DnDSource
public void dragDropEnd()
dragDropEnd
in interface DnDSource
public void dropActionChanged(int gestureModifiers)
dropActionChanged
in interface DnDDropActionHandler
dropActionChanged
in interface DnDSource
public boolean update(DnDEvent event)
update
in interface DnDTargetChecker
event
- Drag-n-Drop eventtrue
- if this target is unable to handle the event and parent component should be asked to process it.
false
- if this target is able to handle the event and parent component should NOT be asked to process it.DnDEvent.setDropPossible(boolean, String)
,
DnDEvent.setDropPossible(String, DropActionHandler)
public boolean possiblyDrop(DnDEvent aEvent)
possiblyDrop
in interface DnDDropHandler.WithResult
true
if drop succeededpublic void cleanUpOnLeave()
cleanUpOnLeave
in interface DnDTarget
public void dispose()
Disposable
dispose
in interface Disposable
public static DnDSupportBuilder createBuilder(javax.swing.JComponent component)