Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [Eugenia] Change the color of the links label text [SOLVED]
icon5.gif  [Eugenia] Change the color of the links label text [SOLVED] [message #1716913] Wed, 09 December 2015 02:03 Go to next message
Marcos Alves Vieira is currently offline Marcos Alves VieiraFriend
Messages: 8
Registered: December 2015
Junior Member
Hello, everyone. I'm really new to Eugenia and I may have a silly question Embarrassed

My editor is almost done, and what I'm trying to do right now is simply change the color of the links (@gmf.link) label text, to make they look different from the nodes (@gmf.node) label text (both are black by default). Is it possible to do that through Eugenia annotations or any other way? I couldn't find any annotations in the Tutorial [1] to handle this, just change the color of the nodes border and background, which won't help as that's not the case (and also because I'm using SVG images instead of the regular shapes).

In the attached image you can see that we can easily confuse the links label text with the nodes label text. So I would like to change the links label text color to gray.

The next step in the editor is implementing some EVL rules and I'll probably need you guys to help me again when I get there Very Happy

Kind regards,
Marcos

[1] http://www.eclipse.org/epsilon/doc/articles/eugenia-gmf-tutorial/

[Updated on: Wed, 09 December 2015 22:47]

Report message to a moderator

Re: [Eugenia] Change the color of the links label text [message #1717014 is a reply to message #1716913] Wed, 09 December 2015 15:27 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Marcos,

You will need to write a polishing transformation to achieve this [1].

Cheers,
Dimitris

[1] http://www.eclipse.org/epsilon/doc/articles/eugenia-polishing/

Re: [Eugenia] Change the color of the links label text [message #1717035 is a reply to message #1717014] Wed, 09 December 2015 17:16 Go to previous messageGo to next message
Marcos Alves Vieira is currently offline Marcos Alves VieiraFriend
Messages: 8
Registered: December 2015
Junior Member
Dimitris,

Thanks for your help.

I went through the tutorial you suggested and tried to write an EOL transformation rule to change one of the label's text to italic instead of changing its color, just for testing, as I found an example to do that in another tutorial [1]. So I adapted the code to this one:

-- Add italic font to hasSubFSSLabel
var hasSubFSSLabel = GmfGraph!Label.
	selectOne(r|r.name='HasSubFSSLabelFigure');
hasSubFSSLabel.font = new GmfGraph!BasicFont;
hasSubFSSLabel.font.style = GmfGraph!FontStyle#ITALIC;


However, I'm facing an error while generating the editor. The log file says:

!ENTRY org.eclipse.epsilon.common.dt 4 0 2015-12-09 15:05:47.511
!MESSAGE Called feature font on undefined object
	at (/home/marcos/epsilon-workspace2/ssmm/model/ECore2GMF.eol@4:0-4:45)


Any clue on what's happening? I guess the rule is wrong and can't select the object properly.

[1] https:// epsilonblog. wordpress.com/2009/06/15/eugenia-polishing-your-gmf-editor/

[Updated on: Wed, 09 December 2015 17:21]

Report message to a moderator

Re: [Eugenia] Change the color of the links label text [message #1717037 is a reply to message #1717035] Wed, 09 December 2015 17:21 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Marcos,

That's right. There doesn't seem to be a Label named "HasSubFSSLabelFigure" in your .gmfgraph model. You may want to open your .gmfgraph model with Exeed to see exactly what is in it [1].

Cheers,
Dimitris

[1] https://epsilonblog.wordpress.com/2008/07/17/inspecting-emf-models-with-exeed/
Re: [Eugenia] Change the color of the links label text [message #1717046 is a reply to message #1717037] Wed, 09 December 2015 17:53 Go to previous messageGo to next message
Marcos Alves Vieira is currently offline Marcos Alves VieiraFriend
Messages: 8
Registered: December 2015
Junior Member
I corrected the name of the label to the one I found using Exeed:
index.php/fa/24256/0/

Now the rule is like:
-- Add italic font to hasSubFSSLabel
var hasSubFSSLabel = GmfGraph!Label.
	selectOne(l|l.name='HasSubFSSLabelLabel');
hasSubFSSLabel.font = new GmfGraph!BasicFont;
hasSubFSSLabel.font.style = GmfGraph!FontStyle#ITALIC;


But the problem persists. Same error:
!ENTRY org.eclipse.epsilon.common.dt 4 0 2015-12-09 15:43:32.888
!MESSAGE Called feature font on undefined object
	at (/home/marcos/epsilon-workspace2/ssmm/model/ECore2GMF.eol@4:0-4:45)


Crying or Very Sad
Re: [Eugenia] Change the color of the links label text [message #1717047 is a reply to message #1717046] Wed, 09 December 2015 17:56 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Could you please share a copy of your annotated Emfatic metamodel so that I can investigate?

Cheers,
Dimitris
Re: [Eugenia] Change the color of the links label text [message #1717048 is a reply to message #1717047] Wed, 09 December 2015 17:58 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

... your code should read GmfGraph!Label.all.selectOne(...)

Cheers,
Dimitris
Re: [Eugenia] Change the color of the links label text [message #1717050 is a reply to message #1717047] Wed, 09 December 2015 17:59 Go to previous messageGo to next message
Marcos Alves Vieira is currently offline Marcos Alves VieiraFriend
Messages: 8
Registered: December 2015
Junior Member
Sure I can.

Here it goes!
  • Attachment: ssmm.emf
    (Size: 5.42KB, Downloaded 110 times)
Re: [Eugenia] Change the color of the links label text [message #1717055 is a reply to message #1717050] Wed, 09 December 2015 18:03 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

This was the problem indeed. The following script works fine for me.

-- Add italic font to hasSubFSSLabel
var hasSubFSSLabel = GmfGraph!Label.all.
	selectOne(l|l.name='HasSubFSSLabelLabel');
hasSubFSSLabel.font = new GmfGraph!BasicFont;
hasSubFSSLabel.font.style = GmfGraph!FontStyle#ITALIC;


Cheers,
Dimitris
Re: [Eugenia] Change the color of the links label text [message #1717056 is a reply to message #1717048] Wed, 09 December 2015 18:05 Go to previous message
Marcos Alves Vieira is currently offline Marcos Alves VieiraFriend
Messages: 8
Registered: December 2015
Junior Member
Dimitris,

That was exactly that!

I was following a 2009 tutorial (yours, by the way) and trying to mix it with the new one.

Thank you very much for your help. Now I only have to find a way to change the label text color Very Happy (or maybe leave it just italic)

Dimitris Kolovos wrote on Wed, 09 December 2015 17:58
... your code should read GmfGraph!Label.all.selectOne(...)

Cheers,
Dimitris

Previous Topic:Very basic tutorial about a new project for ETL
Next Topic:EVL: How to synchronize model explorer with the UML diagram editor
Goto Forum:
  


Current Time: Wed Apr 24 23:58:04 GMT 2024

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

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

Back to the top