Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Adding "Connection Points" to Containers (Read 951 times)
Mel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 2
Joined: Dec 20th, 2022
Adding "Connection Points" to Containers
Dec 20th, 2022 at 8:53pm
Print Post  
Hey Guys

New to Mindfusion and my first post here.  I am trying to create "connection points" inside containers as per the attached diagram.  My first thought was to simply create rectangular containers inside other containers.  Problem I am running into is how to specify where these connection points get drawn inside the parent.  I don't see any way of setting bounds relative to the parent and I suspect I would be fighting against the layout managers if I tried to do so.  Any suggestions how to accomplish this?  Note containers may have different numbers of children and children may be nested.  I am not committed to any particular layout or entities, just trying to model the diagram as best I can.

Appreciate any help you can provide.

Mel



  

ConnectionEndpoints.png ( 12 KB | 39 Downloads )
ConnectionEndpoints.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: Adding "Connection Points" to Containers
Reply #1 - Dec 21st, 2022 at 11:45am
Print Post  
Hi Mel,

You could try using grouping:

Code
Select All
void TestGroups()
{
	var container = diagram.Factory.CreateShapeNode(
		10, 10, 200, 200, Shapes.Rectangle);
	container.AllowIncomingLinks = false;
	container.AllowOutgoingLinks = false;

	var outChild = diagram.Factory.CreateShapeNode(
		container.Bounds.Right - 20,
		container.Bounds.Top + 20,
		20, 50, Shapes.Rectangle);
	outChild.AllowIncomingLinks = false;
	outChild.AllowOutgoingLinks = true;
	outChild.AttachTo(container,
		GroupAnchorStyles.Top | GroupAnchorStyles.Right);
	outChild.EnabledHandles = AdjustmentHandles.None;

	var inChild = diagram.Factory.CreateShapeNode(
		container.Bounds.Left,
		container.Bounds.Top + 20,
		20, 50, Shapes.Rectangle);
	inChild.AllowIncomingLinks = true;
	inChild.AllowOutgoingLinks = false;
	inChild.AttachTo(container,
		GroupAnchorStyles.Top | GroupAnchorStyles.Left);
	inChild.EnabledHandles = AdjustmentHandles.None;
} 



with a possible drawback you will have to look for the links inside main node's SubordinateGroup -> AttachedNodes -> *Links collections, and get link's node through link.*Node.MasterGroup.MainItem.

Other methods you could try:
- custom-draw the rectangles inside a single ShapeNode; handle link validation events to prevent drawing links from outside the rectangles.
- use several anchor points for each linkable rectangle, with MarkStyle set to Custom; draw a single rectangle for the group of points.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Mel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 2
Joined: Dec 20th, 2022
Re: Adding "Connection Points" to Containers
Reply #2 - Dec 21st, 2022 at 1:19pm
Print Post  
Thank you.  We will look into your suggestions.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint