[Eugenia] Labeling Attributes [message #1038009] |
Wed, 10 April 2013 09:28 |
Claudio Heeg Messages: 75 Registered: April 2013 |
Member |
|
|
Hello,
this might be a simple task, but I'm still getting stuck on it (is there a detailed documentation on Eugenia as a whole around?).
I have an Ecore Model resembling a Domainmodel, i.e. Entities possessing Features of specific Types.
The Features, in this case, only have one attribute for their name and a reference to their type.
So, what I'm trying to do now is visualising this situation as follows:
Rectangled boxes of Entities with their features, written as "Name : Type" listed inside.
However, I can't seem to properly access the type to add it to the Feature's label, as it is not a direct attribute but a reference.
How would I go about solving that problem?
|
|
|
|
Re: [Eugenia] Labeling Attributes [message #1038056 is a reply to message #1038017] |
Wed, 10 April 2013 10:51 |
Claudio Heeg Messages: 75 Registered: April 2013 |
Member |
|
|
Hello Dimitris,
thanks for your precious help.
I had already checked the tutorial and the polishing article, really useful.
In the end I went with option [2] as it seemed easier for me - things seem to work fine for now, but I reckon that, especially in conjunction with Xtext, automatic transformation of things might be necessary.
[Updated on: Wed, 10 April 2013 10:51] Report message to a moderator
|
|
|
|
|
Re: [Eugenia] Labeling Attributes [message #1038702 is a reply to message #1038082] |
Thu, 11 April 2013 07:42 |
Claudio Heeg Messages: 75 Registered: April 2013 |
Member |
|
|
I also now have a question, again related to Eugenia, so I won't open another thread for it:
Attributes have values either of the Type "DataType or "Entity". Now I only want to link to those referring to an entity, while "ignoring" the links on those of DataTypes.
What I tried so far was adding a constraint (of the sort "(Type) self instanceof DataType" as Java) on the link itself, but that does sadly not work so far, maybe I am missing something.
Now a..workaround of sorts would be just plain coloring the links to the DataType in the background color, making them basically invisible. That solution, suffice to say, is not really something I want to try.
Any nudges in the right direction here?
Edit:
Some trial and error made it possible - editing the XXXDiagramUpdater accordingly did the trick.
I'm sure, however, there's got to be a way to work with constraints here.
[Updated on: Thu, 11 April 2013 08:36] Report message to a moderator
|
|
|
|
Re: [Eugenia] Labeling Attributes [message #1044038 is a reply to message #1044030] |
Thu, 18 April 2013 12:16 |
Claudio Heeg Messages: 75 Registered: April 2013 |
Member |
|
|
Hello Daniel,
if you added the expression label appropriately and regenerated the diagram code, in the .diagram.parsers package you should find another new parser next to the Abstract and MessageFormat ones.
There you should find several methods, private String evaluatePrintExpression(EObject self) and the like, in which you can add appropriate Java code to modify your labels.
[Updated on: Thu, 18 April 2013 12:17] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03717 seconds