|
Re: Export custom figures [message #1737139 is a reply to message #1737100] |
Wed, 06 July 2016 06:03 |
|
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
Maxime Porhel - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Re: Export custom figures [message #1737141 is a reply to message #1737139] |
Wed, 06 July 2016 06:19 |
|
Le 06/07/2016 à 08:03, Maxime Porhel a écrit :
> 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.
I wrongly read getTextAntialias instead of getAntialias(). After a
closer look as the classes we used to copy, they did not change since
our copy, so the problem you encounter would also occur during export of
image ith the default GMF classes.
--
Maxime - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Maxime Porhel - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
|
Re: Export custom figures [message #1738587 is a reply to message #1738546] |
Thu, 21 July 2016 07:12 |
|
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
Maxime Porhel - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.03113 seconds