Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic tree collapse event for labeled node (Read 1918 times)
tmtton
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 39
Joined: May 9th, 2008
tree collapse event for labeled node
May 4th, 2009 at 3:49am
Print Post  
I have a node with a label node attached. How do I have them act as if they were one single node when users expand or collapse a tree branch?

// my code snippet
ShapeNode node = new ShapeNode(diagram);
node.setExpandable(true);
ShapeNode label = new ShapeNode(diagram);
label.attachTo(node, AttachToNode.TopCenter);
diagram.add(node);
diagram.add(label);
node.getSubordinateGroup().setAutoDeleteItems(true);
node.getSubordinateGroup().setExpandable(true);

Without the node.getSubordinateGroup().setExpandable(true) call above, the child node's label gets left behind (still shown) on a collapse. With this call, labels of both the child and parent nodes are taken away (not shown) on a collapse. Neither gives me the behavior I want.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: tree collapse event for labeled node
Reply #1 - May 4th, 2009 at 9:27am
Print Post  
Seems we'll have to change the group.Expandable property to an enumeration to support this scenario. For the time being, you could fix the parent's label visibility from the treeExpanded and treeCollapsed event handlers.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint