pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Brown" <gk_br...@verizon.net>
Subject Re: Drag and Drop using a TreeView as the DropTarget
Date Thu, 10 Mar 2011 01:01:47 GMT
The coordinates should be in the coordinate space of the tree view.

----- Reply message -----
From: "Chris Bartlett" <cbartlett.x@gmail.com>
Date: Wed, Mar 9, 2011 3:38 pm
Subject: Drag and Drop using a TreeView as the DropTarget
To: <user@pivot.apache.org>


You can determine the path to the tree view node at a given y position with

When the drop occurs you are provided x and y coordinates
org.apache.pivot.wtk.Manifest, int, int, int,

If for some reason the y coordinate from doesn't seem right, you  might need
to use one of the mapPointToAncestor / mapPointFromAncestor methods on
Component.  (It will probably be OK, but I am not in a position to check
right now)
int, int)


On 10 March 2011 03:06, Marco Castillo <mabcastillo@gmail.com> wrote:

> Dear List:
> We have a split pane, in the left part of the pane there is a tree view
> with directories, in the right pane there is a TableView with the file
> detail for each directory. Each node and branch of the tree represents
> directories. A node is a directory without directories within. We implement
> a drag and drop feature using the TableView as the source and the TreeView
> as the target. The drag and drop functionality will move a file from its
> current directory to another (the one selected in the source). The drag
> source functionality works quite well, but in the target functionality we
> found a problem. The problem is that when we drop the item within the tree,
> we can't correctly choose the selected branch or node we want to drop the
> dragged item. How can we found which is the branch or node within the
> TreeView that is selected by the mouse when we hover over the TreeView? Is
> there a way that we can define a single branch or node as a drop target?
> Any help will be greatly appreciated.
> Regards
> Marco

View raw message