Page Index Toggle Pages: 1 [2]  Send TopicPrint
Very Hot Topic (More than 25 Replies) ContainerNodes (Read 14740 times)
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ContainerNodes
Reply #15 - Apr 6th, 2009 at 4:20pm
Print Post  
I've emailed the dll to the msn address you have registered here.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ContainerNodes
Reply #16 - Apr 7th, 2009 at 9:16am
Print Post  
This version adds the Diagram.HitTestPriority property. Set it to ZOrder, and you will be able to select links inside containers.

https://mindfusion.eu/_beta/diaglite_hittestpr.zip

We are not sure whether the link end should be aligned to the container borders while drawing. Let us know if you don't like it, and we'll add some property to disable that for containers.

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


I love YaBB 1G - SP1!

Posts: 44
Joined: Feb 26th, 2009
Re: ContainerNodes
Reply #17 - Apr 7th, 2009 at 6:58pm
Print Post  
How to disable a container receiving node links (AllowIncoming and AllowOutgoing)?

I did this and not working:

AnchorPattern anchor = new AnchorPattern ();
Anchor.Points.Add (NewAnchorPoint (0, 0));
Anchor.Points.Add (NewAnchorPoint (0, 50));
Anchor.Points.Add (NewAnchorPoint (0, 100));

Anchor.Points.Add (NewAnchorPoint (100, 0));
Anchor.Points.Add (NewAnchorPoint (100, 50));
Anchor.Points.Add (NewAnchorPoint (100, 100));

Anchor.Points.Add (NewAnchorPoint (50, 0));

Anchor.Points.Add (NewAnchorPoint (50, 100));

Foreach (var point in anchor.Points)
(
Point.AllowIncoming = false;
Point.AllowOutgoing = false;
)


MyNode.AnchorPattern = anchor;
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ContainerNodes
Reply #18 - Apr 7th, 2009 at 7:21pm
Print Post  
Try handling LinkCreating / LinkModifying and:

if (e.Node is ContainerNode)
     e.Cancel = true;

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


I love YaBB 1G - SP1!

Posts: 44
Joined: Feb 26th, 2009
Re: ContainerNodes
Reply #19 - Apr 7th, 2009 at 11:33pm
Print Post  
Does not work right. Sorry I speak, but are missing some small features in DigramLite that is complicating my work.
Must be possible to disable a Node Receive Incoming and Outgoing Links.
  
Back to top
 
IP Logged
 
castefani
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 44
Joined: Feb 26th, 2009
Re: ContainerNodes
Reply #20 - Apr 8th, 2009 at 9:28pm
Print Post  
ContainerNode have Add and Remove methods, but I how I know if a node is already in the container?

It would be nice to have a "Contains" method or a property

List <DiagramItem> Children
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ContainerNodes
Reply #21 - Apr 9th, 2009 at 11:35am
Print Post  
This version adds the ContainerNode.Children property and removes the Add and Remove methods:
https://mindfusion.eu/_beta/diaglite_containers2.zip

Now you can call container.Children.Add, container.Children.Contains, etc.

Additionally, DiagramNode has AllowIncomingLinks and AllowOutgoingLinks properties. Set them to false for your containers to disable connecting links to them.

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


I love YaBB 1G - SP1!

Posts: 44
Joined: Feb 26th, 2009
Re: ContainerNodes
Reply #22 - Apr 9th, 2009 at 11:39am
Print Post  
tks
  
Back to top
 
IP Logged
 
castefani
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 44
Joined: Feb 26th, 2009
Re: ContainerNodes
Reply #23 - Apr 9th, 2009 at 11:53am
Print Post  
ContainerNode is a container, such as the Canvas?
Is there any property in class NodeCollection as the Parent to the canvas?
This is my problem:

