|Re: How to display the referenced element of a connection as a label in GMF [message #1721164 is a reply to message #1720303]
||Mon, 25 January 2016 11:39
| Ángel Moreno
Registered: November 2013
In complex cases as it, I usually modify the underlying Java code of the Connection EditPart implied in the problem (in your case, the Transition EClass).
From your Java code you can access to the underliying model and modify the text of the Label associated with the Transition Connection, in base of the info associated with the Expression EObject instances.
To do this task, in your Transition EditPart, inside of your createContents() method or other one method, you can access to your underliying model using this lines of code.
EObject _eobject = ((View) this.getModel()).getElement();
if (_eobject instanceof Transition)
Transition transitionEObject = (Transition) _eobject;
List<Expression> computationsList = transitionEObject.getComputations();
// TO-DO. Modify the code and text of the Label associated with the connection
Maybe, other posible solution it's using the OCL language, to predefine the label text in base of the Transition Expression EObjects, but I can't offer a correct solution in this way.
Researcher @ Kybele Research Group
Rey Juan Carlos University, Madrid, Spain
[Updated on: Mon, 25 January 2016 11:40]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01867 seconds