Community
Participate
Working Groups
Build Identifier: M20100909-0800 Hi, Adding properties (IProperty) to PlatformGraphicsAlgorithm is a possibility to parameter the appearance of an implementation of IGraphicsAlgorithmRenderer. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=326733. A nicer approach is to extend the notational metamodel (with EMF) to subclass PlatformGraphicsAlgorithm and to add custom attributes. But there are two limitations at the refresh level: - In DiagramChangeListener, the instructions line 118 to 121 prevent the renderers from being refreshed because the subsclass of PlatformGraphicsAlgorithm is in another package: EPackage p = eo.eClass().getEPackage(); if (!(p instanceof PictogramsPackage || p instanceof AlgorithmsPackage || p instanceof StylesPackage || p instanceof MmPackage)) { continue; } - In PictogramElementDelegate, there is no refresh of the IGraphicsAlgorithmRenderer when the update concerns a PlatformGraphicsAlgorithm. These two minor issues introduce an important limitation. Reproducible: Always Steps to Reproduce: 1. Run the example in attachment (thanks to the org.eclipse.graphiti.examples.common launcher - New > Examples > Graphiti > Graphiti Diagram, "example" diagram type). 2. Create a Rectangle. 3. Move the Rectangle. No refresh. 4. Right click on the Rectangle to display the popup menu. Set Custom Boolean Attribute. Then do not move the cursor. No refresh.
Created attachment 182932 [details] A sample project to highlight the limitation.
The limitation in PictogramElementDelegate is removed by now (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=326733). Removing the check in DiagramChangeListener could induce other issues since this check was introduced also for performance reasons, as far as I recall. Michael
Hi Michael, Would it be possible to make customizable the list of packages the DiagramChangeListener use to filter (with these ones by default)? Thanks a lot, Regards, Romain
Such a customization hook would be possible of course, but this would mean providing another method that can be used to configure something (e.g. in DiagramTypeProvider) and would increase complexity. I had another look onto this and found a probably easier solution: instead of only checking the package of the object itself it would be possible to (additionally if this check is false) check the packages of the super classes of the object to refresh. That makes at least your example work, does it completely solve the issue for you? (Please check the attached patch.) Thanks, Michael
Created attachment 184943 [details] Patch for an alternative solution
I have checked-in my fix (see patch) to have it available for Indigo M4. Just let me know in case there are issues. Michael
Hi Michael, The fix works fine. Thanks a lot, Romain
Updating state for M4
Part of Graphiti Indigo 0.8.0