Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 Go to next message
Clever Alves is currently offline Clever AlvesFriend
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 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

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 #1856481 is a reply to message #1856448] Tue, 13 December 2022 05:19 Go to previous messageGo to next message
Clever Alves is currently offline Clever AlvesFriend
Messages: 101
Registered: August 2019
Senior Member
Thank you for the information on #1.

The solution for #2 works fine, thanks again.
Re: Customizing a GMF editor generated by Eugenia [message #1856612 is a reply to message #1856448] Sat, 17 December 2022 12:20 Go to previous messageGo to next message
Clever Alves is currently offline Clever AlvesFriend
Messages: 101
Registered: August 2019
Senior Member
Hi Dimitris,

I'm now trying to set up two different objects (say, Attribute and 2nd_Attribute) inside the same compartment, but I could only manage to put two different objects inside Clazz if each of them is inside its compartment:

@gmf.node(label="name", figure="rectangle")
class Clazz {
attr String name;
@gmf.compartment(layout="list", collapsible="false")
val Attribute[*] attributes;
@gmf.compartment(layout="list", collapsible="false")
val 2nd_Attribute[*] 2nd_attributes;
}

Could you please help me set up two different objects inside a given compartment (i.e., they both share the same compartment)?

Many thanks!

Re: Customizing a GMF editor generated by Eugenia [message #1856630 is a reply to message #1856612] Mon, 19 December 2022 17:54 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

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 #1856654 is a reply to message #1856630] Wed, 21 December 2022 09:03 Go to previous messageGo to next message
Clever Alves is currently offline Clever AlvesFriend
Messages: 101
Registered: August 2019
Senior Member
Hmm...That link does sound like an alternative solution...I'll explore it...Many thanks, Dimitris, and merry Christmas!
Re: Customizing a GMF editor generated by Eugenia [message #1857171 is a reply to message #1856444] Sat, 21 January 2023 03:57 Go to previous messageGo to next message
Clever Alves is currently offline Clever AlvesFriend
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

index.php/fa/42855/0/

but I'd like to automatically rotate it

index.php/fa/42856/0/

Would it be possible? If so, could you please give me a clue on how to change my aforementioned code?

Many thanks!
Re: Customizing a GMF editor generated by Eugenia [message #1857174 is a reply to message #1857171] Sat, 21 January 2023 10:56 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

You'll probably need to modify the ActivityEditPart class in your .diagram project but I can't offer any more specific advice I'm afraid.

Thanks,
Dimitris
Previous Topic:Including pinset dataset into markdown file using picto
Next Topic:Flock Ecore Migration leaving dangling reference
Goto Forum:
  


Current Time: Sat Apr 27 10:53:59 GMT 2024

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

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

Back to the top