Skip to main content



      Home
Home » Eclipse Projects » Sirius » SVG export with semantic data
SVG export with semantic data [message #1734434] Wed, 08 June 2016 07:28 Go to next message
Eclipse UserFriend
Hi,

I'm using Sirius 3.1.4.
I'm trying to understand how I could export a Sirius diagram to SVG with semantic information attached to the SVG nodes.
More precisely, I want to have the name of the semantic elements as attributes of the corresponding SVG nodes:

<g name="semantic name" ...>
...
</g>

Is there a proper way to achieve that or something close to it ?

I've debugged the SVG export down to org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramEdgeEditPart.ViewEdgeFigure.paintFigure(Graphics)
in which the semantic element can be resolved. The corresponding SVG element exists but is not accessible: it's hidden in graphics.graphics.graphics2D.domGroupManager.currentGroup.
So if I manage to override ViewEdgeFigure.paintFigure somehow, I can hack with java reflection but it is far from a "proper" solution.

What would you advise ?
Re: SVG export with semantic data [message #1735113 is a reply to message #1734434] Wed, 15 June 2016 11:29 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

Indeed, adding information in attributes during SVG is not a
functionality handled by Sirius. I do not have a better solution than
yours. You can check the following documentation presenting how to
override EditParts and figure:
https://www.eclipse.org/sirius/doc/developer/extensions-provide_custom_style.html

Regards,
Steve

Le 08/06/2016 à 18:22, Nicolas Beauger a écrit :
> Hi,
>
> I'm using Sirius 3.1.4.
> I'm trying to understand how I could export a Sirius diagram to SVG with
> semantic information attached to the SVG nodes.
> More precisely, I want to have the name of the semantic elements as
> attributes of the corresponding SVG nodes:
>
> <g name="semantic name" ...>
> ..
> </g>
>
> Is there a proper way to achieve that or something close to it ?
>
> I've debugged the SVG export down to
> org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramEdgeEditPart.ViewEdgeFigure.paintFigure(Graphics)
>
> in which the semantic element can be resolved. The corresponding SVG
> element exists but is not accessible: it's hidden in
> graphics.graphics.graphics2D.domGroupManager.currentGroup.
> So if I manage to override ViewEdgeFigure.paintFigure somehow, I can
> hack with java reflection but it is far from a "proper" solution.
>
> What would you advise ?


--
Steve Monnier - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: SVG export with semantic data [message #1735122 is a reply to message #1735113] Wed, 15 June 2016 12:40 Go to previous message
Eclipse UserFriend
OK, thanks for your answer, I'll look into it.
Previous Topic:Resizing many diagram elements without loosing separation between elements
Next Topic:Change the font part of label
Goto Forum:
  


Current Time: Sun Mar 23 20:28:43 EDT 2025

Powered by FUDForum. Page generated in 0.41595 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top