Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Ho can I get x and y in layoutConstraint in representations.aird from a session?
Ho can I get x and y in layoutConstraint in representations.aird from a session? [message #1830942] Fri, 07 August 2020 06:34 Go to next message
David Sun is currently offline David SunFriend
Messages: 45
Registered: July 2020
Member
Ho can I get x and y in layoutConstraint of a sematic boject in representations.aird from a session?
Re: Ho can I get x and y in layoutConstraint in representations.aird from a session? [message #1830944 is a reply to message #1830942] Fri, 07 August 2020 07:12 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 702
Registered: July 2009
Senior Member
A given semantic object can have any number of representations inside a session; it can appear on different diagrams (or none), and even on a specific diagram there can be multiple graphical elements which point to the same semantic object.

Assuming you know which specific diagram element you are looking for, the general process is:

* Find all DDiagramElements which point to your target: new org.eclipse.sirius.business.api.query.EObjectQuery(semanticElement).getInverseReferences(ViewpointPackage.Literals.DSEMANTIC_DECORATOR__TARGET)
* Filter the result to find *the* diagram element you are interested in (as mentioned above, there can be 0, 1, or several, including inside a given DDiagram.
* LayoutConstraint is not defined by Sirius, but by GMF, so your need to find the GMF View elements whose view.getElement() points to the diagramElement identified above. Same idea: new org.eclipse.sirius.business.api.query.EObjectQuery(diagramElement).getInverseReferences(NotationPackage.Literals.VIEW__ELEMENT)
* Finally you should obtain a GMF Notation View (in particular a Node), on which you can do node.getLayoutConstraint();

Regards,


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Ho can I get x and y in layoutConstraint in representations.aird from a session? [message #1830945 is a reply to message #1830944] Fri, 07 August 2020 07:30 Go to previous message
David Sun is currently offline David SunFriend
Messages: 45
Registered: July 2020
Member
It worked!
Thank you sooooooooooooo much!
Previous Topic:Modelling an EMF model from memory
Next Topic:How cant I get DSemanticDiagram object by DNodeSpec object?
Goto Forum:
  


Current Time: Tue Apr 16 19:36:13 GMT 2024

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

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

Back to the top