Home » Modeling » Epsilon » Customizing a GMF editor generated by Eugenia
Customizing a GMF editor generated by Eugenia [message #1856444] |
Sat, 10 December 2022 08:53 |
Clever Alves Messages: 101 Registered: August 2019 |
Senior Member |
|
|
Hi there,
At https://www.eclipse.org/epsilon/doc/articles/eugenia-polishing/ we find an example of @gmf.compartment that may receive objects. I'd like to get answers to the following questions, preferably with some clue/code on how to implement, if possible:
1) Would it be possible to have a compartment (Clazz, in the example) with the attributes already inside it? I understand that the example requires the user to drag and drop attribute objects into the compartment, right? I wish I could drag the compartment and, upon dropping it, it comes with the attributes already inside it.
2) In an extension of the example, I can implement transitions from an attribute object outside the compartment to another object (Clazz or another attribute), but I couldn't manage to code a transition from an object outside a compartment to an object inside the compartment: The transition vanishes when I attempt to connect these two objects (one outside and another inside the compartment Clazz). Could you please help with it?
Many thanks!
|
|
|
Re: Customizing a GMF editor generated by Eugenia [message #1856448 is a reply to message #1856444] |
Sat, 10 December 2022 17:26 |
|
Hello,
There is no support for #1 in Eugenia. If this is supported by GMF, you'd need to achieve this by modifying the generated Java code, although my advice would be to consider using Sirius instead of Eugenia/GMF.
Regarding #2, the following seems to be working fine for me.
@namespace(uri="classdiagram", prefix="classdiagram")
package classdiagram;
@gmf.diagram
class Model {
val Clazz[*] classes;
val Sync[*] syncs;
}
@gmf.node(label="name", figure="rectangle")
class Clazz {
attr String name;
@gmf.compartment(layout="list", collapsible="false")
val Attribute[*] attributes;
}
@gmf.node(label="name,type", figure="rectangle",
label.icon="false", label.pattern="{0}:{1}")
class Attribute {
attr String name;
attr String type;
}
@gmf.link(source="from", target="to", label="name")
class Sync {
attr String name;
ref Attribute from;
ref Attribute to;
}
Thanks,
Dimitris
[Updated on: Sat, 10 December 2022 17:26] Report message to a moderator
|
|
| | |
Re: Customizing a GMF editor generated by Eugenia [message #1856630 is a reply to message #1856612] |
Mon, 19 December 2022 17:54 |
|
Hi Clever,
Eugenia doesn't support mapping multiple containment references to the same compartment. For an example of how a compartment can contain objects that are instances of different types, please see the Filesystem metamodel and in particular the Folder.contents compartment, which, in addition to files, can also contain shortcuts and folders (since Folder and Shortcut extend File).
Thanks,
Dimitris
|
|
| |
Re: Customizing a GMF editor generated by Eugenia [message #1857171 is a reply to message #1856444] |
Sat, 21 January 2023 03:57 |
Clever Alves Messages: 101 Registered: August 2019 |
Senior Member |
|
|
Hi Dimitris,
I have this code
@gmf.node(label="name", label.icon="false", figure="rectangle", size="160,40", tool.description="Activity")
class Activity extends C_Node, S_Node {
attr String name;
attr String participants;
attr int order;
@gmf.compartment(layout="free", collapsible="true")
val Start[*] starts;
@gmf.compartment(layout="free", collapsible="true")
val otherStart[*] otherstarts;
@gmf.compartment(layout="free", collapsible="true")
val End[*] ends;
@gmf.compartment(layout="free", collapsible="true")
val otherEnd[*] otherends;
}
which generates
but I'd like to automatically rotate it
Would it be possible? If so, could you please give me a clue on how to change my aforementioned code?
Many thanks!
|
|
| |
Goto Forum:
Current Time: Sat Apr 27 10:53:59 GMT 2024
Powered by FUDForum. Page generated in 0.03278 seconds
|