Community
Participate
Working Groups
Created attachment 206720 [details] Model to reproduce Hello, I'm currently working on MDT Papyrus modeller and more activity on the Activity Diagram. I have encounter a problem with the following figure: org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx On this figure, if the method containsPoint(int x, int y) is called with x and y which are contained in an external child which is invisible, this methods return true. I think it might not be the wanted implementation because of the following code: In org.eclipse.draw2d.Figure.findMouseEventTargetAt(int, int) ######################################################################### /** * @see IFigure#findFigureAt(int, int, TreeSearch) */ public IFigure findFigureAt(int x, int y, TreeSearch search) { if (!containsPoint(x, y)) return null; if (search.prune(this)) return null; IFigure child = findDescendantAtExcluding(x, y, search); if (child != null) return child; if (search.accept(this)) return this; return null; } ######################################################################### On this code, the first test is to verify that the coordinates are contained in the figure. However in the case of PolylineConnectionEx it also verify if it is contained by one of this child (but it do not verify if this child is visible or not). In the findDescendantAtExcluding(x, y, search) method it will look in which child the coordinates are contained, but this time it will verify that the child is visible. It's kind of not understandable for me because we first verify that it contained in one of this child but after we do not return this child because it not visible. So like to know if it is not simpler to not consider invisible child in the containsPoint methods. So I would like to suggest to change the implementation has follow : ######################################################################### public boolean containsPoint(int x, int y) { .... List children = getChildren(); for (int i = 0; i < children.size(); i++) { //Diff here IFigure childFig = ((IFigure)children.get(i)); //Diff here if (childFig.containsPoint(x, y) && childFig.isVisible()) return true; } .... } ######################################################################### (see attached file) In my functional case I have a Control Flow (UML) which is represented by this figure. It have externals labels which are children of this figure. Those children can be made invisible. However when my mouse is over one of this external label (which is invisible) the Control flow is selected and I have polluting EditPolicy which are using this request on the ControlFlow Edit Part. I will also join a model to reproduce the bug. To do reproduce use the following procedure: 1. right click on the control flow 2. select Filters -> Manage Connector labels 3. Make all label invisible 4. Click on the empty space where the labels where and move the mouse with the right button down 4. The control flow have create a bend point Hoping you will consider those changes, Regards Arthur Daussy
Created attachment 206721 [details] Modified File Sorry this not a patch but I do not have sources from a repository in my workspace
*** Bug 354622 has been marked as a duplicate of this bug. ***
As nobody react on this bug I have decide to try to find another solution: This solution would be to modify only WrappingLabel class as followed: .... @Override public boolean containsPoint(int x, int y) { if (isVisible()){ return super.containsPoint(x, y); } return false; } ...... So this class would consider that a wrappingLabel object do not contain anything if it's not visible.
I am affected by this bug as well. It's particularly annoying when dealing with Papyrus activity diagrams, as some control flows have as many as 4 invisible layers.