1 - Adciono a ShapeNode the diagram;
2 - Adciono a ContainerNode;
3 - When you drag the shapeNode on ContainerNode, I call ContainerNode.Children
4 - Even changing ZIndex for both ContainerNode is on ShapeNode
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ContainerNodes
Reply #24 - Apr 9th, 2009 at 12:43pm
Print Post  
It's just a logical containment; the node's Parent is still the diagram's internal Canvas. We'll add some kind of ParentContainer property; meanwhile you could use ShapeNode.Tag or a hashtable to associate containers to their children.

Stoyan
  
Back to top
 
IP Logged
 
castefani
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 44
Joined: Feb 26th, 2009
Re: ContainerNodes
Reply #25 - Apr 9th, 2009 at 5:23pm
Print Post  
Try the following to your notice an error:
1 - Create a ShapeNode
2 - Create a ContainerNode
3 - Place the ShapeNode established on 1 within ContainerNode using Children.Add
4 - note that even changing the ZIndex the ContainerNode is on Shapenode

There would be a good ContainerNode be a real container?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ContainerNodes
Reply #26 - Apr 13th, 2009 at 12:25pm
Print Post  
This fixes the problem with ZIndex:
https://mindfusion.eu/_beta/diaglite_zindex.zip

Now you could set Zndex = 0 for containers that are created after their children.

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


I love YaBB 1G - SP1!

Posts: 3
Joined: Apr 21st, 2009
Re: ContainerNodes
Reply #27 - Apr 22nd, 2009 at 4:17pm
Print Post  
Hello,
I am using the dll from https://mindfusion.eu/_beta/diaglite_containers2.zip .

With the code below, I have the container node and Shape node arranged side by side. The layout class should respect the containment.
Even without the layout class, I am able to drag a node outside of the container class. I assume there is a work around to prevent this, but the basic design should be the child must stay within the boundaries of the parent.
Any fix release for this ?

       private void EncSeqDiag_Loaded(object sender, RoutedEventArgs e)
       {
           ContainerNode Parent1 = new ContainerNode(DiagramLite);
           DiagramLite.Nodes.Add(Parent1);
           Parent1.Bounds = new Rect(10, 10, 200, 100);

           ContainerNode Parent2 = new ContainerNode(DiagramLite);
           DiagramLite.Nodes.Add(Parent2);
           Parent2.Bounds = new Rect(10, 10, 200, 100);


           DiagramLite.ShapeBrush = new SolidColorBrush(Color.FromArgb(50, 0, 128, 192));
           for (int i = 0; i < 20; i++)
           {
               ShapeNode node = new ShapeNode(DiagramLite);
               node.Shape = Shape.Shapes["Ellipse"];
               node.Pen = new Pen(new SolidColorBrush(Colors.Black));
               node.Text = "node " + i;
               DiagramLite.Nodes.Add(node);
               Parent1.Children.Add(node);
           }
           for (int i = 21; i < 40; i++)
           {
               ShapeNode node = new ShapeNode(DiagramLite);
               node.Shape = Shape.Shapes["Ellipse"];
               node.Pen = new Pen(new SolidColorBrush(Colors.Black));
               node.Text = "node " + i;
               DiagramLite.Nodes.Add(node);
               Parent2.Children.Add(node);
           }

           Perform_Layout();
       }

       private void Perform_Layout()
       {
           var layout = new MindFusion.Diagramming.Silverlight.Layout.SpringLayout();
           layout.Arrange(DiagramLite);
       }

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ContainerNodes
Reply #28 - Apr 23rd, 2009 at 9:35am
Print Post  
We'll add support for containers to the layout classes in a few days. You could handle NodeModified or NodeModifying and set larger container.Bounds if it's a child of the container that's being modified.

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


I love YaBB 1G - SP1!

Posts: 44
Joined: Feb 26th, 2009
Re: ContainerNodes
Reply #29 - Apr 23rd, 2009 at 2:53pm
Print Post  
When saving the Diagram with SaveToXml and then recharge it with LoadFromXml, ControlNode.Children is empty
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint