Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [Eugenia] Labeling Attributes
[Eugenia] Labeling Attributes [message #1038009] Wed, 10 April 2013 05:28 Go to next message
Claudio Heeg is currently offline 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 #1038017 is a reply to message #1038009] Wed, 10 April 2013 05:45 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 794
Registered: July 2009
Senior Member
Hi Claudio,

Today I'm travelling so unfortunately, I won't have time to have a closer look at this. Some tips for your investigation:

1. Try the label.parser annotation detail in [1]
2. Search for "Expression-backed labels" in [2]
3. If [1] doesn't work and you have to go with [2], you can use a polishing transformation [3] so that any modifications to the GMF Map model can be reproduced the next time your run Eugenia.

All available documentation for Eugenia is under [4] and there are also a few additional examples in the examples/ folder in the SVN.

Cheers,
Dimitris

[1] http://eclipse.org/epsilon/doc/articles/eugenia-gmf-tutorial/
[2] http://wiki.eclipse.org/Graphical_Modeling_Framework/Versions/GMF_2.3
[3] http://eclipse.org/epsilon/doc/articles/eugenia-polishing/
[4] http://eclipse.org/epsilon/doc/articles/#eugenia
Re: [Eugenia] Labeling Attributes [message #1038056 is a reply to message #1038017] Wed, 10 April 2013 06:51 Go to previous messageGo to next message
Claudio Heeg is currently offline 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 06:51]

Report message to a moderator

Re: [Eugenia] Labeling Attributes [message #1038060 is a reply to message #1038056] Wed, 10 April 2013 06:59 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 794
Registered: July 2009
Senior Member
Hi Claudio,

I'm glad this helped! If your workload permits it'd be great if you could put together a minimal example that demonstrates how to do this (a brief description in plain HTML would be fantastic) and share it [1] for the benefit of other people that may come across a similar problem in the future.

Cheers,
Dimitris

[1] To keep track of the IP please submit your example as an attachment to a new bug report: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT.Epsilon
Re: [Eugenia] Labeling Attributes [message #1038082 is a reply to message #1038060] Wed, 10 April 2013 07:30 Go to previous messageGo to next message
Claudio Heeg is currently offline Claudio Heeg
Messages: 75
Registered: April 2013
Member
Hello,

I'd gladly share my solution - the thing is, there's not a lot to share.
I basically just added in an expression-backed label for the Feature-element, generated the diagram code and edited the created dummy class accordingly.
Somehow I don't think this warrants an own guide of sorts, it's pretty trivial once one knows about expression-backed labels.

Should you still feel that something like this would be a big help for others, I'll try to create such a guide, however.
Re: [Eugenia] Labeling Attributes [message #1038702 is a reply to message #1038082] Thu, 11 April 2013 03:42 Go to previous messageGo to next message
Claudio Heeg is currently offline 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 04:36]

Report message to a moderator

Re: [Eugenia] Labeling Attributes [message #1044030 is a reply to message #1038702] Thu, 18 April 2013 08:09 Go to previous messageGo to next message
d 627 is currently offline d 627
Messages: 28
Registered: March 2013
Junior Member
Hi Claudio.

This problem is exactly what I'm trying to fix. I've been practicing with examples of Xtext before to start my project. I used the tutorials of eugenia, specially the Customizing a GMF editor. In theory the labels of the attributes should appears inside the box that I have declared but instead of that there is nothing. Maybe is a mistake with the annotation that I'm trying but I've tried all the possible solution, however nothing seems to work. Can I send you my .ecore model?, or could you please explain me how what did you do?, I looked for the expression-backed labels but I not so sure to understand the guide.
Thanks a lot
Re: [Eugenia] Labeling Attributes [message #1044038 is a reply to message #1044030] Thu, 18 April 2013 08:16 Go to previous message
Claudio Heeg is currently offline 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 08:17]

Report message to a moderator

Previous Topic:on Runtime EWL file don't see EOL file
Next Topic:Integration with XCore
Goto Forum:
  


Current Time: Fri Jul 25 02:53:26 EDT 2014

Powered by FUDForum. Page generated in 0.07657 seconds