Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic SubordinateGroup and ShapeNode (Read 3363 times)
yrauma
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 61
Joined: Mar 28th, 2010
SubordinateGroup and ShapeNode
May 13th, 2010 at 2:23pm
Print Post  
Hello Stoyan !

I have a new issue for you hahahah.

In out project we are using the SubordinateGroup of the ShapeNode (not containers) for any custom needs we have.

I am not sure it's a good idea anymore. It seems that when we add the ShapeNode to any container it change its SubordinateGroup . its SubordinateGroup.AttachedNodes are resetted so it break everything.

Is there a way to prevent this from being changed when we add the node to a container or do we have to change our code and not use this anymore ?

Thanks Cheesy
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SubordinateGroup and ShapeNode
Reply #1 - May 13th, 2010 at 3:07pm
Print Post  
Hi there,

I can't see this happening; tried both with and without FollowMasterContainment. Are you by chance adding nodes to the container from some event handler?

Stoyan
  
Back to top
 
IP Logged
 
yrauma
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 61
Joined: Mar 28th, 2010
Re: SubordinateGroup and ShapeNode
Reply #2 - May 13th, 2010 at 3:59pm
Print Post  
Hey,

no not at all.
I just use the container.add(node) function.

and when I debug the code I can cleary see that this call kills the SubordinateGroup.

to modify the group of the node we use :
node.SubordinateGroup.AttachToCorner(container, 0);

Can it be a bug related to the old version I have ?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SubordinateGroup and ShapeNode
Reply #3 - May 14th, 2010 at 5:54am
Print Post  
This also works in my test app. What older version are you using?

Stoyan
  
Back to top
 
IP Logged
 
yrauma
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 61
Joined: Mar 28th, 2010
Re: SubordinateGroup and ShapeNode
Reply #4 - May 14th, 2010 at 1:52pm
Print Post  
Good Morning Stoyan !

We are using v5.3 Beta...

Here is with more precision what we do :

We use CustomShapeNode associated with CustomContainerNode...
Each CustomShapeNode is displayed with its CustomContainerNode underneath which is important for our project. 

When we create the CustomContainerNode to be associated with the CustomShapeNode we call :


Code
Select All
AssociatedCustomShapeNode .SubordinateGroup.AttachToCorner(this, 0);
 



This way we can access the CustomContainerNode  from the CustomShapeNode  via :

Code
Select All
CustomShapeNode  .SubordinateGroup.AttachedNodes[i] as CustomContainerNode
 




And this works perfectly.

But since recently we decided to add container in our project to add functionalities to our diagrams...
ShapeNode and its associated CustomContainerNode into our containers.

But when we add the CustomContainerNode associated to the ShapeNode already in the container by calling
Code
Select All
container.Add(CustomContainerNode);
 



this modify the CustomShapeNode.SubordinateGroup of the CustomShapeNode associated to the CustomContainerNode just added...

It`s 100% repro...

I hope it's clear :S

Thanks again Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SubordinateGroup and ShapeNode
Reply #5 - May 14th, 2010 at 3:34pm
Print Post  
Hi,

A ContainerNode is just a node with associated group, and calling container.Add(some group's attahed node) will detach the node from its previous group. You should add only the group's master to the container; if you were trying to add the child so that the container's bounds grow to include it, set the group's FollowMasterContainement property instead.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
yrauma
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 61
Joined: Mar 28th, 2010
Re: SubordinateGroup and ShapeNode
Reply #6 - May 14th, 2010 at 7:38pm
Print Post  
YES !

that works perfectly you are right !
Thank you so much for the help one more time !!!!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint