|Re: [mdt-papyrus.dev] Diagrams with SVG in latest photon broken|
there are multiple SVG issue which are partly already resolved. I
understand that photon will revert to batik 1.6, but here's the
1. SVGs are not displayed: instead of displaying an SVG, we observe a "println" output that is coming from the DefaultGraphics2D (which is a sample implementation). The reason is that class AbstractGraphicsNode demands a copy in case of clipping (which is always used in case of Papyrus). It uses the following code g2d = (Graphics2D)g2d.create(); The current g2d is the GMF runtime Graphics2DToGraphicsAdaptor. This class should overload the create operation inherited from DefaultGraphics2D. Since it does not, a new DefaultGraphics2D is created instead. The fix is therefore to overload this class. Quentin has already created a patch: https://git.eclipse.org/r/#/c/123759/
2. "File-> Save as image" file fails with an NPE in case of SVG. The reason is that no (batik) ImageWriter (batik.ext-awt) is registered for "image/png". This is due to a missing dependency from batik.util to batik.codec, as proposed in https://bz.apache.org/bugzilla/show_bug.cgi?id=44682 and https://stackoverflow.com/questions/16138850/batik-svggraphics2d-nullpointerexception-when-drawing-image. Batik.util contains a class "Service" which looks up registered services, but does not "see" the batik.codec image writers due to the missing dependency. However, this solution is not possible (at least not on Eclipse level), since batik.codec also depends on batik.util, i.e. would introduce a dependency cycle. A workaround is to register image/png, image/jpeg, ... manually in GMF.
3. Hangs on startup on "non-clean" workspaces. Might be an installation problem on my machine, caused by exception below.
MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.e4.ui.workbench.swt".
java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.apache.batik.dom.AbstractDocument.createEvent(Ljava/lang/String;)Lorg/w3c/dom/events/Event;" the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) of the current class, org/apache/batik/anim/dom/SVGOMDocument, and the class loader (instance of <bootloader>) for interface org/w3c/dom/events/DocumentEvent have different Class objects for the type org/w3c/dom/events/Event used in the signature
Quentin and Ansgar
On 30/05/2018 08:47, Pierre-Charles David wrote:
On 29/05/2018 23:57, RADERMACHER Ansgar wrote:
Back to the top