Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic TableNode : prevent connecting In to Out (Read 2750 times)
moelski
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 50
Joined: Feb 28th, 2011
TableNode : prevent connecting In to Out
Mar 3rd, 2011 at 9:10am
Print Post  
Hi !

If you use the Entity demo you are able to connect to In Pin to an Out Pin.
Is there a way to avoid this?

And there is another problem ...
Pick the Output and wire it to the top:

Then you will get this:


And one last question for this topic ...
Is it possible to have only one connection for each In / Out Pin ?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: TableNode : prevent connecting In to Out
Reply #1 - Mar 3rd, 2011 at 9:49am
Print Post  
Hi,

Your screenshot doesn't look exactly as in the Entities sample Smiley If you copying code from it, make sure you haven't missed anything, e.g. the AnchorPattern definition. I can't connect In to Out pins in the installed Entities sample, and also self-loop links there connect the pins and do not start from the top of the table.

Regarding preventing additional links, try handling the LinkCreating event and check how many links there are connected ton the origin or destination' row indicated by LinkValidationEventArgs.TableRow. If their count is already greater than 0, set e.Cancel = false or call e.CancelDrag().

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


I love YaBB 1G - SP1!

Posts: 50
Joined: Feb 28th, 2011
Re: TableNode : prevent connecting In to Out
Reply #2 - Mar 3rd, 2011 at 11:24am
Print Post  
Hi !

Quote:
make sure you haven't missed anything, e.g. the AnchorPattern

You are right. I missed something ...

Quote:
self-loop links there connect the pins

And how can I prevent these self-loops ?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: TableNode : prevent connecting In to Out
Reply #3 - Mar 3rd, 2011 at 11:31am
Print Post  
Diagram.AllowSelfLoops = false.

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


I love YaBB 1G - SP1!

Posts: 50
Joined: Feb 28th, 2011
Re: TableNode : prevent connecting In to Out
Reply #4 - Mar 3rd, 2011 at 11:40am
Print Post  
Hi !

Quote:
make sure you haven't missed anything, e.g. the AnchorPattern definition

To be honest i canīt find any bug in my code.
Code
Select All
		// set connection points
		AnchorPoint ptin = new AnchorPoint(50, 50, true, false, Color.Red, 0);
		AnchorPoint ptout = new AnchorPoint(50, 50, false, true, Color.Red, 3);
		ArrayList al = new ArrayList();

		for (int i = 0; i <= 0; i++)  // <= 2
		{
		    al.Clear();
		    if (!(form.GetInput(i) == null))
		    {
			  t[0, i].ImageAlign = ImageAlign.Center;
			  t[0, i].Image = images.Images[0];
			  t[1, i].Text = form.GetInput(i);
			  al.Add(ptin.Clone());
		    }
		    if (!(form.GetOutput(i) == null))
		    {
			  t[3, i].ImageAlign = ImageAlign.Center;
			  t[3, i].Image = images.Images[1];
			  t[2, i].Text = form.GetOutput(i);
			  t[2, i].TextFormat.Alignment = StringAlignment.Far;
			  al.Add(ptout.Clone());
		    }
		    t.Rows[i].AnchorPattern = new AnchorPattern(
			  (AnchorPoint[])al.ToArray(typeof(AnchorPoint)));
		} 



I only changed the number of rows in the Loop to 1 ...

Anyway ... Setting Diagram.AllowSelfLoops = false fixes also the problem of loops at the top of the table  Cheesy
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: TableNode : prevent connecting In to Out
Reply #5 - Mar 3rd, 2011 at 12:09pm
Print Post  
From the instructions you sent us with the sample project it seems you are creating tables with either only an input or only an output. In that case the control won't let you connect to the anchor points if drawing from In to Out table, but still let you connect the tables (the links simply connecting anywhere at the table borders). If that's the problem, try also setting AllowUnanchoredLinks = false.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint