Combining View model and GEF models? [message #11861] |
Mon, 01 July 2002 13:34  |
Eclipse User |
|
|
|
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 #12212 is a reply to message #12183] |
Wed, 03 July 2002 09:48   |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
>
|
|
|
Powered by
FUDForum. Page generated in 0.03873 seconds