|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.dnd.DropTarget
net.lucidviews.util.gui.swing.dnd.DefaultDropTarget
public class DefaultDropTarget
An extension of the DropTarget class that invokes state
changes on the drag'n'drop event.
This class must be sub-classed and the drag/drop methods overridden with
custom implementations. NB: overridden methods must call the super method
to invoke the state change on the event.
Sub classes will probably want to override the
dataFlavourSupported too, to control the type of data being
dropped onto the target.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.dnd.DropTarget |
|---|
DropTarget.DropTargetAutoScroller |
| Field Summary | |
|---|---|
protected boolean |
canImport
A flag to remember whether import is being allowed for each drop event sent to this target. |
private static long |
serialVersionUID
Serialisation version id. |
protected int |
supportedActions
A bit mask of flags for actions supported by this target. |
| Constructor Summary | |
|---|---|
protected |
DefaultDropTarget(Component component,
int supportedActions)
Create a drop target for the specified component. |
| Method Summary | |
|---|---|
private boolean |
actionSupported(int action)
Check if an action is supported by this drop target. |
protected boolean |
dataFlavourSupported(Component component,
DataFlavor[] flavours)
Check if a data type is accepted by this drop target. |
void |
dragEnter(DropTargetDragEvent e)
|
void |
dragExit(DropTargetEvent e)
|
void |
dragOver(DropTargetDragEvent e)
|
void |
drop(DropTargetDropEvent e)
|
void |
dropActionChanged(DropTargetDragEvent e)
|
| Methods inherited from class java.awt.dnd.DropTarget |
|---|
addDropTargetListener, addNotify, clearAutoscroll, createDropTargetAutoScroller, createDropTargetContext, getComponent, getDefaultActions, getDropTargetContext, getFlavorMap, initializeAutoscrolling, isActive, removeDropTargetListener, removeNotify, setActive, setComponent, setDefaultActions, setFlavorMap, updateAutoscroll |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
protected int supportedActions
protected boolean canImport
| Constructor Detail |
|---|
protected DefaultDropTarget(Component component,
int supportedActions)
component - the GUI component that is to accept DnDssupportedActions - the actions that will be supported - a bit mask of DnDConstants| Method Detail |
|---|
private boolean actionSupported(int action)
action - the action is taking place - a bit mask of DnDConstants
true if the action is supported by this drop target
protected boolean dataFlavourSupported(Component component,
DataFlavor[] flavours)
component - the component being targetedflavours - the data flavour(s) of the incoming drag'n'drop event
public void dragEnter(DropTargetDragEvent e)
dragEnter in interface DropTargetListenerdragEnter in class DropTargetpublic void dragOver(DropTargetDragEvent e)
dragOver in interface DropTargetListenerdragOver in class DropTargetpublic void dragExit(DropTargetEvent e)
dragExit in interface DropTargetListenerdragExit in class DropTargetpublic void drop(DropTargetDropEvent e)
drop in interface DropTargetListenerdrop in class DropTargetpublic void dropActionChanged(DropTargetDragEvent e)
dropActionChanged in interface DropTargetListenerdropActionChanged in class DropTarget
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||