| Summary: | Refresh issues with IGraphicsAlgorithmRenderer | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] Graphiti | Reporter: | Romain Raugi <romain.raugi> | ||||||
| Component: | Core | Assignee: | Project Inbox <graphiti-inbox> | ||||||
| Status: | CLOSED WORKSFORME | QA Contact: | |||||||
| Severity: | major | ||||||||
| Priority: | P3 | CC: | michael.wenz, romain.raugi | ||||||
| Version: | 0.7.0 | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Romain Raugi
Created attachment 180007 [details]
The tutorial modified to add a IGraphcsAlgorithmRenderer
I was able to reproduce this when more than one of the EEnums are on the screen Created attachment 180025 [details]
Example implementation of an IGraphicsAlgorithmRenderer
It seems as if your renderer does not correctly update the diagram. In certain situations old remains stay on the screen.
Attached is a CanFigure which is an example of an implementation of an IGraphicsAlgorithmRenderer. Using this class as a renderer for the EEnum there are no refresh problems.
Could you have a look into this example to see if that solves this issue? (I'm not the hard-core GEF guy...)
I forgot to mention that in your renderer factory you should check the ID of the passed graphics algorithm:
if ("EEnum".equals(rendererContext.getPlatformGraphicsAlgorithm().getId())) {
PictogramElement pe = rendererContext.getGraphicsAlgorithm().getPictogramElement();
EObject modelObj = (EObject) rendererContext.getMappingProvider().getBusinessObjectForPictogramElement(pe);
if (EcorePackage.eINSTANCE.getEObject().isInstance(modelObj)) {
return new MyRenderer(rendererContext);
}
}
return null;
Hi Michael, The cause of the issue in my renderer is the overridden getBounds() method. In a IGraphicsAlgorithmRenderer, As far as I understand, we should not dynamically compute the bounds according to the GraphicsAlgorithm bounds stored in the notational model. Graphiti is responible of setting the bounds of the renderer. This sample helped me a lot and remove an embarrassing issue. Thanks, Romain Issue solved by providing a sample implementation for a custom renderer No further steps necessary |