ca.sqlpower.architect.swingui
Class DnDTreePathTransferable
java.lang.Object
ca.sqlpower.architect.swingui.DnDTreePathTransferable
- All Implemented Interfaces:
- java.awt.datatransfer.Transferable, java.io.Serializable
public class DnDTreePathTransferable
- extends java.lang.Object
- implements java.awt.datatransfer.Transferable, java.io.Serializable
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TREEPATH_ARRAYLIST_FLAVOR
public static final java.awt.datatransfer.DataFlavor TREEPATH_ARRAYLIST_FLAVOR
data
protected java.util.ArrayList<int[]> data
DnDTreePathTransferable
public DnDTreePathTransferable(java.util.ArrayList<int[]> data,
java.lang.String userVisibleName)
getTransferDataFlavors
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
- Specified by:
getTransferDataFlavors in interface java.awt.datatransfer.Transferable
isDataFlavorSupported
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
- Specified by:
isDataFlavorSupported in interface java.awt.datatransfer.Transferable
getTransferData
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor)
throws java.awt.datatransfer.UnsupportedFlavorException,
java.io.IOException
- Specified by:
getTransferData in interface java.awt.datatransfer.Transferable
- Throws:
java.awt.datatransfer.UnsupportedFlavorException
java.io.IOException
getDnDPathToNode
public static int[] getDnDPathToNode(SQLObject node,
SQLObject treeRoot)
- Creates an integer array which holds the child indices of each
node starting from the root which lead to node "node."
This has the distinct disadvantage of complete lack of context. If you
drag an item from one dbtree to another playpen, the playpen can't
tell that the drop came from a different object tree, and it will do
the lookup based on the same set of offsets in its own tree. Sometimes
it will be a valid path (but to the wrong item) and sometimes it will
be an invalid path (because one of the steps is out of range). Either
way, you get the wrong answer.
- Parameters:
node - The SQLObject you want the path to
getNodeForDnDPath
public static SQLObject getNodeForDnDPath(SQLObject root,
int[] path)
throws ArchitectException
- Throws:
ArchitectException
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
Copyright © 2003-2007 SQL Power Group Inc. www.sqlpower.ca