Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to recognize what objects is dropped on what? (Read 1850 times)
umesh
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Dec 29th, 2011
How to recognize what objects is dropped on what?
Jan 4th, 2012 at 5:48am
Print Post  
we have a situation where we need to associate one object with another. So we need to know what object is dropped on another. Also is there is a way to group objects on the canvas so we can move it together when dragged on the canvas.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to recognize what objects is dropped on what?
Reply #1 - Jan 4th, 2012 at 7:01am
Print Post  
You could call diagram.getNodesAt(args.getMousePosition()) from NodeModifiedScript or NodeCreatedScript handlers. The nodes are returned in reverse Z order, and the result will probably also contain the node just dropped so ignore it when iterating the list.

You can create groups using the DiagramNode.AttachTo() method.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
umesh
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Dec 29th, 2011
Re: How to recognize what objects is dropped on what?
Reply #2 - Jan 4th, 2012 at 11:15am
Print Post  
We are trying Mindfusion NetDiagram library with ASP.Net & VB.Net as the programming language. As per previous reply we need to collect the position of the object using diagram.getNodesAt(args.getMousePosition()) on the client side and update the local variable (hidden variable) and make it available to server side once postback is done.

As AttachTo() is a server side method group can only happen once postback is done.

So user cant drag the related objects together?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to recognize what objects is dropped on what?
Reply #3 - Jan 4th, 2012 at 1:01pm
Print Post  
If you are using JavaApplet mode, there is equivalent DiagramNode.attachTo method defined in the applet. E.g. handle the NodeCreated event and call args.getNode().attachTo(masterNode,  0 /* TopLeft */);

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