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.
Unfortunately, activation email could not send to your email. Please try again.

SplineTool and PolyLineLinkTool -> event when two nodes are connected

Thread ID:

Created:

Updated:

Platform:

Replies:

91786 Dec 2,2009 06:04 AM Dec 17,2009 09:48 AM Windows Forms 6
loading
Tags: Diagram
Domenico Mozzone
Asked On December 2, 2009 06:04 AM

Hi there,
I'm evaluating Syncfusion Diagram Windows. I'm sorry for my insistence.
I’m trying to use SplineTool and PolyLineLinkTool to connect two nodes. I saw CoolLinks_2008 example to see how.
I’ve got some problems:
1. Activating the PolyLineLinkTool using this.diagram1.ActivateTool("PolyLineLinkTool"); command in my test Application, nothing happens, while the same command in the axample activates the tool; the polyLineBase object (that I tried to use to apply a decorator is null PolyLineBase line = this.diagram1.Controller.ActiveTool as PolyLineBase;). What I’m missing?

2. A base feature for my diagram application is to know which nodes a new connector is connecting. In a previous post you kindly indicate the way to do it. I used the same way using SplineTool to connect nodes, but the indicated way doesn’t work as the endpoint container is not ConnectorBase derived but is a SplineNode (see code)
void EventSink_ConnectionsChanged(CollectionExEventArgs evtArgs)
{
switch (evtArgs.ChangeType)
{
case CollectionExChangeType.Clear:
break;
case CollectionExChangeType.Insert:
EndPoint conPoint = evtArgs.Element as EndPoint;
ConnectorBase con = conPoint.Container as ConnectorBase; //NULL if I use SplineTool
break;
case CollectionExChangeType.Set:
break;
default:
break;
}
}

How can I solve the problem to get nodes that a Spline or PolyLine Connector type connects?

Thank you for your patience
Best Regards
Domenico

Domenico Mozzone
Replied On December 4, 2009 10:58 AM

Dear Syncfusion Supprot,
waiting for your kind reply I made more experiments with Syncfusion Diagram Windows.
Till now I’m not able to use SplineTool to connect two nodes and to know which of them the Spline connector connects. Well I’ll use other connector types.
Now I’m going on testing some other features that I would like to use.
In particular I’m trying to use a custom connector derived from LineConnector or OrthogonalConnector. I successfully create the custom connector, but I can’t activate it to be used by user.
Can you help me?
Best Regards
Domenico

Dinesh M [Syncfusion]
Replied On December 4, 2009 12:13 PM

Hi Domenico,

Sorry for the delay in getting back to you.

The SplineTool creates "SplineNode" which is not derived from "ConnectorBase" class and hence it will not connect nodes at the time of drawing using the tool. To create customized line connector using a tool than we should customize the corresponding tool also. Please check the following online document on customizing the Tool class.

http://help.syncfusion.com/ug_74/diagramwin/HowToChangeTheColorOfTheLineConnectorWhenActivatingTheLineTool.html

Regards,
Dinesh

Domenico Mozzone
Replied On December 9, 2009 07:18 AM

Hi Dinesh,
thank you for your reply.
My question was not clear so the provided example was not so helpful.
I done some more tests and now I’m trying to formulate the question in a better way.

I would like to connect to custom symbols with a custom connector through custom ports. The aim is to have a list of connectors with information about symbols connected and ports used.

The custom symbol has a property that represents its ID and a certain number of ports with unique ID too (see attached code).
The custom connector, LineConnector derived, has two properties the port From and port To.

Connecting two symbols with the first connector all is right.
Connecting the same two symbols with another connector something goes wrong:
- ConnectionsChanged event fires twice, (inspecting code it seems that edges of From node are incongruent)
- The first connector disappears.
I can’t explain such behavior. Can you help me?
I believe that something is missing in my code building the LineConnectorCustom and its Tool.
Where I can find a complete example showing how to build a custom connector and custom tool to activate it?
I’ve attached my example code. A message box appears after adding the second connector as the ConnectionsChanged event fire twice.
Best Regards
Domenico




TestCustom_e682f937.zip

Dinesh M [Syncfusion]
Replied On December 16, 2009 09:00 AM

Hi Domenico,

Sorry for the inadvertent delay in getting back to you. The connection changed event will be fired twice while connecting with the tool since it works w.r.t to the endpoints of the connector. I couldn't able to get the exact reason for disappearing first connector, but it looks that the second connector tries to connect to the first connector. Try setting the EnableCentralPort property of connector to false. Currently we do not have a sample that has a combined customization of classes apart from the individual functionality samples I have provided in your other forum postings.

Regards,
Dinesh

Domenico Mozzone
Replied On December 17, 2009 01:15 AM

Thank you Dinesh for your reply.
Meanwhile I have solved the problem taking a different way.
Best regards
Domenico

Dinesh M [Syncfusion]
Replied On December 17, 2009 09:48 AM

Hi Domenico,

Thanks for the information.

Regards,
Dinesh

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;