Skip to main content



      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 02:34 Go to next message
Eclipse UserFriend
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 03:12 Go to previous messageGo to next message
Eclipse UserFriend
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,
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 03:30 Go to previous message
Eclipse UserFriend
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: Mon Jun 23 11:29:54 EDT 2025

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

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

Back to the top