Home » Modeling » Epsilon » EWL wizard(classes annotated with '@gmf.link' appear only after reopening diagram)
EWL wizard [message #539121] |
Wed, 09 June 2010 13:09  |
Eclipse User |
|
|
|
Hi,
I created EWL wizards for transforming one metaclass into another and also for factoring out a new object using some attributes of an existing object (then adding a reference to the factored out object).
I also update correctly the 'link' class (annotated with @gmf.link(label="name,multiplicity" etc), but it does not appear right away in the diagram. For it to appear, the diagram needs to be closed and opened again.
Do these links need to be added explicitly to the diagram?
Cheers,
Endre
P.s. References annotated with @gmf.link do appear immediately, as opposed to classes.
|
|
|
Re: EWL wizard [message #539164 is a reply to message #539121] |
Wed, 09 June 2010 15:46   |
Eclipse User |
|
|
|
Hi Endre,
Interesting question, thanks. I've never seen this done before.
I've tried to create a minimal example just now, but it seems to work for me. I did have to ensure that any model elements created in the wizard are contained under the top level element (annotated with @gmf.diagram).
I used the following metamodel:
@namespace(uri="flowchart", prefix="flowchart")
package flowchart;
@gmf.diagram(foo="bar")
class Flowchart {
val Node[*] nodes;
val Transition[*] transitions;
}
@gmf.node(label="name", label.icon="false")
abstract class Node {
attr String name;
ref Transition[*]#source outgoing;
ref Transition[*]#target incoming;
}
@gmf.link(label="name", source="source", target="target", target.decoration="arrow")
class Transition {
attr String name;
ref Node#outgoing source;
ref Node#incoming target;
}
class Subflow extends Flowchart, Node{
}
@gmf.node(figure=
"org.eclipse.epsilon.eugenia.examples.flowchart.diagram.figures.SquareFigure")
class Action extends Node {
}
@gmf.node(figure=
"org.eclipse.epsilon.eugenia.examples.flowchart.diagram.figures.DiamondFigure")
class Decision extends Node {
}
And the following wizard file:
wizard IntroduceAction {
guard : self.isKindOf(Transition)
title : 'Introduce an action'
do {
var action = new Action;
var transition = new Transition;
transition.source = action;
transition.target = self.target;
self.target = action;
Flowchart.all.first.nodes.add(action);
Flowchart.all.first.transitions.add(transition);
}
}
The last two lines add the newly created action and transition to the top level Flowchart. Without these two lines, the elements didn't appear on the diagram.
Does this help at all? If not, would you send me a minimal example of your metamodel and wizard, and I'll investigate further. My email address is louis AT cs DOT york DOT ac DOT uk
Cheers,
Louis.
|
|
|
Re: EWL wizard [message #539197 is a reply to message #539164] |
Wed, 09 June 2010 18:28   |
Eclipse User |
|
|
|
Hi Louis,
Upon trying to recreate the error for you, I stumbled upon the following:
When creating links in the base object (Flowchart, for you model), all links appear as they should be, both link references and link classes.
When creating links inside another container (like a package class or other container), no links appear (neither references nor classes).
When creating links that cross a container boundary (such as the above mentioned package), link references appear immediately, while link classes do not.
Add a container class to your model to reproduce the error; if you don't succeed, I'll send you my own model to work with.
Cheers,
Endre
|
|
| |
Re: EWL wizard [message #539320 is a reply to message #539197] |
Thu, 10 June 2010 08:24   |
Eclipse User |
|
|
|
Hi Endre
Endre Balogh wrote on Wed, 09 June 2010 18:28 | Upon trying to recreate the error for you, I stumbled upon the following:
When creating links in the base object (Flowchart, for you model), all links appear as they should be, both link references and link classes.
When creating links inside another container (like a package class or other container), no links appear (neither references nor classes).
|
Yes, I've been able to recreate this behaviour. The second point seems like a bug to me. Would you open a bug report here:
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=GMT& component=Epsilon
[quote title=Endre Balogh wrote on Wed, 09 June 2010 18:28When creating links that cross a container boundary (such as the above mentioned package), link references appear immediately, while link classes do not.[/quote]
I couldn't recreate this, but I had some problems with my GMF editor after recreating the first faulty behaviour, above.
Thanks for reporting this Endre, and I'm sorry that you've ran into a problem. I'll involve Dimitris in finding a resolution, as he's more familiar with the EWL / GMF code than I am.
Cheers,
Louis.
|
|
| |
Goto Forum:
Current Time: Thu Jul 24 23:13:04 EDT 2025
Powered by FUDForum. Page generated in 0.04721 seconds
|