Page Index Toggle Pages: 1 [2] 3  Send TopicPrint
Very Hot Topic (More than 25 Replies) Usage of Group (Read 17795 times)
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Usage of Group
Reply #15 - Jul 28th, 2010 at 1:16pm
Print Post  
If the nodes follow while you are dragging the DiagramGroup, then I suppose NodeEventArgs.Node refers to DiagramGroup. It will also work if e.Node refers to the ShapeNode and you have called ShapeNode.AttachTo(DiagramGroup) - in that case ShapeNode will follow DiagramGroup and the rest of the nodes will follow ShapeNode.
  
Back to top
 
IP Logged
 
srinivas
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 41
Joined: Jul 27th, 2010
Re: Usage of Group
Reply #16 - Jul 28th, 2010 at 2:59pm
Print Post  
Hi Stoyo,

Thanks for all the help, I got the nodes attached to group.

I need some more clarifications as how the below can be achieved

1. How can I calculate group box position when
    changing diagram orientation? when I attach nodes to the group and change the orientation to horizantal the group box is not getting redrawn showing enclosed with the attached nodes, its not moving along with diagram orientation.

2. After adding the group box the connection between the attached nodes is redrawn outside of the group box, removing the connection between the attached nodes, how to deal with this, I need the connections not changed between the attached nodes after adding the group box.

3. I want to detach the node once if i move the attached node out of the box.

Please let me know how to resolve these, I appreciate your help.

Regards
Velidanda
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Usage of Group
Reply #17 - Jul 28th, 2010 at 3:07pm
Print Post  
Hi,

1. What do you mean by diagram orientation?

2. If you have enabled link auto-routing and the link route changes once you add the group box, you can prevent that by setting groupBox.Obstacle = false.

3. Handle NodeModified and check if groupBox.Bounds.Contains(e.Node.Bounds). If it doesn't, call e.Node.Detach().

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
srinivas
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 41
Joined: Jul 27th, 2010
Re: Usage of Group
Reply #18 - Jul 29th, 2010 at 1:53am
Print Post  
We have an option to view the process diagram in two directions, Vertical and Horzantal.

When I add the group box in Vertical direction enclosing/attaching the nodes and then if I chage to see the process in horizantal direction, group box is not getting redrawn to see the nodes enclosed in the group box.

Currently, group box is fixed at the same location where I add, I need the entire diagram floating whenever I chage the direction of the view with all the nodes. Please let me know as how this can be achieved.

Though the group box is not moving along with the nodes when I change the direction of the view but when I try to move the group box the attached nodes are still moving.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Usage of Group
Reply #19 - Jul 29th, 2010 at 5:16am
Print Post  
If you have already implemented code that rearranges all other nodes according to the new orientation, you can set the group box' Bounds to the union of all its child nodes' bounding rectangles:

Code
Select All
var childNodes = groupBox.SubordinateGroup.AttachedNodes;
if (childNodes.Count > 0)
{
	RectangleF union = childNodes[0].Bounds;
	foreach (DiagramNode node in childNodes)
		union = RectangleF.Union(union, node.Bounds);
	union.Inflate(margin, margin);
	groupBox.SetBounds(union, false, true);
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
srinivas
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 41
Joined: Jul 27th, 2010
Re: Usage of Group
Reply #20 - Jul 29th, 2010 at 9:37am
Print Post  
Thanks Stoyan, Detach and Orientation issues are resolved.

Redrawing of arrows/connectors after adding group box is not resolved yet, tried to set Obstacle to false for both DiagramGroup object and ShapeNode object that is getting set as MainItem of the Group object but it is not working, it is annoying to see the connectors redrawn for the attached nodes, can you suggest some other way to get this fixed.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Usage of Group
Reply #21 - Jul 29th, 2010 at 11:08am
Print Post  
At what point are you setting Obstacle = false? That should happen before adding the new nodes to the diagram, and so the Factory methods won't work here. Instead you must explicitly create the node instance and add to diagram.Nodes:

Code
Select All
var node = new ShapeNode(...);
node.Obstacle = false;
diagram.Nodes.Add(node); 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
srinivas
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 41
Joined: Jul 27th, 2010
Re: Usage of Group
Reply #22 - Jul 30th, 2010 at 6:16am
Print Post  
Thanks, that worked perfectly.

I was setting Obstacle false to DiagramGroup class object after creating Group object, tried setting Obstcle to false while attaching nodes and it is working as expected.

Thanks for all the support.

One more query, Sad

For simple maps with few nodes it is working as expected, but when I have more complex diagram with some 15 nodes overall and grouping say some 3 nodes and when the diagram is applied with different layout options other nodes which are not attached to group are shown within the group box in UI, Please let me know any workaround for this. I am using rounded rectangle shape for the group box, would that be an issue?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Usage of Group
Reply #23 - Jul 30th, 2010 at 7:29am
Print Post  
What layout class and settings are you using?
  
Back to top
 
IP Logged
 
srinivas
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 41
Joined: Jul 27th, 2010
Re: Usage of Group
Reply #24 - Jul 30th, 2010 at 9:14am
Print Post  
Using Mindfusion.Diagramming.Layout.LayeredLayout and TreeLayout clasess.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Usage of Group
Reply #25 - Jul 30th, 2010 at 9:38am
Print Post  
For LayeredLayout set IgnoreNodeSize = false. TreeLayout should not ignore it by default.
  
Back to top
 
IP Logged
 
srinivas
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 41
Joined: Jul 27th, 2010
Re: Usage of Group
Reply #26 - Jul 30th, 2010 at 12:47pm
Print Post  
Tried setting IgnoreNodeSize = false for LayeredLayout but it is not working.

I have to use same Group class in Silverlight but not finding same Group class in MindFusion.Diagramming.Silverlight, we are using earlier version 1.0.3.

Can you let me know whether we have Group class in that version of Diagramlite or not otherwise let me know any alternate.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Usage of Group
Reply #27 - Jul 30th, 2010 at 12:51pm
Print Post  
Are you setting KeepGroupLayout = true when running the layout methods?

There's no grouping in the Silverlight version. You might try using ContainerNodes instead.

Stoyan
  
Back to top
 
IP Logged
 
srinivas
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 41
Joined: Jul 27th, 2010
Re: Usage of Group
Reply #28 - Aug 2nd, 2010 at 12:06pm
Print Post  
Hi Stoyan,

Trying to use ContainerNode instead of Group in MindFusion.Diagramming.Silverlight but finding issues as not able to instantiate a class extending DiagramNode class of MindFusion.Diagramming.Silverlight as DiagramNode class does not have zero argument constructor.

Can you let me know if there is any workaround for this?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Usage of Group
Reply #29 - Aug 2nd, 2010 at 1:03pm
Print Post  
Hi Velidanda,

What version of the Silverlight control are you using? I can see the following constructors defined in DiagramNode.cs:

public DiagramNode()
public DiagramNode(Diagram parent)
public DiagramNode(DiagramNode prototype)

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 3 
Send TopicPrint