|
VdexReload 1.1.3 API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.reload.dweezil.gui.tree.DragTreeObject
A Drag Object that is a wrapper for an object dragged from DragTree to DragTree Ideally, you would sub-class this to make your own type.
It is safer if a drag object inside a DataFlavor reflects the actual object
type inside the tree node. As each DragTreeObject is created,
the DataFlavor is updated to represent this particular object type. A default
data flavor of "DataFlavor.javaJVMLocalObjectMimeType" seems to default to an
instance of java.io.InputStream as opposed to an instance of the user object contained
with a tree node.
If an instance of the DataFlavor does not reflect the
corresponding Transferable instance, then a ClassCastException can occur.
MacOS X seems to be more fussy about this format then Windows. For more info
see
http://java.sun.com/docs/books/tutorial/uiswing/misc/dnd.html,
section - Specifying the Data Format
and also
http://forum.java.sun.com/thread.jsp?thread=184916&forum=5&message=654598
Field Summary | |
protected java.lang.Object |
_object
The Object that we are transferring |
protected ReloadDragTree |
_owner
The Reload Drag Tree that is the owner of the dragged object |
static java.awt.datatransfer.DataFlavor |
flavor
The Data Flavor that we support - static because this is a kludge |
Fields inherited from interface uk.ac.reload.dweezil.DweezilConstants |
CR, DEBUG |
Constructor Summary | |
DragTreeObject(java.lang.Object object,
ReloadDragTree owner)
Constructor |
Method Summary | |
java.awt.datatransfer.DataFlavor |
getFlavor()
Method to dynamically figure out what type of object should be contained within the Flavor. |
ReloadDragTree |
getOwner()
Get the owner |
java.lang.Object |
getTransferData(java.awt.datatransfer.DataFlavor fl)
Get transfer data |
java.awt.datatransfer.DataFlavor[] |
getTransferDataFlavors()
Get transfer data flavors |
java.lang.Object |
getUserObject()
Method to return the user object contained within the Flavor container |
boolean |
isDataFlavorSupported(java.awt.datatransfer.DataFlavor fl)
Determine if a given Data Flavor is Supported |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.Object _object
protected ReloadDragTree _owner
public static java.awt.datatransfer.DataFlavor flavor
Constructor Detail |
public DragTreeObject(java.lang.Object object, ReloadDragTree owner)
object
- an user object contained within the Flavor containerowner
- the ReloadDragTreeMethod Detail |
public java.awt.datatransfer.DataFlavor getFlavor()
public java.lang.Object getUserObject()
public ReloadDragTree getOwner()
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor fl)
getTransferData
in interface java.awt.datatransfer.Transferable
fl
- the Data Flavor
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor fl)
isDataFlavorSupported
in interface java.awt.datatransfer.Transferable
fl
- the given Data Flavor
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
getTransferDataFlavors
in interface java.awt.datatransfer.Transferable
|
VdexReload 1.1.3 API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |