Skip to main content



      Home
Home » Eclipse Projects » Sirius » Diagram Coordinates(How to get the coordinates for each diagram element)
Diagram Coordinates [message #1702473] Wed, 22 July 2015 10:34 Go to next message
Eclipse UserFriend
Hi!

I would like to know how can I get the coordinates for each diagram element. I suppose they are stored in the representation file (.aird), but I was wondering what is the best approach to retrieve and process this information. Of course, by doing this I still want to be able to associate the coordinates with the semantic element from the model.

Kind regards
Re: Diagram Coordinates [message #1702476 is a reply to message #1702473] Wed, 22 July 2015 11:20 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

You have the helper
org.eclipse.sirius.diagram.ui.internal.refresh.GMFHelper that provides
services you are looking for. Note that this is used with GMF diagram
element. If in your context you have Sirius diagram elements, you will
need to use
org.eclipse.sirius.diagram.ui.business.api.view.SiriusGMFHelper.getGMFNode(DDiagramElement)
first.

Regards,
Steve

Le 22/07/2015 17:00, Tiago Jorge a écrit :
> Hi!
>
> I would like to know how can I get the coordinates for each diagram
> element. I suppose they are stored in the representation file (.aird),
> but I was wondering what is the best approach to retrieve and process
> this information. Of course, by doing this I still want to be able to
> associate the coordinates with the semantic element from the model.
>
> Kind regards
>


--
Steve Monnier - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Diagram Coordinates [message #1702579 is a reply to message #1702476] Thu, 23 July 2015 07:48 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

Thank you for the quick response.

I went for the Sirius Javadoc, but having some problems in generating it properly and still have to get used to it.
Meanwhile, as far as I can see, in order to retrieve the DDiagramElements in the first place, I imagine I should somehow load the .aird file, get the DView, then the DRepresentation (as DDiagram) and then invoke getOwnedDiagramElements, right?

Cheers
Re: Diagram Coordinates [message #1702595 is a reply to message #1702579] Thu, 23 July 2015 08:54 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

That really depends on the context of the process that need to get the
coordinates. For exemple, if it is a java service that is called at the
execution of a Sirius tool, you already have the DDiagramElement as a
variable. Can you describe what you are doing that requires having
diagram elements coordinates?

Regards,
Steve

Le 23/07/2015 13:48, Tiago Jorge a écrit :
> Hello,
>
> Thank you for the quick response.
>
> I went for the Sirius Javadoc, but having some problems in generating it
> properly and still have to get used to it.
> Meanwhile, as far as I can see, in order to retrieve the
> DDiagramElements in the first place, I imagine I should somehow load the
> .aird file, get the DView, then the DRepresentation (as DDiagram) and
> then invoke getOwnedDiagramElements, right?
>
> Cheers


--
Steve Monnier - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Diagram Coordinates [message #1705672 is a reply to message #1702595] Tue, 18 August 2015 05:16 Go to previous message
Eclipse UserFriend
Hi.

Thank you for your help.

Well, I would like to translate my model into another modeling language. Lets say I want to compile it to another graphical language describing the same system. I know I have the semantic information in one place and the graphical one in the .aird.
What do you think would be the easiest way to translate my model but still carrying around these coordinates?

I am still new to this world so thank you for your patience.

Kind regards.
Previous Topic:How to set icon for a diagram
Next Topic:Non-Movable BorderNode
Goto Forum:
  


Current Time: Wed May 07 10:41:40 EDT 2025

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

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

Back to the top