Community
Participate
Working Groups
Build ID: M20090211-1700 Steps To Reproduce: 1. Click on a node tool on the palette. 2. Click on the canvas to create the node. 3. The EditPart for my node extends the AbstractBorderedShapeEditPart. It has a custom BorderItemLocator that always places its border item directly below the node. The border item edit part extends LabelEditPart and the figure is a WrappingLabel. 4) The LabelEditPart does not show up until the region where it is located becomes dirty - usually by clicking where you expect the label to be. 5) Any other node that is dropped on the canvas and is below existing nodes will have the same problem. 6) Any node that is dropped on the canvas and is above existing nodes will not have the problem. More information: I upgraded from GMF 2.1.2 to GMF 2.1.3. I tracked down the change that is causing my problem. The layout() method of the BorderedNodeFigure changed from this: protected void layout() { if (!this.getBounds().equals(getMainFigure().getBounds())) { getMainFigure().setBounds(this.getBounds().getCopy()); } // When parent resizes, cause the border items to be relocated. getBorderItemContainer().invalidateTree(); erase(); } To this: protected void layout() { if (!this.getBounds().equals(getMainFigure().getBounds())) { getMainFigure().setBounds(this.getBounds().getCopy()); getBorderItemContainer().invalidateTree(); erase(); } } Because my main figure is always the same size as my BorderNodeFigure, the invalidateTree() and erase() method were never being called. This caused my border item (which is a WrappingLabel) to not be displayed until the region where the item is located becomes dirty - this can be done by clicking the location where you expect the border item to be.
Looks like this problem was caused by a fix for bug 250018
It is reported that the fix for "BorderedNodeFigure#layout() may cause infinite loop" causes this issue.
This is how repainting works in Draw2D. The region is repainted if it's dirty. So before the repaint of the the bordered node and its contents (icluding border items) were always repainted regardless whether the bounds of the node have changed or not while all other figures are repianted if bounds have changed (or colors opr any other visual attributes). I think the fix for 260018 should stand and instead a fix to border items is required. Can you check whther the patch for bug 264587 fixes your problem? Thanks.
Assigned to myself. I'm 90% sure that it's a dup of 264587.
Yes, looks like a dup of 264587. Confirmed by toggling visibility of border item floating label. *** This bug has been marked as a duplicate of bug 264587 ***
[GMF Restructure] Bug 319140 : product GMF and component Runtime Diagram was the original product and component for this bug