Skip to main content



      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 07:59 Go to next message
Eclipse UserFriend
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 03:50 Go to previous message
Eclipse UserFriend
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: Tue Jul 22 18:56:58 EDT 2025

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

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

Back to the top