Skip to main content



      Home
Home » Eclipse Projects » GEF » Combining View model and GEF models?
Combining View model and GEF models? [message #11861] Mon, 01 July 2002 13:34 Go to next message
Eclipse UserFriend
Originally posted by: randy.belknap.epropose.com

I have a TreeViewer based view of data that has its own model objects. Now
I've modified the logicdesigner example to create a more graphical display
of the same data. In the process of working through the example, I created
new model classes for the GEF graphical display.

So now I have two 'Company' classes one that extends TreeObject for the
TreeViewer and another that extends LogicElement (via LogicSubpart, etc) for
the graphical display.

Does it make sense and is it desirable to combine the model classes so that
I end up with one slightly heavier model?

Thanks,

Randy
Re: Combining View model and GEF models? [message #12183 is a reply to message #11861] Mon, 01 July 2002 16:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.ibm.com

This is a tough question to answer even if I understood what you are trying
to do.
I assume you're having trouble with figuring out where to store the location
infomation, since it isn't in your "real" model.

"Randy Belknap" <randy.belknap@epropose.com> wrote in message
news:afq2bv$lsm$1@rogue.oti.com...
> I have a TreeViewer based view of data that has its own model objects.
Now
> I've modified the logicdesigner example to create a more graphical display
> of the same data. In the process of working through the example, I
created
> new model classes for the GEF graphical display.
>
> So now I have two 'Company' classes one that extends TreeObject for the
> TreeViewer and another that extends LogicElement (via LogicSubpart, etc)
for
> the graphical display.
>
> Does it make sense and is it desirable to combine the model classes so
that
> I end up with one slightly heavier model?
>
> Thanks,
>
> Randy
>
>
Re: Combining View model and GEF models? [message #12186 is a reply to message #12183] Mon, 01 July 2002 17:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: randy.belknap.epropose.com

I modified the example so that I'm displaying a bunch of figures
(CompanyFigure) that are created by an edit part (CompanyEditPart) and use a
model object (Company). When I select a figure in the graphical viewer the
Outline view is correctly updated and visa versa.

What I would like to be able to do is attach a property editor to the
graphical viewer in the same way that the Outline view is attached. When I
select a company, I'd like to have its properties displayed and modifiable.
I was thinking I would store these values in the model object as attributes
with getters and setters. In the simplest case, the only property would be
the company name. (I would also use the interface to create a new company
and set its properties via the property viewer.)

I also have a TreeViewer representation of the same underlying data
(companies) and was planning on also hooking a property editor up to the
TreeViewer so that the user can modify the data that way. At the end of the
day I would have two ways for the user to select companies: clicking on the
figure in GEF or on the node in the Tree.


Hudson" <none@ibm.com> wrote in message news:afqb9g$qis$1@rogue.oti.com...

> This is a tough question to answer even if I understood what you are
trying
> to do.
> I assume you're having trouble with figuring out where to store the
location
> infomation, since it isn't in your "real" model.
>
> "Randy Belknap" <randy.belknap@epropose.com> wrote in message
> news:afq2bv$lsm$1@rogue.oti.com...
> > I have a TreeViewer based view of data that has its own model objects.
> Now
> > I've modified the logicdesigner example to create a more graphical
display
> > of the same data. In the process of working through the example, I
> created
> > new model classes for the GEF graphical display.
> >
> > So now I have two 'Company' classes one that extends TreeObject for the
> > TreeViewer and another that extends LogicElement (via LogicSubpart, etc)
> for
> > the graphical display.
> >
> > Does it make sense and is it desirable to combine the model classes so
> that
> > I end up with one slightly heavier model?
> >
> > Thanks,
> >
> > Randy
> >
> >
>
>
Re: Combining View model and GEF models? [message #12194 is a reply to message #12186] Tue, 02 July 2002 07:42 Go to previous messageGo to next message
Eclipse UserFriend
Have your model part implement IPropertySource. This interface is well
documented and last time I looked ( admittedly that was a while ago ) the
GEF logic diagram example uses this interface.

Guy
Re: Combining View model and GEF models? [message #12212 is a reply to message #12183] Wed, 03 July 2002 09:48 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Randy Hudson wrote:

> I assume you're having trouble with figuring out where to store the location
> infomation, since it isn't in your "real" model.

this is exactly the question I have for the moment. I made a plugin for
database model design. I would like to start adding a GEF layer now.
The model I start from is nonvisual, i.e. it is a model for a database
design, which can be presented in a treeview, but it contains no
diagramming information.
I have a toplevel element Database, which contains Tables, which contain
Columns, PrimaryKey and ForeignKey elements.
The diagram should contain a rectangle per Table, and a connection for
each relation. Is it the purpose of editparts to model this diagram layer?
I guess I have to make a toplevel "Diagram" editpart,which contains
"Table" editparts (which contain position and size info) and "relation"
editparts; the diagram editpart is the root editpart. Somehow the
editparts should be linked with model elements

Bram
Re: Combining View model and GEF models? [message #12220 is a reply to message #12212] Wed, 03 July 2002 11:00 Go to previous message
Eclipse UserFriend
Originally posted by: none.ibm.com

This is a common problem and one that is not introduced by GEF.
You should *not* store information in your EditPart. Instead, you need
another object that will store the diagram information.

Here is what we did on a recent project. I created a separate model for the
diagram. This is what Rational Rose and other tools do. A "Diagram"
contained "TableViews", which had references to the database Tables they
were visualizing. TableEditPart would get some information, like position,
from its primary model object, the TableView. Then some information would
come from the Table itself, such as the table name, columns, etc. We also
had RelationshipViews that would reference a relationship between tables.
One benefit of this approach is that things can exist in the model but you
don't have to look at them in the diagram.

You can persist these models together or in separate resources. If
separate, you can have multiple diagrams on the same schema, just like in
Rose.

"Bram Stieperaere" <bram.stieperaere@skynet.be> wrote in message
news:afuvbc$5og$1@rogue.oti.com...
> Hi,
>
> Randy Hudson wrote:
>
> > I assume you're having trouble with figuring out where to store the
location
> > infomation, since it isn't in your "real" model.
>
> this is exactly the question I have for the moment. I made a plugin for
> database model design. I would like to start adding a GEF layer now.
> The model I start from is nonvisual, i.e. it is a model for a database
> design, which can be presented in a treeview, but it contains no
> diagramming information.
> I have a toplevel element Database, which contains Tables, which contain
> Columns, PrimaryKey and ForeignKey elements.
> The diagram should contain a rectangle per Table, and a connection for
> each relation. Is it the purpose of editparts to model this diagram layer?
> I guess I have to make a toplevel "Diagram" editpart,which contains
> "Table" editparts (which contain position and size info) and "relation"
> editparts; the diagram editpart is the root editpart. Somehow the
> editparts should be linked with model elements
>
> Bram
>
Previous Topic:GUI Builder - best approach
Next Topic:Cannot see the connection during creation
Goto Forum:
  


Current Time: Fri May 09 18:17:38 EDT 2025

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

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

Back to the top