Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Creation Tools for pre-defined Elements
Creation Tools for pre-defined Elements [message #149444] Thu, 06 September 2007 16:41 Go to next message
Eclipse UserFriend
Originally posted by: prodanov.tk.informatik.tu-darmstadt.de

Hello everyone,

I proceed working wiht GMF and I'm on my next problem. What I want is a
Creation Tools for pre-defined Elements.That means that I have the
properties of the elements and I want the Elements in my Palette to be
created with set properties. I've written all the extra classes and a
CreationFactory as well, but when I set this Factory to the
"CreateUnspecifiedTypeRequest" it does not work. when I don't set this
Factory, it works fine whit the standart elementTypes.I'm pretty sure that
my Factory is well written.
Has anyone any Idea how can I use a custom CreationFactory?

Thanks in advance!

Cheers

Martin
Re: Creation Tools for pre-defined Elements [message #149966 is a reply to message #149444] Tue, 11 September 2007 09:49 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Martin,

> a Creation Tools for pre-defined Elements.That means that I have the
> properties of the elements and I want the Elements in my Palette to be
> created with set properties. I've written all the extra classes and a
Try using Feature Seq Initializer in .gmfmap model - it was designed to solve
this problem.

-----------------
Alex Shatalin
Re: Creation Tools for pre-defined Elements [message #150646 is a reply to message #149966] Thu, 13 September 2007 10:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: prodanov.tk.informatik.tu-darmstadt.de

Thanks for helping Alex,

but the Thing is, that it has to be dinamicly. This means that I have the
properties for an Element on external .ecore file. I read this file and
then decide how many Palette Entries should I create. I.e. we have
"MyElement" and we have a Palette Entry for unspecified "MyElement", but
from the external .ecore file, we read that we have there "MyElement" with
set properties.In this case we can have i.e. 10 different "MyElements"
with different properties and for this 10 "MyElements" we have 10
different Palette Entries. The parsing from the file is already done. I
distinguish every Element and I'm at the point where I have to create
Pelette Entry, which itself has to have a proper Create Tool.So the
problem now is how GMF will work with a Creation Factory which I have
written. My Creation Factory can read the properties and the
getNewObject() Method gives back the Element from the external .ecore whit
set properties. As I have seen GMF passes only "IElementType"s and than
decides which Element should EMF create.

I'll be very thankful if somebody can help me with an advice or something

Cheers!

Martin
Re: Creation Tools for pre-defined Elements [message #151481 is a reply to message #150646] Tue, 18 September 2007 13:51 Go to previous messageGo to next message
Guillaume Gauffre is currently offline Guillaume GauffreFriend
Messages: 65
Registered: July 2009
Member
Hi Martin,

I'm trying to do the same thing I think !?
I want to load/load and replace, some instance of my model by using
predefined instances, saved in a repository
I filled the palette with this repository but I don't find the way to
configure the corresponding tool !
Do you find anything else since your last message ?

Thanks

Guillaume

Martin Prodanov a écrit :
> Thanks for helping Alex,
>
> but the Thing is, that it has to be dinamicly. This means that I have
> the properties for an Element on external .ecore file. I read this file
> and then decide how many Palette Entries should I create. I.e. we have
> "MyElement" and we have a Palette Entry for unspecified "MyElement", but
> from the external .ecore file, we read that we have there "MyElement"
> with set properties.In this case we can have i.e. 10 different
> "MyElements" with different properties and for this 10 "MyElements" we
> have 10 different Palette Entries. The parsing from the file is already
> done. I distinguish every Element and I'm at the point where I have to
> create Pelette Entry, which itself has to have a proper Create Tool.So
> the problem now is how GMF will work with a Creation Factory which I
> have written. My Creation Factory can read the properties and the
> getNewObject() Method gives back the Element from the external .ecore
> whit set properties. As I have seen GMF passes only "IElementType"s and
> than decides which Element should EMF create.
>
> I'll be very thankful if somebody can help me with an advice or something
>
> Cheers!
>
> Martin
>
Re: Creation Tools for pre-defined Elements [message #151591 is a reply to message #151481] Wed, 19 September 2007 12:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: prodanov.tk.informatik.tu-darmstadt.de

Hi Guillaume,

unfortunately I don't have anything else. I post the the story again, but
noone has answered. I think I saw your topic and our tasks have somothing
in common. The thing is that in GEF this is easy, but in GMF is everything
connected with EMF and you can not make changes just so easy on your model.

Cheers

Martin
Re: Creation Tools for pre-defined Elements [message #151863 is a reply to message #151481] Thu, 20 September 2007 14:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: prodanov.tk.informatik.tu-darmstadt.de

Hi Guillaume,

I found something in german. If you understand german check it out.
Here: http://sdqweb.ipd.uni-karlsruhe.de/wiki/GMF

Cheers!

Martin
Re: Creation Tools for pre-defined Elements [message #152278 is a reply to message #151481] Wed, 26 September 2007 21:35 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 673
Registered: July 2009
Location: Trondheim, Norway
Senior Member
I think I have implemented what you describe. I have an external "template"
model file, with "prototype" elements. For each prototype I create a palette
entry (controlled by a custom extension point in plugin.xml), and the
corresponding tool in the palette can then be used to clone the prototype by
dragging out a rectangle or by drag'n dropping it onto the diagram.

I have created custom Command, EditPolicy, EditPolicyProvider, CreationFactory,
CreationToolEntry, PaletteDrawer and PaletteProvider classes, i.e. one class for
almost every role in the main collaborations in GMF/GEF. It would be great to
find a way to contribute this into GMF, as it's a very powerful mechanism. E.g.
since the template model file is a standard file (model+diagram pair), new
prototypes are easily added and existing ones edited.

I can send the code anybody who's interested, but beware that the code is
complex and undocumented.

Hallvard

Guillaume Gauffre wrote:
> Hi Martin,
>
> I'm trying to do the same thing I think !?
> I want to load/load and replace, some instance of my model by using
> predefined instances, saved in a repository
> I filled the palette with this repository but I don't find the way to
> configure the corresponding tool !
> Do you find anything else since your last message ?
>
> Thanks
>
> Guillaume
>
> Martin Prodanov a écrit :
>> Thanks for helping Alex,
>>
>> but the Thing is, that it has to be dinamicly. This means that I have
>> the properties for an Element on external .ecore file. I read this
>> file and then decide how many Palette Entries should I create. I.e. we
>> have "MyElement" and we have a Palette Entry for unspecified
>> "MyElement", but from the external .ecore file, we read that we have
>> there "MyElement" with set properties.In this case we can have i.e. 10
>> different "MyElements" with different properties and for this 10
>> "MyElements" we have 10 different Palette Entries. The parsing from
>> the file is already done. I distinguish every Element and I'm at the
>> point where I have to create Pelette Entry, which itself has to have a
>> proper Create Tool.So the problem now is how GMF will work with a
>> Creation Factory which I have written. My Creation Factory can read
>> the properties and the getNewObject() Method gives back the Element
>> from the external .ecore whit set properties. As I have seen GMF
>> passes only "IElementType"s and than decides which Element should EMF
>> create.
>>
>> I'll be very thankful if somebody can help me with an advice or something
>>
>> Cheers!
>>
>> Martin
>>
Re: Creation Tools for pre-defined Elements [message #152360 is a reply to message #152278] Thu, 27 September 2007 13:26 Go to previous message
Guillaume Gauffre is currently offline Guillaume GauffreFriend
Messages: 65
Registered: July 2009
Member
Hi Hallvard,
thanks for your response.
I'm interesting by looking at your code, can you send it to me ?
And I'm agree with you, it seems to be important to provide the ability
of cloning some model elements into antoher model. In all edition tools,
the reusability is important, if it's not present, users will not use it
anymore if they must recreate same elements each time.
I'm not aware of the way to discuss/request this contribution in GMF,
maybe you are more experimented ...

Guillaume

Hallvard Trætteberg a écrit :
> I think I have implemented what you describe. I have an external
> "template" model file, with "prototype" elements. For each prototype I
> create a palette entry (controlled by a custom extension point in
> plugin.xml), and the corresponding tool in the palette can then be used
> to clone the prototype by dragging out a rectangle or by drag'n dropping
> it onto the diagram.
>
> I have created custom Command, EditPolicy, EditPolicyProvider,
> CreationFactory, CreationToolEntry, PaletteDrawer and PaletteProvider
> classes, i.e. one class for almost every role in the main collaborations
> in GMF/GEF. It would be great to find a way to contribute this into GMF,
> as it's a very powerful mechanism. E.g. since the template model file is
> a standard file (model+diagram pair), new prototypes are easily added
> and existing ones edited.
>
> I can send the code anybody who's interested, but beware that the code
> is complex and undocumented.
>
> Hallvard
>
> Guillaume Gauffre wrote:
>> Hi Martin,
>>
>> I'm trying to do the same thing I think !?
>> I want to load/load and replace, some instance of my model by using
>> predefined instances, saved in a repository
>> I filled the palette with this repository but I don't find the way to
>> configure the corresponding tool !
>> Do you find anything else since your last message ?
>>
>> Thanks
>>
>> Guillaume
>>
>> Martin Prodanov a écrit :
>>> Thanks for helping Alex,
>>>
>>> but the Thing is, that it has to be dinamicly. This means that I have
>>> the properties for an Element on external .ecore file. I read this
>>> file and then decide how many Palette Entries should I create. I.e.
>>> we have "MyElement" and we have a Palette Entry for unspecified
>>> "MyElement", but from the external .ecore file, we read that we have
>>> there "MyElement" with set properties.In this case we can have i.e.
>>> 10 different "MyElements" with different properties and for this 10
>>> "MyElements" we have 10 different Palette Entries. The parsing from
>>> the file is already done. I distinguish every Element and I'm at the
>>> point where I have to create Pelette Entry, which itself has to have
>>> a proper Create Tool.So the problem now is how GMF will work with a
>>> Creation Factory which I have written. My Creation Factory can read
>>> the properties and the getNewObject() Method gives back the Element
>>> from the external .ecore whit set properties. As I have seen GMF
>>> passes only "IElementType"s and than decides which Element should EMF
>>> create.
>>>
>>> I'll be very thankful if somebody can help me with an advice or
>>> something
>>>
>>> Cheers!
>>>
>>> Martin
>>>
Previous Topic:Problem in saving java.util.List in model.
Next Topic:ocl constraint for allowing links only for elements in same container
Goto Forum:
  


Current Time: Sun Sep 01 05:43:48 GMT 2024

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

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

Back to the top