Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Mixed model types in GEF
Mixed model types in GEF [message #180801] Tue, 10 May 2005 15:33 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:FlowProxy in GEF 3.1M6
Next Topic:Disabled cursor appearing on drag
Goto Forum:
  


Current Time: Sat Feb 04 03:47:30 GMT 2023

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

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

Back to the top