Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [Eugenia] Sub-labels into nodes and links(How to put sub-labels in nodes and links into GMF, specified in the Emfatic source code.)
[Eugenia] Sub-labels into nodes and links [message #1738973] Tue, 26 July 2016 12:39 Go to next message
Alexandre Honorat is currently offline Alexandre HonoratFriend
Messages: 8
Registered: February 2016
Junior Member
Hi,

I'd like to put some "sub-labels" in nodes and also in links. The online example of Eugenia does that with containment for referenced attributes, but what if the labels you want to show are simply plain attributes of the same node class ? Well, as it might be not very clear, here is an example of what I tried to write in the Emfatic source code:

@gmf.node(label="Name")
class Actor {
  id attr String[1] Name;
  @gmf.label(pattern="WCET: {0}")
  attr int[1] WCET = 1;
}

@gmf.link(source="source", target="target", target.decoration="arrow", width="2")
class Channel {
  id attr String[1] Name;
  @gmf.label(text="<unset>", pattern="Prod: {0}")
  attr String[1] ProdRate;
  @gmf.label(text="<unset>", pattern="Cons: {0}")
  attr String[1] ConsRate;
  ref Actor[1] source;
  ref Actor[1] target;
}


Not surprisingly it is not working for links (I guess a good solution would be to do the same thing as in this example). But for nodes, I don't understand why it's not working (actually, only the WCET value is printed below the "Name" label, not respecting the given pattern) . Is there a problem in my patterns ? Also is it possible to achieve all of that without doing an .eol file ?

Thanks,

Alex H.

[Updated on: Thu, 28 July 2016 09:26]

Report message to a moderator

Re: [Eugenia] Sub-labels into nodes and links [message #1739229 is a reply to message #1738973] Thu, 28 July 2016 14:58 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 476
Registered: January 2010
Senior Member
A quick look at the Eugenia source code confirms that currently @gmf.label on EAttributes is only supported for @gmf.node classes. If this is important to you, feel free to file a feature request and we'll revisit this as soon as possible.

I've tried replacing "pattern" with "label.pattern" (as in the docs [1]) and it works - could you try it?

[1]: https://www.eclipse.org/epsilon/doc/articles/eugenia-gmf-tutorial/
Re: [Eugenia] Sub-labels into nodes and links [message #1739231 is a reply to message #1738973] Thu, 28 July 2016 15:03 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1612
Registered: July 2009
Location: York, UK
Senior Member

Hi Alex,

According to the documentation, @gmf.label(pattern="WCET: {0}") should read @gmf.label(label.pattern="WCET: {0}") instead.

Cheers,
Dimitris
Re: [Eugenia] Sub-labels into nodes and links [message #1739236 is a reply to message #1739231] Thu, 28 July 2016 15:44 Go to previous message
Alexandre Honorat is currently offline Alexandre HonoratFriend
Messages: 8
Registered: February 2016
Junior Member
Hi, thanks it works ! I wrongly believed that as I was already in a label annotation I haven't to write "label" again.

For label in links, it's not important to me; but less is best so if it is possible in the future to avoid the eol file for that, it would be great. So I'll probably post a feature request, with low priority Wink
Cheers,

Alex H.
Previous Topic:XMI to HUTN bridge
Next Topic:Eunit JunitClasses missing in jars?
Goto Forum:
  


Current Time: Fri Nov 16 03:23:53 GMT 2018

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

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

Back to the top