Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » strange problem with getLocation()
strange problem with getLocation() [message #188949] Sun, 24 July 2005 16:32 Go to next message
Eclipse UserFriend
Originally posted by: tankun.web.de

i think it is not a pure GEF-problem.
i have an Arraylist,that has Models.each model has its own location
associability with its Figure.there are three methods in the
models,setLocation() ,getLoation(),setName().when the methods setLocation
and setName() is called,it will notify its Editpart of the model.in the
Editpart is method refreshVisual(),it will get all the actuelly
properties(for example:the location,name..etc) of the model and refresh
figure.

ok now comes the strenge problem:
if i first give a new value of the location of a model with setLocation(),
it will be fired,and its Editpart will refresh the figure with
refreshVisuals().the refreshVisuals() will get all the actuelly values
form its model.
in this case the value of the location,which will be got by the editpart
is right.

but afterwards,
when i change the name of the model with setName(),it will be samely fired
and the Editpart will call the method refreshVisuals() in the same way
just like before.but this time the value of location is no more its own
model,it is from the model which is in the last of the ArrayList!!

can somebody who meets the same problem give me a advice.
thx
Re: strange problem with getLocation() [message #189023 is a reply to message #188949] Mon, 25 July 2005 15:17 Go to previous message
Eclipse UserFriend
Originally posted by: none.unknown.com

You're right, this is not GEF-related. I doubt anybody else is having the
same problem. You don't have your model setup correctly. Use the debugger
to figure out what's going on. Maybe the location is being passed by
reference and hence getting written over or something.

"tan kun" <tankun@web.de> wrote in message
news:63561bebfcfb0ba500e3704a0d60849d$1@www.eclipse.org...
> i think it is not a pure GEF-problem.
> i have an Arraylist,that has Models.each model has its own location
> associability with its Figure.there are three methods in the
> models,setLocation() ,getLoation(),setName().when the methods setLocation
> and setName() is called,it will notify its Editpart of the model.in the
> Editpart is method refreshVisual(),it will get all the actuelly
> properties(for example:the location,name..etc) of the model and refresh
> figure.
>
> ok now comes the strenge problem:
> if i first give a new value of the location of a model with setLocation(),
> it will be fired,and its Editpart will refresh the figure with
> refreshVisuals().the refreshVisuals() will get all the actuelly values
> form its model.
> in this case the value of the location,which will be got by the editpart
> is right.
>
> but afterwards,
> when i change the name of the model with setName(),it will be samely fired
> and the Editpart will call the method refreshVisuals() in the same way
> just like before.but this time the value of location is no more its own
> model,it is from the model which is in the last of the ArrayList!!
>
> can somebody who meets the same problem give me a advice.
> thx
>
>
>
>
Previous Topic:A Dash Line is Possible?
Next Topic:Custom Actions in editors contextmenu?
Goto Forum:
  


Current Time: Tue Dec 03 08:54:58 GMT 2024

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

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

Back to the top