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 |
Eclipse User |
|
|
|
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 #150646 is a reply to message #149966] |
Thu, 13 September 2007 10:44 |
Eclipse User |
|
|
|
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 #151591 is a reply to message #151481] |
Wed, 19 September 2007 12:30 |
Eclipse User |
|
|
|
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 #152278 is a reply to message #151481] |
Wed, 26 September 2007 21:35 |
Hallvard Traetteberg 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 |
Guillaume Gauffre 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
>>>
|
|
|
Goto Forum:
Current Time: Sat Nov 09 03:59:27 GMT 2024
Powered by FUDForum. Page generated in 0.04162 seconds
|