Bug 110721 - [Connections] Only allow 1 ConnectorHandle to be shown at a time
Summary: [Connections] Only allow 1 ConnectorHandle to be shown at a time
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 minor
Target Milestone: 2.1   Edit
Assignee: Cherie Revells CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2005-09-26 17:11 EDT by Min Idzelis CLA
Modified: 2010-07-19 21:58 EDT (History)
0 users

See Also:


Attachments
ConnectorHandleEditPolicy.patch (4.77 KB, patch)
2005-10-05 21:02 EDT, Min Idzelis CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Min Idzelis CLA 2005-09-26 17:11:41 EDT
If ConnectorHandleEditPolicy.getDisappearanceDelayUponExit returns a high number
(500) and getAppearanceDelay returns a very low number (0) you see a lot of
connector handles show up when you drag the mouse past a list of edit parts that
have this edit policy. I don't see the point of ever having more than one
connector handle to be shown at a time. As soon as a new connector handle is
shown, the previous one should be removed even if its disappearance delay hasn't
run out.
Comment 1 Min Idzelis CLA 2005-10-05 21:02:03 EDT
Created attachment 27919 [details]
ConnectorHandleEditPolicy.patch

Here's my solution to this problem using UIJobs.

Needs string externalization. This was kinda fun to do, since I like hacking
around with Jobs. Feel free to change things around if you'd like... this is
merely a suggestion.
Comment 2 Steven R. Shaw CLA 2005-10-06 14:35:42 EDT
Changing component to "Runtime Diagram"
Comment 3 Anthony Hunter CLA 2007-06-19 11:13:35 EDT
Moving to the next release, GMF 2.1.
Comment 4 Cherie Revells CLA 2008-01-17 15:45:37 EST
I began this fix based on the patch provided by Mindaugas.  However, it needed to be modified somewhat as we now have a base DiagramAssistantEditPolicy class and the ConnectionHandleEditPolicy and PopupBarEditPolicy classes both subclass from this.

I modified the DiagramAssistantEditPolicy so that the delay to add and remove the diagram assistant uses UIJobs instead of a timer.exec() call as suggested by Mindaugas.  This allows me to control the jobs that have already been scheduled.  Now when a diagram assistant is about to be shown, I can find all the diagram assistant hide jobs scheduled (even from other editpolicies on other shapes) and wake them up so they are scheduled immediately, thus resulting in the diagram assistant being hidden.

The result of the code changes made will be that only one diagram assistant of a given type (e.g. connection handle or popup bar) will ever be displayed on the diagram at any one given time.

Mindaugas, I tested this with a 0 appearance delay as I believe you are using and it seems to work fine also, but let me know if you have any problems with it.
Comment 5 Richard Gronback CLA 2008-08-13 13:08:51 EDT
[target cleanup] 2.1 M5 was the original target milestone for this bug
Comment 6 Eclipse Webmaster CLA 2010-07-19 21:58:56 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime was the original product and component for this bug