How to initializing the 'Model' of 'M-V-C' [message #236950] |
Mon, 16 July 2007 13:05 |
Eclipse User |
|
|
|
Originally posted by: hzfalcon.gmail.com
Hello
I'm now working on my little GEF-RCP .
As data source of my program is a pile of XML-files, which have m-to-n
relations among them.
What I don't know how is - how can I use these to initialize the GEF's
Model and make the grapgical editor begin to run ?
I have read the Exsample 'Shape Diagramm Editor' , but in that case..
the user creates a file named 'xxxxx.shapes' , and double-click , then
the GEF-Editor starts..
And in My case , what I need is -- comparing to 'Shape Diagramm Editor'
1. the GEF Editor begins to open itself via other actions - e.g. I click
on a project name in tree viewer / package viewer
2. When the Editor opens itself , there shouldn't be empty and waiting
for painting, but it should read the java objects I prepared , to create
figures.
I hope i've expressed it understandable...
thank you in advance
Pei
|
|
|
Re: How to initializing the 'Model' of 'M-V-C' [message #236963 is a reply to message #236950] |
Mon, 16 July 2007 16:24 |
Anthony Hunter Messages: 446 Registered: July 2009 |
Senior Member |
|
|
Hi Payton,
GEF does not decide how you should read and write your model, it is
completely up to the application.
The shapes diagram is the example to follow.
Opening a file named 'xxxxx.shapes' causes ShapesDiagram.setInput() to be
called which reads in the file (as a steam) into the ShapesDiagram model
object. ShapesDiagram.initializeGraphicalViewer then uses the ShapesDiagram
model object to load the diagram using the ShapesEditPartFactory.
Cheers...
Anthony
"Payton Wuyts" <hzfalcon@gmail.com> wrote in message
news:f7fqea$uj6$1@build.eclipse.org...
> Hello
>
> I'm now working on my little GEF-RCP .
>
> As data source of my program is a pile of XML-files, which have m-to-n
> relations among them.
>
> What I don't know how is - how can I use these to initialize the GEF's
> Model and make the grapgical editor begin to run ?
>
> I have read the Exsample 'Shape Diagramm Editor' , but in that case..
> the user creates a file named 'xxxxx.shapes' , and double-click , then
> the GEF-Editor starts..
> And in My case , what I need is -- comparing to 'Shape Diagramm Editor'
>
> 1. the GEF Editor begins to open itself via other actions - e.g. I click
> on a project name in tree viewer / package viewer
>
> 2. When the Editor opens itself , there shouldn't be empty and waiting for
> painting, but it should read the java objects I prepared , to create
> figures.
>
> I hope i've expressed it understandable...
>
> thank you in advance
>
> Pei
|
|
|
Powered by
FUDForum. Page generated in 0.03232 seconds