Skip to main content



      Home
Home » Eclipse Projects » GEF » Restore serialized models
Restore serialized models [message #169420] Wed, 23 February 2005 08:59 Go to next message
Eclipse UserFriend
Hi,

I'm hoping that the following problem sounds familiar to someone and I could
get some help,..

My editors do save (serialized to a bytestream) and restore without any
problems, except for one thing: children of container parts are not
restored at all. The container figure itself is there, but its children are
missing.
It seems that they moved out of the container to the absolute coordinate
they originally had within the container. So if a child figure had the
coordinates (10,10) within a figure it now has (10,10) as absolute
coordinate value. And it only seems to be this way, because connections
pointing to those figures now point to empty areas in the editor.

All objects, that are directly children of the actual editor part/model are
restored correctly.

Is this too little information?

What am I doing wrong? Any hints?

Thanks in advance,

Fabian
Re: Restore serialized models [message #169536 is a reply to message #169420] Thu, 24 February 2005 04:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: no.mail.please

Could you send some code to see what's wrong ?

--
Arnaud

Fabian Wolf a écrit :

> Hi,
>
> I'm hoping that the following problem sounds familiar to someone and I could
> get some help,..
>
> My editors do save (serialized to a bytestream) and restore without any
> problems, except for one thing: children of container parts are not
> restored at all. The container figure itself is there, but its children are
> missing.
> It seems that they moved out of the container to the absolute coordinate
> they originally had within the container. So if a child figure had the
> coordinates (10,10) within a figure it now has (10,10) as absolute
> coordinate value. And it only seems to be this way, because connections
> pointing to those figures now point to empty areas in the editor.
>
> All objects, that are directly children of the actual editor part/model are
> restored correctly.
>
> Is this too little information?
>
> What am I doing wrong? Any hints?
>
> Thanks in advance,
>
> Fabian
Re: Restore serialized models [message #169578 is a reply to message #169536] Thu, 24 February 2005 12:16 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

if I only knew which pieces of the code.
Does this sound like a layouting problem, like a problem creating the
EditParts, like a problem with the actual container figure? Its scrollpane?
Something else? You see,... without knowing where these problems arise,
it's hard to fix them. Any idea?
The entire editor has now a little more than 10k lines of code - slightly
too big to post it here :(

Maybe a picture can explain the problem better than I can:
http://www.enstage.de/fabian/BeforeAfter.png

Thank you very much though for being interested!

Fabian

Arnaud wrote:

> Could you send some code to see what's wrong ?
>
> --
> Arnaud
>
> Fabian Wolf a écrit :
>
>> Hi,
>>
>> I'm hoping that the following problem sounds familiar to someone and I
>> could get some help,..
>>
>> My editors do save (serialized to a bytestream) and restore without any
>> problems, except for one thing: children of container parts are not
>> restored at all. The container figure itself is there, but its children
>> are missing.
>> It seems that they moved out of the container to the absolute coordinate
>> they originally had within the container. So if a child figure had the
>> coordinates (10,10) within a figure it now has (10,10) as absolute
>> coordinate value. And it only seems to be this way, because connections
>> pointing to those figures now point to empty areas in the editor.
>>
>> All objects, that are directly children of the actual editor part/model
>> are restored correctly.
>>
>> Is this too little information?
>>
>> What am I doing wrong? Any hints?
>>
>> Thanks in advance,
>>
>> Fabian
Re: Restore serialized models [message #169674 is a reply to message #169578] Fri, 25 February 2005 05:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: no.mail.please

Suggestions :

Do you have a ContentOutline ? If yes, are the children still present
"After" * ?
=> If yes, they've been created successfully but it's just a problem of
positionning, so I would have a look at the setLocation() method of your
child model class, or at any method in the corresponding editpart that
cares about layout and painting : refreshVisuals, layout edit policy, ...

=> if no, I would have a look at everything serializes/deserializes the
component and also have a look at getModelChildren in the container
editpart (but you should have other bugs if it is involved)

Finally, you could go in debug and follow the creation of your model
step by step to see where is the problem.

Another idea : you seem to have a custom contentpane in "system agent"
figure, maybe have a look in this way.

Hope this helps,

--
Arnaud

* if you don't have a ContentOutline implemented, just put some
"System.out.println("Child created " + child.getName())" in the
Constructor of your children model class to check if the children are
serialized or not.
Re: Restore serialized models [message #169713 is a reply to message #169674] Fri, 25 February 2005 10:26 Go to previous message
Eclipse UserFriend
Arnaud wrote:

> => if no, I would have a look at everything serializes/deserializes the
> component and also have a look at getModelChildren in the container
> editpart (but you should have other bugs if it is involved)

Hi Arnaud,

I thank you so much - I feel pretty stupid. The problem was, that I was
implementing getModelChildren() without actually filling it with code,...
only the super()-call which returns an empty List.

Thanks a lot,
Fabian
Previous Topic:connection to go under figure
Next Topic:When is GEF 3.1M5 releasing?
Goto Forum:
  


Current Time: Sun May 11 14:15:48 EDT 2025

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

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

Back to the top