Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 368146

Summary: RuntimeException during SVG export
Product: [Modeling] Graphiti Reporter: Benjamin Schmeling <Benjamin.Schmeling>
Component: CoreAssignee: Michael Wenz <michael.wenz>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: matthias.gorning, michael.wenz
Version: 0.8.0Flags: michael.wenz: indigo+
michael.wenz: juno+
Target Milestone: 0.8.0   
Hardware: All   
OS: All   
Whiteboard: Juno M5 Theme_bugs Indigo SR2
Bug Depends on:    
Bug Blocks: 369241    

Description Benjamin Schmeling CLA 2012-01-09 07:21:40 EST
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)
Comment 1 Michael Wenz CLA 2012-01-11 07:49:06 EST
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?
Comment 2 Benjamin Schmeling CLA 2012-01-11 08:21:28 EST
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);
Comment 3 Michael Wenz CLA 2012-01-17 10:52:16 EST
Reproducable in tutorial with code change from below
Comment 4 Michael Wenz CLA 2012-01-18 07:08:45 EST
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.
Comment 5 Michael Wenz CLA 2012-01-20 09:49:51 EST
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
Comment 6 Michael Wenz CLA 2012-01-20 09:52:27 EST
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
Comment 7 Michael Wenz CLA 2012-04-11 10:51:24 EDT
Bookkeeping: Set target release: 0.8.2
Comment 8 Michael Wenz CLA 2012-06-29 04:18:05 EDT
Part of Graphiti 0.9.0 (Eclipse Juno)