Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic behavior problem (Read 2037 times)
hans
Junior Member
**
Offline


I Love MindFusion!

Posts: 81
Location: Netherlands
Joined: Mar 17th, 2012
behavior problem
May 5th, 2012 at 10:07am
Print Post  
I want a user to create a new linked node by dragging a new link from an existing node.
The user should still be able to select exsisting nodes by dragging a lasso rectangle.
I use Behavior = Drawlinks
in LinkCreatedScript I make the new node.

But when the user drags the mouse over the diagram, a link is created from the dummy-node
I can supress this in LinkCreatingScript
where I check the origin to match a ShapeNode

But now still a linkarrowpoint is visible when the user drags the mouse, not a lasso.

Is there a solution for this ?
The setting of  Diagram-AllowUnanchoredLinks seems to have no influence
Diagram-AllowUnconnectedLinks="True" is necessary to create the new link and its node.

Why is a arrow drawn from the dummy-node in DrawLinks-behavior?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: behavior problem
Reply #1 - May 7th, 2012 at 8:16am
Print Post  
Quote:
Why is a arrow drawn from the dummy-node in DrawLinks-behavior?


AllowUnconnectedLinks works for both the origin and destination of a link. So in DrawLinks behavior with AllowUnconnectedLinks enabled, you will get an unconnected link drawn even if there's no node under the mouse. You could try to dynamically enable/disable it from some event handlers, e.g.:

Code
Select All
function onLinkCreating(sender, args)
{
	var diagram = <%= diagramView.AppletElement %>.getDiagram();
	diagram.setAllowUnconnectedLinks(true);
}

function onLinkCreated(sender, args)
{
	var diagram = <%= diagramView.AppletElement %>.getDiagram();
	diagram.setAllowUnconnectedLinks(false);
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
hans
Junior Member
**
Offline


I Love MindFusion!

Posts: 81
Location: Netherlands
Joined: Mar 17th, 2012
Re: behavior problem
Reply #2 - May 12th, 2012 at 11:29pm
Print Post  
Thanks,
I couldn't use LinkCreatingScript as it was not fired,
but I could use InitializeLinkScript
Now it works.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint