We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Loop connector strange behavior

Hi,

1. We use nodes connected by OrthogonalConnector. We notice very strange behavior. We add node and set looped connector (FromNode == ToNode) and set end points on different edges (e.g. left and top) connector works fine. But when line is from and to the same edge (look at 1.png from attachment) after some operation (e.g. move vertical line segment) this connector will decrease size to 0 (look at 2.png). I notice that you call methods MergeControlPoints (or MergePoints) which do this but why? I want my connector look exactly like on 1.png image. How can I avoid this?

2. Look at 3.png. This is how node moving works with loop connector. It increase or decrease connector bounding size. Is it possible to move connector like this together with node? I try to select connector when moving starts but selection in that case start work strange. How can I set properly selection on connector before moving start?

Regards,
Klaudiusz


attachment_9b06304b.zip

6 Replies

AA Amsath Ali M Syncfusion Team December 17, 2012 12:57 PM UTC

Hi kaludiusz,

 

Thanks for your interest in Syncfusion products.

1. With regards to your query “I notice that you call methods MergeControlPoints (or MergePoints) which do this but why?” please note that the diagram control adds all the points which are located inside the path of the connector while moving it. The MergeControlPoints (or mergePoints) methods are used to merge the points which are placed in the line that is removes unwanted control points which are present in the same line segment of the connector. These methods are also used to restrict the connector from adding unwanted line segments to the connector.

2. I want my connector look exactly like on 1.png image. How can I avoid this?

Currently we don’t have support to establish self-loop connection for nodes. This has been suspected to be a feature. Please create a DT incident for your query so that we can update the patch for this feature.

You can create the DT incident from the following link.
http://www.syncfusion.com/account/dashboard

In the interests of maintaining confidentiality, we have a policy of not sharing patches or otherwise proprietary customer specific information in the public Forum.

 

Please let us know if you have any queries.

 

Regards,

Amsath Ali. M



DG Dominik Gregotsch August 12, 2014 08:26 AM UTC

Hi

I also need a self-loop connection, is this now implemented?
If yes how does it work?
If no will it come in a new Update?

regards
Dominik


EN enova August 18, 2014 12:48 PM UTC

Hi,

In my case it works but I add a lot of code to create diagram (my own nodes, connectors, controller, etc.) so I can't check if it works whitout my changes.

Best regards

Klaudiusz



AK Ashok Kumar V Syncfusion Team August 20, 2014 08:39 AM UTC

Hi Klaudiusz,

Thanks for your update.

We are happy to hear that your requirement is achieved. Could you please send us your Custom “Self Loop” implementation, so that we could check and let you know if it works without your changes?

Please let us know if any concern,

Regards,

Ashok Kumar.



EN enova August 20, 2014 09:50 AM UTC

Hi,

My mistake. It was some time ago so I check what I did to get loop connector. If I'm not wrong I do this:
1. I store all connector points (from property PathPoints)
2. Diagram Creation:
  a). Create connector instance
  b). Connect to nodes (method TryConnect)
  c). Call connector.SetPoints(points stored in 1)

I was looking for if I was doing something more but it seems that it's all.

Best regards,
Klaudiusz


AK Ashok Kumar V Syncfusion Team August 22, 2014 12:38 PM UTC

Hi Klaudiusz,

Thanks for your update.

We are glad to inform you that we have created a simple sample to achieve your requirement with our solution. We suggest you to use diagram.EventSink’s “NodeSelected” Event to achieve your requirement. Please refer the below code snippet attached sample for your reference.

Here is the code snippet:

[C#]

foreach (ConnectorBase bs in evtArgs.Node.Edges)

{

    //Checking whether the connector is self-looped

    if (bs.FromNode == bs.ToNode)

    {

        //Adding the self-loop connector to the selection List

        diagram1.Controller.SelectionList.Add(bs);

    }

}

Please let us know if any concern.

Regards,

Ashok Kumar.


Attachment: Forum_9e3dc648.zip

Loader.
Live Chat Icon For mobile
Up arrow icon