Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [Eugenia] Changing the figure of a node depending of one of its attributes
[Eugenia] Changing the figure of a node depending of one of its attributes [message #997580] Tue, 08 January 2013 12:59 Go to next message
Franck Martin is currently offline Franck MartinFriend
Messages: 2
Registered: January 2013
Junior Member
I would like to change the shape of a node depending of the value of one of its attribute.

For example, if I have a node like this :
//emfatic example
@gmf.node(label="name")
class Node {
  attr String name;
  attr boolean isEllipse;
}


I would like to change the figure of the node depending of the value of isEllipse. If isEllipse is false, the figure will be a rounded rectangle and else an ellipse.

How can I do that without going too much into GMF dark spaces?

Thanks in advance.
Re: [Eugenia] Changing the figure of a node depending of one of its attributes [message #998041 is a reply to message #997580] Wed, 09 January 2013 08:50 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Franck,

I'm not sure if this will work for you, but my typical solution to this kind of problem is to change the metamodel slightly by splitting the type hierarchy to eliminate the boolean attribute:

//emfatic example
@gmf.node(label="name")
abstract class Node {}

class EllipseNode extends Node {
  attr String name;
}

class OtherNode extends Node {
  attr String name;
}


Another option would be to modify the GMF models that Eugenia generates, and then automate this using a polishing transformation (http://www.eclipse.org/epsilon/doc/articles/eugenia-polishing/). If you can determine how to modify the GMF models by hand to achieve what you'd like, do come back to us and we can help debug any issues with your EOL transformation.

Hope that helps!

Cheers,
Louis.
Previous Topic:[EGL] How to access classes from certain package?
Next Topic:[Eugenia] gmf.label for EAttribute
Goto Forum:
  


Current Time: Fri Apr 26 03:44:38 GMT 2024

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

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

Back to the top