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: TreeView Drop between nodes?
Date Wed, 08 Jun 2011 14:48:45 GMT
Ah, I see the problem. You need to create a new renderer instance - you can't re-use the one
from the TreeView (otherwise, you'll get the behavior you describe, since that one is actually
used to paint the tree nodes). 

Instead of:

TreeViewNodeRenderer renderer = (TreeViewNodeRenderer) getNodeRenderer();


TreeViewNodeRenderer renderer = new TreeViewNodeRenderer();

On Jun 8, 2011, at 10:38 AM, Edvin Syse wrote:

> Den 08.06.2011 16:29, skrev Greg Brown:
>>>            TreeViewNodeRenderer renderer = (TreeViewNodeRenderer) getNodeRenderer();
>>>            TreeNode node = (TreeNode) getSelectedNode();
>>>            Sequence.Tree.Path path = getSelectedPath();
>>>            renderer.render(node, path, getRowIndex(path), PageTreeView.this,
isBranchExpanded(path), isNodeSelected(path), getNodeCheckState(path), true, false);
>>>            return renderer;
>>> This paints the wrong node (two nodes higher). I tried creating a new TreeViewNodeRenderer,
but then it paints nothing. Please advice :)
>> Are you dragging the selected node or another node?
> Yes, the node is selected when I left-click to start to drag. I've also double checked
that I explicitly select the node before starting to drag. It seems the node that is painted
with the above code is always the last node in the tree.
> -- Edvin

View raw message