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.

Syncronize moving of linked symbols

Thread ID:

Created:

Updated:

Platform:

Replies:

36208 Oct 22,2005 04:57 PM Dec 21,2005 03:15 PM Windows Forms 11
loading
Tags: Diagram
Tim Wendland
Asked On October 22, 2005 04:57 PM

Hello, I''m having a bit of a problem and was hoping your great team can help. I have 2 symbols on a diagram, they are connected using the LINKCMD. I would like to have the 2 symbols move together if a user changes the location of either symbol. How can I make that happen?

Administrator [Syncfusion]
Replied On October 23, 2005 01:01 AM

Hi Tim, Have you considered grouping the two symbols and the link together so that they function as a single entity? The interactive GroupTool or the GroupCmd can be used for grouping a selection of nodes together. If grouping will not work, another option would be to handle the Diagram.NodeMoved event, and if you detect one of the symbols being moved, then displace the other symbol as well through the same X and Y offset. The MoveCmd may be used for moving a node(s) through a specified offset. Thanks, Prakash Surendra Syncfusion Inc.,

Tim Wendland
Replied On October 23, 2005 09:32 PM

Thank you Prakash! The grouping work great, but i used the movecmd and the NodeMoved event which you suggested and it works great. Thanks again. >Hi Tim, > >Have you considered grouping the two symbols and the link together so that they function as a single entity? The interactive GroupTool or the GroupCmd can be used for grouping a selection of nodes together. > >If grouping will not work, another option would be to handle the Diagram.NodeMoved event, and if you detect one of the symbols being moved, then displace the other symbol as well through the same X and Y offset. The MoveCmd may be used for moving a node(s) through a specified offset. > >Thanks, >Prakash Surendra >Syncfusion Inc., > >

Administrator [Syncfusion]
Replied On December 7, 2005 11:36 PM

Can you please send a sample code for demonstrating this? Rgds, Vinod >Thank you Prakash! The grouping work great, but i used the movecmd and the NodeMoved event which you suggested and it works great. Thanks again. > >>Hi Tim, >> >>Have you considered grouping the two symbols and the link together so that they function as a single entity? The interactive GroupTool or the GroupCmd can be used for grouping a selection of nodes together. >> >>If grouping will not work, another option would be to handle the Diagram.NodeMoved event, and if you detect one of the symbols being moved, then displace the other symbol as well through the same X and Y offset. The MoveCmd may be used for moving a node(s) through a specified offset. >> >>Thanks, >>Prakash Surendra >>Syncfusion Inc., >> >>

Administrator [Syncfusion]
Replied On December 8, 2005 12:27 AM

I too have two nodes connected using a link. When I select these two custom nodes along with the link, i used the GroupCmd to group all the selected nodes. When I try to move the nodes using the diagram.MoveNodes, the group doesn''t move. But in the same scenario, if I add the two custom nodes alone [And not the connection] into the groupcmd object and then try to move the nodes, the nodes as a group move [without the connection]. I want to move the connection as well. How is it possible ? Rgds, Vinod >Can you please send a sample code for demonstrating this? > >Rgds, > >Vinod > >>Thank you Prakash! The grouping work great, but i used the movecmd and the NodeMoved event which you suggested and it works great. Thanks again. >> >>>Hi Tim, >>> >>>Have you considered grouping the two symbols and the link together so that they function as a single entity? The interactive GroupTool or the GroupCmd can be used for grouping a selection of nodes together. >>> >>>If grouping will not work, another option would be to handle the Diagram.NodeMoved event, and if you detect one of the symbols being moved, then displace the other symbol as well through the same X and Y offset. The MoveCmd may be used for moving a node(s) through a specified offset. >>> >>>Thanks, >>>Prakash Surendra >>>Syncfusion Inc., >>> >>>

Administrator [Syncfusion]
Replied On December 8, 2005 03:09 PM

Hi Vinod, When you are attempting to move a grouping of nodes, you will have to invoke the MoveCmd on the Group object, and not on individual nodes. The Group object is a composite node itself that is made up of the child nodes in the group, and can directly set as the target of a move command. The following code shows the correct way to programmatically group two symbols connected by a link into a group, and move the whole group through an offset. // Sym1, sym2 and lnk represent 2 symbols connected by a link // Use the GroupCmd to create a Group containing the two symbols connected by a link GroupCmd grpcmd = new GroupCmd(); grpcmd.Nodes.Add(sym1); grpcmd.Nodes.Add(sym2); grpcmd.Nodes.Add(lnk); this.diagramComponent.Controller.ExecuteCommand(grpcmd); // Use the MoveCmd to move the Group. The Group can be accessed through the Node.Parent property MoveCmd movcmd = new MoveCmd(50,50); Debug.Assert(sym1.Parent is Group); movcmd.Nodes.Add(sym1.Parent); this.diagramComponent.Controller.ExecuteCommand(movcmd); Hope this helps. Thanks, Prakash Surendra Syncfusion Inc.,

