Page Index Toggle Pages: 1 2 3 [4]  Send TopicPrint
Very Hot Topic (More than 25 Replies) To highlight a composite node/link/label when selected ! (Read 21567 times)
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: To highlight a composite node/link/label when selected !
Reply #45 - Aug 2nd, 2021 at 11:27am
Print Post  
Hi,

When you override a prototype method or as it is the case with drawSquareHandles - a static function - it effectively replaces that method in the library itself and is called in each instance.

In most cases it's easy enough to distinguish which component called the particular method. I wrote as an edit to my previous post (you might have missed it), in the case with drawSquareHandles you can check the context.canvas element (for example if you use different IDs for the canvases), or check for the item's parent - it's the diagram instance where the operation that called the method occurred.

Regards,
Lyubo
MindFusion
  
Back to top
 
IP Logged
 
Kannan Thirumal
Senior Member
****
Offline


I Love Mind Fusion Diagram
:-)

Posts: 270
Location: Bangalore, India
Joined: Jan 18th, 2019
Re: To highlight a composite node/link/label when selected !
Reply #46 - Mar 31st, 2022 at 4:58am
Print Post  
Hi Lyubo,

We have created diagrams using silverlight application. Now I'm loading those diagrams in html/js. The nodes and links are created correctly. But for SOME links, the selection handles are not shown. I've overridden drawHandles like below. When mouse is moved over the links, control is not coming inside this method

DiagramLink.prototype["drawHandles"] = function (context) {
.......
});

I've commented this method and tried. Still selection handles are not showing for those links.

I've added link click event like this,

this.diagram.addEventListener(Event.linkClicked, this.handleLinkClicked);

this.handleLinkClicked = function (sender: any, args: LinkEventArgs) {
............
}

When I click the link, the control is coming to this event.

May I know why for some links, the selection handles are not shown? Any clue?

Regards,
Kannan
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: To highlight a composite node/link/label when selected !
Reply #47 - Mar 31st, 2022 at 6:37am
Print Post  
Hi,

Are you showing the handles through a custom method/behavior or are you using the built-in ModificationStart property set to AutoHandles?

Also, does the below override get called for the links that do show handles?

Kannan Thirumal wrote on Mar 31st, 2022 at 4:58am:
DiagramLink.prototype["drawHandles"] = function (context) {
.......
});


Regards,
Lyubo
  
Back to top
 
IP Logged
 
Kannan Thirumal
Senior Member
****
Offline


I Love Mind Fusion Diagram
:-)

Posts: 270
Location: Bangalore, India
Joined: Jan 18th, 2019
Re: To highlight a composite node/link/label when selected !
Reply #48 - Mar 31st, 2022 at 6:42am
Print Post  
Hi,

1. Yes, I've set like this,

this.diagram.setModificationStart(MindFusion.Diagramming.ModificationStart.AutoH
andles);

But I'm using drawHandles to customize the selection handle's fill etc as suggested by before like this,

https://mindfusion.eu/Forum/YaBB.pl?num=1552647996/19#19

2. Yes, for links showing selection handles, drawHandles override is called when I move the mouse over the link.

Regards,
Kannan
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: To highlight a composite node/link/label when selected !
Reply #49 - Mar 31st, 2022 at 7:16am
Print Post  
Are there any relevant errors shown in the console? You can send us a project with instructions to reproduce the issue, so we can investigate.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 2 3 [4] 
Send TopicPrint