public class TreeTableDragAndDropManager extends Object implements DragSourceListener, DropTargetListener, DragGestureListener, ICommandStackListener, PropertyChangeListener
INodeDragAndDropPolicy.getDragActions(Object, ITreeTableModel)
,
INodeDragAndDropPolicy.getDropActions(Object, Object, ITreeTableModel,
Object, ITreeTableModel)
,
INodeDragAndDropPolicy.getDragAndDropCommand(Object, Object,
ITreeTableModel, int, Object, ITreeTableModel, int, int)
,
ITreeTableNode.getDragActions()
,
ITreeTableNode.getDropActions(ITreeTableNode)
Constructor and Description |
---|
TreeTableDragAndDropManager(TreeTable table)
Constructs a new drag and drop manager for the given table.
|
Modifier and Type | Method and Description |
---|---|
void |
commandStackChanged(CommandStackEvent e)
Gets called whenever the command stack changed.
|
protected Image |
createDragImage(TreeTableNode node)
Creates a drag image for the given tree table node.
|
void |
dragDropEnd(DragSourceDropEvent e) |
void |
dragEnter(DragSourceDragEvent e) |
void |
dragEnter(DropTargetDragEvent dtde) |
void |
dragExit(DragSourceEvent dse) |
void |
dragExit(DropTargetEvent dte) |
void |
dragGestureRecognized(DragGestureEvent dge) |
void |
dragOver(DragSourceDragEvent dsde) |
void |
dragOver(DropTargetDragEvent dtde) |
void |
drop(DropTargetDropEvent dtde) |
void |
dropActionChanged(DragSourceDragEvent dsde) |
void |
dropActionChanged(DropTargetDragEvent dtde) |
TreeTableNode |
getDraggedNode()
Returns the dragged tree table node.
|
Point |
getDragLocation()
Returns the current drag location.
|
int |
getDropRow()
Returns the row where the drop will occure when the user finishes the
drop.
|
TreeTable |
getTreeTable()
Returns the tree table that is being managed by the DnD manager.
|
boolean |
isDragOK(DropTargetDragEvent dtde)
Performs all the necessary checks in order to find out whether the given
drop target event specifies a valid drop location.
|
boolean |
isValidDropLocation()
Determines whether the current drag location is a valid drop location.
|
void |
propertyChange(PropertyChangeEvent evt) |
public TreeTableDragAndDropManager(TreeTable table)
table
- the table that will be managedpublic TreeTable getTreeTable()
public void dragEnter(DragSourceDragEvent e)
dragEnter
in interface DragSourceListener
public void dragOver(DragSourceDragEvent dsde)
dragOver
in interface DragSourceListener
public void dropActionChanged(DragSourceDragEvent dsde)
dropActionChanged
in interface DragSourceListener
public void dragExit(DragSourceEvent dse)
dragExit
in interface DragSourceListener
public void dragDropEnd(DragSourceDropEvent e)
dragDropEnd
in interface DragSourceListener
public void dragEnter(DropTargetDragEvent dtde)
dragEnter
in interface DropTargetListener
public void dragOver(DropTargetDragEvent dtde)
dragOver
in interface DropTargetListener
public void dropActionChanged(DropTargetDragEvent dtde)
dropActionChanged
in interface DropTargetListener
public void dragExit(DropTargetEvent dte)
dragExit
in interface DropTargetListener
public void drop(DropTargetDropEvent dtde)
drop
in interface DropTargetListener
public void dragGestureRecognized(DragGestureEvent dge)
dragGestureRecognized
in interface DragGestureListener
public int getDropRow()
public TreeTableNode getDraggedNode()
public Point getDragLocation()
protected Image createDragImage(TreeTableNode node)
Integer.MIN_VALUE
for the column index so that the renderer knows
that it is rendering the drag image.node
- the node that is being draggedDragSource.isDragImageSupported()
public void commandStackChanged(CommandStackEvent e)
ICommandStackListener
commandStackChanged
in interface ICommandStackListener
e
- the event issued by the command stackpublic void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
public boolean isDragOK(DropTargetDragEvent dtde)
dtde
- the drop target drag eventpublic boolean isValidDropLocation()
Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.