Administrator [Syncfusion]
Replied On December 13, 2005 09:17 AM

Hi Prakash, I did try this out. The links are moving and that''s good news. But there is a small issue as shown below. Consider our CustomSymbol to be something like what is shown below. The (-O) is the place were we have the ports and the links would be connected there. Consider 2 similar symbols and a single link connected between the symbols. Now when I am moving the whole selected list as a Group as discussed in the code, all the nodes including the Symbols move but the links doesn''t get connected thru the (-O). Instead it gets connected to the rectangle part of the Symbol. A CustomSymbol Example |-----------| O-| |-O O-| |-O O-| Custom |-O O-| Symbol |-O |-----------| Awaiting your reply. Regards, Vinod >Hi Vinod, > >When you are attempting to move a grouping of nodes, you will have to invoke the MoveCmd on the Group object, and not on individual nodes. The Group object is a composite node itself that is made up of the child nodes in the group, and can directly set as the target of a move command. The following code shows the correct way to programmatically group two symbols connected by a link into a group, and move the whole group through an offset. > >// Sym1, sym2 and lnk represent 2 symbols connected by a link > >// Use the GroupCmd to create a Group containing the two symbols connected by a link > >GroupCmd grpcmd = new GroupCmd(); >grpcmd.Nodes.Add(sym1); >grpcmd.Nodes.Add(sym2); >grpcmd.Nodes.Add(lnk); >this.diagramComponent.Controller.ExecuteCommand(grpcmd); > >// Use the MoveCmd to move the Group. The Group can be accessed through the Node.Parent property > >MoveCmd movcmd = new MoveCmd(50,50); >Debug.Assert(sym1.Parent is Group); >movcmd.Nodes.Add(sym1.Parent); >this.diagramComponent.Controller.ExecuteCommand(movcmd); > >Hope this helps. > >Thanks, >Prakash Surendra >Syncfusion Inc.,

Administrator [Syncfusion]
Replied On December 13, 2005 03:14 PM

Vinod, Does this happen when you move the symbols or when you perform a copy/paste of the symbols? We are aware of such a proble when copy/pasting linked symbols, but not when moving them. I tested a few scenarios by moving a pair of linked symbols in one of the diagram samples, but was not able to reproduce the condition. If it is indeed the move that is causing the problem, please provide us with a sequence of steps that will let us view the condition. Thanks, Prakash Surendra Syncfusion Inc.,

Administrator [Syncfusion]
Replied On December 15, 2005 09:42 AM

This happens after a copy/paste. After a copy/paste when I move the symbol appears like how i mentioned before. Regards, Vinod >Vinod, > >Does this happen when you move the symbols or when you perform a copy/paste of the symbols? We are aware of such a proble when copy/pasting linked symbols, but not when moving them. I tested a few scenarios by moving a pair of linked symbols in one of the diagram samples, but was not able to reproduce the condition. If it is indeed the move that is causing the problem, please provide us with a sequence of steps that will let us view the condition. > >Thanks, >Prakash Surendra >Syncfusion Inc., > >

Administrator [Syncfusion]
Replied On December 16, 2005 01:45 PM

Hi Vinod, We already have a high priority QA report on the copy/paste issue. We will do our best to fix the problem as soon as possible, and provide a minor update with the fix soon after the 4.0 release. Prakash Surendra Syncfusion Inc.,

Administrator [Syncfusion]
Replied On December 21, 2005 02:20 AM

Hi Prakash, Please see the attached doc to see what I was talking about. Regards, Vinod >Hi Vinod, > >We already have a high priority QA report on the copy/paste issue. We will do our best to fix the problem as soon as possible, and provide a minor update with the fix soon after the 4.0 release. > >Prakash Surendra >Syncfusion Inc., > >

MovingSymbols.zip

Administrator [Syncfusion]
Replied On December 21, 2005 03:15 PM

Hello Vinod, This is interesting. We were not aware of the problem. Thank you for taking the time to put together that detailed description. I have logged a QA report on the issue, and we will do our best to fix the problem for a future release of the product. You can view the details of the QA report, and keep track of it through our web-based tracking system - http://www.syncfusion.com/Support/issues/Default.aspx. Prakash Surendra Syncfusion Inc.,

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.

;