Getting References to other Models [message #220745] |
Fri, 04 August 2006 01:57 |
Eclipse User |
|
|
|
Originally posted by: dstamkokeng.gmail.com
Hi,
I have extended upon the Shapes example and have a problem saving the
objects created.
There is a list of models(Shapes) stored in the root (ShapesDiagram),
which I assume is the object being serialize for saving.
In one of the model(etc AShape) created, I need to get information of all
the other models (BShape, CShape... etc) which is being created and stored
in the list.
Thus I change the list of models, which is stored in the root to static so
that I can reference the list anywhere in one of my model.
This created problem during saving. None of my models are being saved!! I
understand that it is because now my list of models is static,
serialization does not work for it and thus all the shapes stored in the
list are not being saved.
Is there anyway I can reference the list of models stored in the root,
without making it static?
Can I instantiate the root?
Or is there anyway which I can get a reference to the list (create it
somewhere else so that all my models can call it)?
Help needed!! Stucked....
|
|
|
Powered by
FUDForum. Page generated in 0.02989 seconds