Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Highlight node if can create link (Read 2819 times)
Jonathan Terrell
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 13
Joined: May 19th, 2015
Highlight node if can create link
Jun 27th, 2015 at 5:08pm
Print Post  
Hi

I am using the LinkCreating event of the DiagramListener to validate the creation of links between nodes. I would like to also highlight a node if a link can be attached to it. I am able to set the background brush of a shape within my custom nodes to show that they would accept the link in the LinkCreating event. However I cannot find a way to clear the brush should the user not choose the node (e.g. simply move over one node on the way to another).

I have tried to trap the nodePointerLeave event of the DiagramListener (I did also set the setTrackPointedItem() to true), but it does not appear to fire.

Any suggestions would be appreciated. If there are other ways of achieving this please let me know. I assume an anchor pattern could be used. However I'm currently using setDynamic(true) for all links and do not have a need for anchors at this time.

All the best, Jonathan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Highlight node if can create link
Reply #1 - Jun 29th, 2015 at 9:11am
Print Post  
Hi,

Set the AllowUnconnectedLinks property to true, and the control will raise linkCreating also when drawing outside of node boundaries. You could save currently highlighted node as field of the Activity class, and reset its brush if you detect a change in linkCreating. You can still prevent unconnected links by calling event.setCancel(true) if the destination node is null.

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


I Love MindFusion!

Posts: 13
Joined: May 19th, 2015
Re: Highlight node if can create link
Reply #2 - Jun 30th, 2015 at 10:18am
Print Post  
Thank you, that did help. In my case I found that the destination node was set equal to DummyNode, rather than null. I also had to invalidate the diagram to get the valid destination node to redraw when the pending link was dragged over it. I tried the node.invalidate() method, but it did not have any effect.

Our evaluation is coming to an end and we are going to purchase the library. During the evaluation you provided us with modified copies of the library to address issues. Should we continue to use this version, or will the changes be incorporated in the production copy we purchase?

Appreciate the assistance, Jonathan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Highlight node if can create link
Reply #3 - Jun 30th, 2015 at 11:23am
Print Post  
The changes we made for you are now included in last official release:
http://mindfusion.eu/Forum/YaBB.pl?num=1432636034

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