Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Diagram Coordinates(How to get the coordinates for each diagram element)
Diagram Coordinates [message #1702473] Wed, 22 July 2015 14:34 Go to next message
Tiago Jorge is currently offline Tiago JorgeFriend
Messages: 10
Registered: July 2015
Junior Member
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 15:20 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
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


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Diagram Coordinates [message #1702579 is a reply to message #1702476] Thu, 23 July 2015 11:48 Go to previous messageGo to next message
Tiago Jorge is currently offline Tiago JorgeFriend
Messages: 10
Registered: July 2015
Junior Member
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 12:54 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
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


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Diagram Coordinates [message #1705672 is a reply to message #1702595] Tue, 18 August 2015 09:16 Go to previous message
Tiago Jorge is currently offline Tiago JorgeFriend
Messages: 10
Registered: July 2015
Junior Member
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: Thu Apr 25 10:06:33 GMT 2024

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

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

Back to the top