Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
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 info anyway:


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".
!STACK 0
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
    at org.apache.batik.anim.dom.SVGDOMImplementation.createDocument(SVGDOMImplementation.java:139)
    at org.apache.batik.dom.util.SAXDocumentFactory.startElement(SAXDocumentFactory.java:641)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
...


Best regards

Quentin and Ansgar



On 30/05/2018 08:47, Pierre-Charles David wrote:
On 29/05/2018 23:57, RADERMACHER Ansgar wrote:
Hi,

thanks for the information. I added the update-sites [2] and [3]. Now, the exception does no occur any more in the 2nd instance and I can see the diagrams again. So far, so good. However, shapes are still not displayed

That's strange, on the Sirius side we've had no particular issue with rendering SVG figures. We use some custom code so it's possible it does not trigger the same behavior in terms of loading/wiring OSGi bundles.

Note that there is still at least one issue in the Batik packaging being worked on, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=522740#c102. I don't know if it's related to what you see.

  and a quite bad site-effect: Eclipse does not want to read any repositories any more (related to missing dependency in org.apache.httpcomponents.httpclient?)

Not sure if this is related. Batik itself does not depend on this directly, but it depends on org.apache.xmlgraphics_2.2.0 (which was added to Orbit as part of the Batik 1.9 integration), and from what I see at https://git.eclipse.org/r/c/120909/ there may be a link with https://bugs.eclipse.org/bugs/show_bug.cgi?id=533183 which upgraded  org.apache.httpcomponents.

_______________________________________________
mdt-papyrus.dev mailing list
mdt-papyrus.dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/mdt-papyrus.dev


Back to the top