Home » Modeling » Epsilon » Please Help(Problem with Eugenia)
Please Help [message #1013415] |
Sat, 23 February 2013 10:59  |
Eclipse User |
|
|
|
Dear All,
I have defined multiple sources and targets from and to one node in ecore, and annotated it in emfatic, but when I ran the configuration it only gave me one link. Please see the code below,
@gmf.link(target.decoration="arrow", source="fromc", target="toc", source="fromd", target="tod", source="FromO", target="ToO", incoming="true")
class Refinement extends KLink {
ref Requirement toc;
ref Goal fromc;
ref Goal fromd;
ref Expectation tod;
ref Obstacle[1] FromO;
ref Obstacle[1] ToO;
}
Thanks
Joshua
|
|
|
Re: Please Help [message #1013490 is a reply to message #1013415] |
Sat, 23 February 2013 14:42   |
Eclipse User |
|
|
|
I'm sorry, but that's not how Eugenia works . The @gmf.link annotation will only have the last values for "source" and "target". By specifying them several times, you're only overriding their previous values.
Please remember that there are two ways to create links, as listed in the official docs:
- You can have a link class with one "source" and one "target" attribute, as in:
@gmf.link(source="source", target="target")
class Link {
ref Object source, target;
}
This is pretty much what you were doing in your case. You'll need one link class for each kind of relationship that you want to create.
- Alternatively, you may apply @gmf.link to some of the EReference fields in a regular @gmf.node EClass:
@gmf.node
class Node {
@gmf.link
ref Requirement req;
@gmf.link
ref Goal goal;
@gmf.link
ref Expectation exp;
}
In short: you may have multiple link classes for each kind of relationship, or you may use @gmf.link annotations on some of the reference attributes in your classes. You might want to try this example project:
http://eclipse.org/epsilon/examples/index.php?example=org.eclipse.epsilon.eugenia.examples.friends
[Updated on: Sat, 23 February 2013 14:44] by Moderator
|
|
|
Re: Please Help [message #1013510 is a reply to message #1013490] |
Sat, 23 February 2013 16:08   |
Eclipse User |
|
|
|
Dear Antonio,
Thanks for your help but I tried it, and it worked though it did not completely solve the problem, it creates additional link in the connection palette which does not fit into my project. Let me explain better:
In my ecore.diagram, I have a class called refinement (defined as gmf.link in emfatic) which has multiple sources and targets, e.g. refinement goes, from goal to requirement, from goal to sub-goal, from goal to expectation, from obstacle to obstacle, etc. Thus I need only one link/connector called refinement which can connect, goal to a sub-goal, goal to a requirement, goal to an expectation, obstacle to obstacle, etc.
Secondly, the emfatic file generated from ecore only gives me the E-Classes, how do I make it to show EReference?
|
|
| |
Re: Please Help [message #1013856 is a reply to message #1013831] |
Sun, 24 February 2013 09:15   |
Eclipse User |
|
|
|
Dear Antonio,
This is great, it works, and I am so happy and excited. Thanks very much for your help. I know most of my questions are very basic, I am just new to programming, and GMF.
However, I will need another help from you. I want to use various figures and attributes for each nodes and link. I have been able to use rectangle, ellipse, and rounded (default). I tried couple of others but they are not supported. Please where can I get figures supported by java.lang? I need figures link, parallelogram, rounded rectangle, trapezium, polygon, etc. I came across SVG figures in the Eugenia website, but dont know how to use them. Can I also use customized figures like human, etc.
Thanks for your Help.
Regards
Joshua
|
|
|
Re: Please Help [message #1014379 is a reply to message #1013856] |
Mon, 25 February 2013 12:38   |
Eclipse User |
|
|
|
Dear Joshua,
I'm glad it worked for you .
Indeed, Eugenia supports several custom figure types. For polygons, you can do something like this:
@gmf.node(figure="polygon", polygon.x="10 20 0", polygon.y="0 -10 -10")
class TriangleNode {
// ...
}
For SVG figures, you'll need to install the Experimental GMF SDK feature, place the my.svg SVG file (drawn with Inkscape, for example) into your plugin my.plugin (make sure it's included in your binary builds) and then refer to it like this:
@gmf.node(figure="svg", svg.uri="platform:/plugin/my.plugin/path/to/my.svg)
class NodeWithSVGFigure {
// ...
}
You can also implement your own Java classes for drawing the nodes as well. I suggest you have a look at these example projects:
http://eclipse.org/epsilon/doc/articles/eugenia-nodes-with-images/
http://eclipse.org/epsilon/doc/articles/eugenia-nodes-with-runtime-images/
|
|
| |
Re: Please Help [message #1016061 is a reply to message #1014391] |
Mon, 04 March 2013 13:56  |
Eclipse User |
|
|
|
Dear Antonio,
I am trying to install "GMF Experimental SDK" in my ecllipse, and I did the following: Help->install new software->all available sites->GMF: But I only saw GMF Runtime SDK, and GMF notation SDK. are they the same with GMF Experimental SDK? If No how do I install GMF Experimental SDK?
I also need some help on how to place my.svg SVG file into my.plugin, so that I can refer it as "figure="svg", svg.uri="platform:/plugin/my.plugin/path/to/my.svg". Which steps should I follow to do these?
Regards
Joshua
|
|
|
Goto Forum:
Current Time: Wed Jul 23 14:42:19 EDT 2025
Powered by FUDForum. Page generated in 0.03807 seconds
|