Community
Participate
Working Groups
Build ID: M20090127-1710 Steps To Reproduce: 1)The background color of a port was changed to be green. 2)The port is not being painted on the diagram Seems that the parent's parent's erase function needs to be called in order for the port to properly refresh itself.
we can fix for 2.2 M6, not the maintenance stream.
We have a workaround, so that is fine with us.
The problem is not specific to BorderedNodeFigure but rather to any border item. Since border items are not necessarily instances of BorderedNodeFigure, but could be any figure inside BorderItemContainerFigure. Problem is really conceptual differences between GEF and GMF. GEF assumes that child figures are strictly inside the bounds of the parent while GMF has a concept of ExtendedBounds which includes children and border items. Conceptual differences are reflected in the way GEF paints dirty regions by the Update Manager. BorderItemContainerFigure never has meaningful bounds... bounds of BorderItemContainerFigure don't contain and don't intersect with any of its children... but has valid ExtendedBounds... I'll try to address the problem with fixes to ToggleUpdateManager in GMF and extension hooks in draw2d DeferredUpdateManager.
Created attachment 127348 [details] proposed patch for 2.2 If I fix ToggleUpdateManager to support IExpandableFigure in repairDamage() method, I'd have to cast figures to IExpandableFigure to get exetended bounds, which seems expensive. Therefore, I decided to return a wrapper of the update manager in BorderItemContainerFigure#getUpdateManager(). The wrapper overrides #addDirtyRegion(IFigure, int, int, int, int) method and translates the dirty region of a BorderItemContainerFigure child to the parent of BorderedNodeFigure (equivalent to getParent().getParent() that used be called in repaint and erase), to trigger paint of a BorderedNodeFigure, but not the whole figure, but only its region containing the border item. I also, updated, repint and erase methods - update manger wrapper will do the work these methods used to do themselves. Adam, would you be able to try this patch?
Created attachment 127665 [details] proposed patch cleaned up Cleaned up patch
Hi James, Could you let me know how this patch is working for border item painting issues you've been noticing? Yes, it works ok, could you code review the patch please? Thanks in advance.
(In reply to comment #6) > Hi James, > > Could you let me know how this patch is working for border item painting issues > you've been noticing? > Yes, it works ok, could you code review the patch please? > Thanks in advance. > Hi James, was the patch ok?
My apologies for the late reply ... I'm evaluating the patch now.
The patch looks good. Did you also evaluate performance?
No I didn't evaluate the performance yet. Good thing you mentioned that... I'll check the performance before committing this.
*** Bug 270962 has been marked as a duplicate of this bug. ***
Measured the time to open the diagram with > 400 ports and 400 floating port labels. The time either remain the same or dropped by a second. Without the fix took 10-11 sec. with this fix took 9-10 sec. Committed the fix to head and maintenance.
[target cleanup] 2.2 M7 was the original target milestone for this bug
[GMF Restructure] Bug 319140 : product GMF and component Runtime Diagram was the original product and component for this bug