Mixed model types in GEF [message #180801] |
Tue, 10 May 2005 15:33 |
Eclipse User |
|
|
|
Originally posted by: freddie_nurke.hotmail.com
Hi folks,
I have two model types in my my application. Most of my graphical stuff
has a base class that allows normal graphical interaction, and some of
my graphical objects contain text. I'm adapting the GEF Text sample
code to create the model for my text, but I don't think it should have
the same base class as the rest of the model -- it behaves differently,
especially in its selection and movement.
getModelChildren should return an object of the same base type as the
parent. Is it possible to have a sub-model on the GEF canvas that
manages itself within the space of an object from the larger model?
Thanks,
Fred
|
|
|
Re: Mixed model types in GEF [message #180808 is a reply to message #180801] |
Tue, 10 May 2005 16:17 |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
Fred Nurke wrote:
> Hi folks,
>
> I have two model types in my my application. Most of my graphical stuff
> has a base class that allows normal graphical interaction, and some of
> my graphical objects contain text. I'm adapting the GEF Text sample
> code to create the model for my text, but I don't think it should have
> the same base class as the rest of the model -- it behaves differently,
> especially in its selection and movement.
>
> getModelChildren should return an object of the same base type as the
> parent. Is it possible to have a sub-model on the GEF canvas that
> manages itself within the space of an object from the larger model?
>
> Thanks,
>
> Fred
each model gets wrapped by an editpart by using your editpart factory of
the editor its being added to. So it does not matter what type of
models you have, so long as you create an appropriate EditPart for each
of them.
You can have children that have children that have children. Nothing
wrong with that. But typically the parent will handle the layout of its
children. And still they are all passed through the edit part factory
of your EditorPart.
CL
|
|
|
Re: Mixed model types in GEF [message #181589 is a reply to message #180808] |
Tue, 17 May 2005 22:40 |
Eclipse User |
|
|
|
Originally posted by: freddie_nurke.hotmail.com
Got it, it works now. I just overrode the Part's getModelChildren method.
Thanks,
Fred
CL [dnoyeb] Gilbert wrote:
> Fred Nurke wrote:
>
>> Hi folks,
>>
>> I have two model types in my my application. Most of my graphical
>> stuff has a base class that allows normal graphical interaction, and
>> some of my graphical objects contain text. I'm adapting the GEF Text
>> sample code to create the model for my text, but I don't think it
>> should have the same base class as the rest of the model -- it behaves
>> differently, especially in its selection and movement.
>>
>> getModelChildren should return an object of the same base type as the
>> parent. Is it possible to have a sub-model on the GEF canvas that
>> manages itself within the space of an object from the larger model?
>>
>> Thanks,
>>
>> Fred
>
>
> each model gets wrapped by an editpart by using your editpart factory of
> the editor its being added to. So it does not matter what type of
> models you have, so long as you create an appropriate EditPart for each
> of them.
>
> You can have children that have children that have children. Nothing
> wrong with that. But typically the parent will handle the layout of its
> children. And still they are all passed through the edit part factory
> of your EditorPart.
>
> CL
|
|
|
Powered by
FUDForum. Page generated in 0.03204 seconds