Export custom figures [message #1737100] |
Tue, 05 July 2016 12:53  |
Eclipse User |
|
|
|
Hi,
I am using Sirius 4.0.
I have defined several custom edit parts, and corresponding Draw2D/GEF figures. When I attempt to export to anything other than JPEG, I get an error (for SVG, for example):
The class org.eclipse.sirius.diagram.ui.tools.internal.render.SiriusGraphicsSVG has not implemented this new graphics function.
In fact, JPEG doesn't even work correctly as my two labels (defined using the Draw2D label and FlowPage figures) are not being displayed.
My question is whether this should be expected or if it is a bug? If expected, is there a mechanism by which I can define export functions for my figures?
|
|
|
Re: Export custom figures [message #1737139 is a reply to message #1737100] |
Wed, 06 July 2016 02:03   |
Eclipse User |
|
|
|
Hi Iain,
Le 05/07/2016 à 18:53, Iain Whiteside a écrit :
> Hi,
>
> I am using Sirius 4.0.
>
> I have defined several custom edit parts, and corresponding Draw2D/GEF
> figures. When I attempt to export to anything other than JPEG, I get an
> error (for SVG, for example):
>
> The class
> org.eclipse.sirius.diagram.ui.tools.internal.render.SiriusGraphicsSVG
> has not implemented this new graphics function.
Do you have the complete error stack ? It might help us to identify the
problem.
>
> In fact, JPEG doesn't even work correctly as my two labels (defined
> using the Draw2D label and FlowPage figures) are not being displayed.
>
> My question is whether this should be expected or if it is a bug? If
> expected, is there a mechanism by which I can define export functions
> for my figures?
I looked in SiriusGraphicsSVG hierarchy and found the following
candidates methods which will throws the same exception:
.. translate(float, float) -> try to use translate(int, int)
.. shear(float, float)
.. setTextAntialias(int)
.. setLineDashOffset(float)
.. setInterpolation(int)
.. setForeGroundPattern(Pattern)
.. scale(foat, float) -> try to use scale(double)
.. rotate(float)
.. getTextAntialias()
.. getLineMiterLimit()
.. getLineCap()
.. getLineJoin()
Note that SiriusGraphicsSVG/SiriusGraphicsToGraphics2DAdaptor have been
copied from
org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.graphics.GraphicsToGraphics2DAdaptor/org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.svg.export.GraphicsSVG
which seems to correct some of those issues.
We might need more clues (the stack will be a good start) to be able to
help you to find which method causes the rpoblem in your case and give
some advices to wrokaround the problem in a first time.
Could you open a Bugzilla [1] to track the issue ?
Regards,
--
Maxime - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
--
[1] https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Sirius
|
|
|
|
|
|
Re: Export custom figures [message #1738587 is a reply to message #1738546] |
Thu, 21 July 2016 03:12  |
Eclipse User |
|
|
|
Hi,
Le 20/07/2016 à 19:50, Iain Whiteside a écrit :
> Hi,
>
> Just checking if the behaviour mentioned in my previous reply is
> intended or a bug? Shall I open a bugzilla?
The behavior you mention is intended : the image generator creates AWT
images.
For your background pattern case, you might look at
org.eclipse.sirius.diagram.ui.tools.api.figure.GradientHelper.setColorsGradation(Graphics,
ViewGradientFigureDesc) which is used by Sirius to handle the gradient
of containers (in
org.eclipse.sirius.diagram.ui.tools.api.figure.GradientRoundedRectangle.fillShape(Graphics)
for example). It will do is the translation from Pattern to
GradientPoint for you, if you have the good type of figure. Otherwise
you will see how we manage and cache it.
>
> Thanks!
>
> Iain
>
>
Regards,
--
Maxime - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.04633 seconds