Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping?
icon5.gif  [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping? [message #512656] Fri, 05 February 2010 20:06 Go to next message
Alvaro Jimenez Rielo is currently offline Alvaro Jimenez RieloFriend
Messages: 41
Registered: July 2009
Location: Rey Juan Carlos Universit...
Member
Hello everyone!

I'm developing a GMF editor using EuGENia (Ecore2GMF.eol) and I need to duplicate some complex NodeMapping (they include compartments, childreferences and labels).

I have already read this post about it: http://www.eclipse.org/forums/index.php?t=msg&th=125673& amp; amp;start=0&

but I have some NodeMappings that are very complex to copy their elements one-by-one,so: Are there another option to duplicate a GmfMap!NodeMapping (or either element)?


Thanks,
Álvaro Jiménez Rielo
Student (Rey Juan Carlos University - Madrid)

[Updated on: Fri, 05 February 2010 20:44]

Report message to a moderator

Re: [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping? [message #512668 is a reply to message #512656] Fri, 05 February 2010 23:04 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Alvaro,

Are you creating these NodeMappings programmatically? If so, you may
want to define an operation for each one of them so that you can call
them multiple times. e.g.

operation createNodeMapping() : GmfMap!NodeMapping {
var nm : new GmfMap!NodeMapping;
...
// Populate the node mapping here
...
return nm;
}

Would that be an option?

Cheers,
Dimitris

ajimenezr wrote:
> Hello everyone!
>
> I'm developing a GMF editor using EuGENia (Ecore2GMF.eol). I need to
> duplicate some complex NodeMapping (they include compartments,
> childreferences and labels).
> I have already read this post about it:
> http://www.eclipse.org/forums/index.php?t=msg&th=125673& amp;start=0&
>
> but I have some NodeMappings that are very complex to copy their
> elements one-by-one,so: Are there another option to duplicate a
> GmfMap!NodeMapping (or either element)?
>
>
> Thanks, Álvaro Jiménez Rielo
> Student (Rey Juan Carlos University - Madrid)
Re: [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping? [message #512672 is a reply to message #512668] Sat, 06 February 2010 00:25 Go to previous messageGo to next message
Alvaro Jimenez Rielo is currently offline Alvaro Jimenez RieloFriend
Messages: 41
Registered: July 2009
Location: Rey Juan Carlos Universit...
Member
Hi Dimitrios,

Could be a great option Very Happy .
Now, I have created programmatically (using EOL) these NodeMappings,
so I will put the code in operations like you say.

Anyway, I think that EOL should allow cloning model elements
because there are a lot of them that it have been created from
Ecore's annotation and not using code. Perhaps in the future?


Thanks,

Álvaro Jiménez Rielo
Student (Rey Juan Carlos University - Madrid)

[Updated on: Sat, 06 February 2010 00:33]

Report message to a moderator

Re: [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping? [message #512681 is a reply to message #512672] Sat, 06 February 2010 03:22 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Alvaro,

I think you're right. I'll put it in my todo list for 0.8.9.

Cheers,
Dimitris

ajimenezr wrote:
> Hi Dimitrios,
>
> Could be a great option :d . Now, I have created programmatically
> (using EOL) these NodeMappings, so I will put the code in operations
> like you say.
>
> Anyway, I think that EOL should allow cloning model elements because
> there are a lot of them that it have been created from Ecore's
> annotation and not using code. Perhaps in the future?
>
>
> Thanks,
> Álvaro Jiménez Rielo
> Student (Rey Juan Carlos University - Madrid)
Re: [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping? [message #512690 is a reply to message #512681] Sat, 06 February 2010 09:59 Go to previous messageGo to next message
Alvaro Jimenez Rielo is currently offline Alvaro Jimenez RieloFriend
Messages: 41
Registered: July 2009
Location: Rey Juan Carlos Universit...
Member
Hi Dimitris,

Yesterday, I didn't see the code and I though that the NodeMappings were created
programmatically, but it's not.
These NodeMappings are created from Ecore
(by "Generate GMF tool, graph and map models" ) and modified programmatically
so I can´t do what you said in the previous post. Sad


Cheers,
Álvaro
Re: [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping? [message #512691 is a reply to message #512690] Sat, 06 February 2010 10:58 Go to previous messageGo to next message
Alvaro Jimenez Rielo is currently offline Alvaro Jimenez RieloFriend
Messages: 41
Registered: July 2009
Location: Rey Juan Carlos Universit...
Member
I have already solved this problem using this operation:

operation createFunctionMapping(option:String):GmfMap!NodeMapping{

var FunctionModel=ECore!EClass.all.selectOne(n|n.name='Function' );
var FunctionMapping;
if(option=='1'){
--get NodeMapping created from Ecore
FunctionMapping = GmfMap!NodeMapping.selectOne(n|n.domainMetaElement.name='Fun ction');
}else{
--create New NodeMapping
}

--Rest of code...

return FunctionMapping;
}

Álvaro

[Updated on: Sat, 06 February 2010 11:00]

Report message to a moderator

Re: [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping? [message #512743 is a reply to message #512691] Sun, 07 February 2010 01:01 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Alvaro,

Great! Thanks for the update.

Cheers,
Dimitris

ajimenezr wrote:
> I have already solved this problem using this operation:
>
> operation createFunctionMapping(option:String):GmfMap!NodeMapping{
>
> var FunctionModel=ECore!EClass.all.selectOne(n|n.name='Function' );
> var FunctionMapping;
> if(option=='1'){
> --get NodeMapping created from Ecore
> FunctionMapping =
> GmfMap!NodeMapping.selectOne(n|n.domainMetaElement.name='Fun ction');
> }else{
> --create New NodeMapping
> }
>
> --Rest of code...
>
> return FunctionMapping;
> }
>
>
Re: [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping? [message #512940 is a reply to message #512681] Mon, 08 February 2010 12:01 Go to previous message
Steffen Zschaler is currently offline Steffen ZschalerFriend
Messages: 266
Registered: July 2009
Senior Member
Hi,

Can't you write a generic clone function that takes two EObjects that
are instances of the same EClass and uses the EClass to traverse all
features and copy their contents from EObject 1 to EObject 2?

Steffen

On 06/02/2010 03:22, Dimitris Kolovos wrote:
> Hi Alvaro,
>
> I think you're right. I'll put it in my todo list for 0.8.9.
>
> Cheers,
> Dimitris
>
> ajimenezr wrote:
>> Hi Dimitrios,
>>
>> Could be a great option :d . Now, I have created programmatically
>> (using EOL) these NodeMappings, so I will put the code in operations
>> like you say.
>>
>> Anyway, I think that EOL should allow cloning model elements because
>> there are a lot of them that it have been created from Ecore's
>> annotation and not using code. Perhaps in the future?
>>
>>
>> Thanks,
>> Álvaro Jiménez Rielo
>> Student (Rey Juan Carlos University - Madrid)
Re: [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping? [message #585768 is a reply to message #512668] Sat, 06 February 2010 00:25 Go to previous message
Alvaro Jimenez Rielo is currently offline Alvaro Jimenez RieloFriend
Messages: 41
Registered: July 2009
Location: Rey Juan Carlos Universit...
Member
Hi Dimitrios,

Could be a great option :d . Now, I have created programmatically (using EOL) these NodeMappings, so I will put the code in operations like you say.

Anyway, I think that EOL should allow cloning model elements because there are a lot of them that it have been created from Ecore's annotation and not using code. Perhaps in the future?


Thanks,

Álvaro Jiménez Rielo
Student (Rey Juan Carlos University - Madrid)
Re: [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping? [message #585779 is a reply to message #585768] Sat, 06 February 2010 03:22 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Alvaro,

I think you're right. I'll put it in my todo list for 0.8.9.

Cheers,
Dimitris

ajimenezr wrote:
> Hi Dimitrios,
>
> Could be a great option :d . Now, I have created programmatically
> (using EOL) these NodeMappings, so I will put the code in operations
> like you say.
>
> Anyway, I think that EOL should allow cloning model elements because
> there are a lot of them that it have been created from Ecore's
> annotation and not using code. Perhaps in the future?
>
>
> Thanks,
> Álvaro Jiménez Rielo
> Student (Rey Juan Carlos University - Madrid)
Re: [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping? [message #585792 is a reply to message #512681] Sat, 06 February 2010 09:59 Go to previous message
Alvaro Jimenez Rielo is currently offline Alvaro Jimenez RieloFriend
Messages: 41
Registered: July 2009
Location: Rey Juan Carlos Universit...
Member
Hi Dimitris,

Yesterday, I didn't see the code and I though that the NodeMappings were created
programmatically, but it's not.
These NodeMappings are created from Ecore
(by "Generate GMF tool, graph and map models" ) and modified programmatically
so I can´t do what you said in the previous post. :(


Cheers,
Álvaro
Re: [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping? [message #585806 is a reply to message #585792] Sat, 06 February 2010 10:59 Go to previous message
Alvaro Jimenez Rielo is currently offline Alvaro Jimenez RieloFriend
Messages: 41
Registered: July 2009
Location: Rey Juan Carlos Universit...
Member
I have already solved this problem using this operation:

operation createFunctionMapping(option:String):GmfMap!NodeMapping{

var FunctionModel=ECore!EClass.all.selectOne(n|n.name='Function' );
var FunctionMapping;
if(option=='1'){
--get NodeMapping created from Ecore
FunctionMapping = GmfMap!NodeMapping.selectOne(n|n.domainMetaElement.name='Fun ction');
}else{
--create New NodeMapping
}

--Rest of code...

return FunctionMapping;
}
Re: [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping? [message #585827 is a reply to message #585806] Sun, 07 February 2010 01:01 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Alvaro,

Great! Thanks for the update.

Cheers,
Dimitris

ajimenezr wrote:
> I have already solved this problem using this operation:
>
> operation createFunctionMapping(option:String):GmfMap!NodeMapping{
>
> var FunctionModel=ECore!EClass.all.selectOne(n|n.name='Function' );
> var FunctionMapping;
> if(option=='1'){
> --get NodeMapping created from Ecore
> FunctionMapping =
> GmfMap!NodeMapping.selectOne(n|n.domainMetaElement.name='Fun ction');
> }else{
> --create New NodeMapping
> }
>
> --Rest of code...
>
> return FunctionMapping;
> }
>
>
Re: [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping? [message #585893 is a reply to message #512681] Mon, 08 February 2010 12:01 Go to previous message
Steffen Zschaler is currently offline Steffen ZschalerFriend
Messages: 266
Registered: July 2009
Senior Member
Hi,

Can't you write a generic clone function that takes two EObjects that
are instances of the same EClass and uses the EClass to traverse all
features and copy their contents from EObject 1 to EObject 2?

Steffen

On 06/02/2010 03:22, Dimitris Kolovos wrote:
> Hi Alvaro,
>
> I think you're right. I'll put it in my todo list for 0.8.9.
>
> Cheers,
> Dimitris
>
> ajimenezr wrote:
>> Hi Dimitrios,
>>
>> Could be a great option :d . Now, I have created programmatically
>> (using EOL) these NodeMappings, so I will put the code in operations
>> like you say.
>>
>> Anyway, I think that EOL should allow cloning model elements because
>> there are a lot of them that it have been created from Ecore's
>> annotation and not using code. Perhaps in the future?
>>
>>
>> Thanks,
>> Álvaro Jiménez Rielo
>> Student (Rey Juan Carlos University - Madrid)
Previous Topic:[EUGENIA] Different types of diagrams like UML2 Tools
Next Topic:problem with creation of phantom nodes
Goto Forum:
  


Current Time: Thu Mar 28 12:08:15 GMT 2024

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

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

Back to the top