Community
Participate
Working Groups
When exporting graphiti (0.8.1) diagrams as SVG I get the following exception, although I've added the necessary Batik dependencies: java.lang.RuntimeException: The class: class org.eclipse.graphiti.export.batik.GraphicsToGraphics2DAdaptor has not implemented this new graphics function at org.eclipse.draw2d.Graphics.throwNotImplemented(Graphics.java:1218) at org.eclipse.draw2d.Graphics.rotate(Graphics.java:926) at org.eclipse.graphiti.ui.internal.figures.GFAbstractRotatableDecoration.paintShape(GFAbstractRotatableDecoration.java:213) at org.eclipse.graphiti.ui.internal.figures.GFAbstractShape.fillShape(GFAbstractShape.java:522) at org.eclipse.draw2d.Shape.paintFill(Shape.java:195) at org.eclipse.draw2d.Shape.paintFigure(Shape.java:143) at org.eclipse.graphiti.ui.internal.figures.GFAbstractShape.paintFigure(GFAbstractShape.java:509) at org.eclipse.draw2d.Figure.paint(Figure.java:1115) at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1167) at org.eclipse.draw2d.Figure.paintClientArea(Figure.java:1202) at org.eclipse.draw2d.Figure.paint(Figure.java:1117) at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1167) at org.eclipse.draw2d.Figure.paintClientArea(Figure.java:1202) at org.eclipse.draw2d.Figure.paint(Figure.java:1117)
Hm, Graphics.rotate indeed throws hard a not implemented exception. However this appears to be not general issue (an SVG export I just did finished without any errors). I wonder why in your case rotate is called on the Graphics object. What kind of diagram are you trying to export? Is there any rotation inside?
I analyzed this problem in more detail and found out that I got this exception whenever I use an ellipse as an decorator for any type of connection (freeform, manhattan). Other decorators such as polygons or text seem not to cause any problems. Code to reproduce bug: ConnectionDecorator connectionDecorator = pe.createConnectionDecorator(connection, false, 0.5, true); Ellipse e = ga.createEllipse(connectionDecorator);
Reproducable in tutorial with code change from below
I was able to eliminate the RuntimeException. The export works now, but the rotation of the ellipse is still not performed. As it seems the underlying SWTGraphics does not fully execute/implement the functionality.
I have created Bug 369241 to track the issue of the not rotated ellipse during SVG export. The actual exception during the export is fixed, checked-in and pushed to Eclipse: commit e7801ef2bcd27a2b0d7b24e91975f51485a5345a Author: mwenz <michael.wenz@sap.com> 2012-01-20 15:48:57 Committer: mwenz <michael.wenz@sap.com> 2012-01-20 15:48:57 Parent: b155de0780055613b7750f99ef03553abb265439 (Bug 352119: Added test case for showing curved connections) Branches: origin/master, master
The fix is also downported to Graphiti 0.8.2 for Indigo SR2. Checked-in and pushed to Eclipse: commit 334200b820bf2c56fba6a21d70496685ba8d8d82 Author: mwenz <michael.wenz@sap.com> 2012-01-20 15:48:57 Committer: mwenz <michael.wenz@sap.com> 2012-01-20 15:50:47 Parent: fb3d8908e383b122aaa449abc0283203aec92145 (Updated News&Noteworthy for SR2) Branches: origin/b0_8_x, b0_8_x
Bookkeeping: Set target release: 0.8.2
Part of Graphiti 0.9.0 (Eclipse Juno)