Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » EditPart Refresh Problem
EditPart Refresh Problem [message #170437] Fri, 04 March 2005 13:06 Go to next message
Eclipse UserFriend
Originally posted by: schmunk.upb.de

Hi,

I have an editpart representing a component and a child editpart
representing
the ports of this component. I implemented a function performing a rotation
of
the figure including its children which is working perfectly. But when I now
move
the editpart, the location of the editpart and its childeditparts gets
updated correctly,
but the ports (childeditparts) are drawn at a totally wrong position,
although their
location values are correct. If I now for example try to resize the figure
(resize functionality
is not implemented) the figure including its children gets updated and the
ports are
now at the correct position.

I think there is obviously some kind of refresh problem.

Does anybody have an idea.

Thanks
Sebastian.
Re: EditPart Refresh Problem [message #170750 is a reply to message #170437] Mon, 07 March 2005 08:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: no.mail.please

I encountered strange positionning problems at the start of my gef
editor implementation. As far as I remember, the problems where due to
local/global coordinates (don't remember exactly, sorry).

Another possibility is that you don't get the right bounds in the
refreshVisuals() method of your child editpart. I use this piece of code
at the beginning of each refreshVisuals() :

// notify parent container of changed position & location
// if this line is removed, the XYLayoutManager used by the parent
container
// (the Figure of the ParentEditPart), will not know the bounds of this
figure
// and will not draw it correctly.
Rectangle bounds = new Rectangle(getCastedModel().getLocation(),
getCastedModel().getSize());

where getCastedModel is just a convenient method that returns the model
casted in its right class.

Hope this helps.

--
Arnaud

Sebastian a écrit :

> Hi,
>
> I have an editpart representing a component and a child editpart
> representing
> the ports of this component. I implemented a function performing a rotation
> of
> the figure including its children which is working perfectly. But when I now
> move
> the editpart, the location of the editpart and its childeditparts gets
> updated correctly,
> but the ports (childeditparts) are drawn at a totally wrong position,
> although their
> location values are correct. If I now for example try to resize the figure
> (resize functionality
> is not implemented) the figure including its children gets updated and the
> ports are
> now at the correct position.
>
> I think there is obviously some kind of refresh problem.
>
> Does anybody have an idea.
>
> Thanks
> Sebastian.
>
>
Re: EditPart Refresh Problem [message #170775 is a reply to message #170750] Mon, 07 March 2005 13:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: schmunk.upb.de

Hi,

Thanx for this advise.
I already debug the location coordinates when doing a refresh
and these values are correct, but for some reason the drawing
is just not happening.

Sebastian.

"Arnaud" <no@mail.please> schrieb im Newsbeitrag
news:d0h3d2$b68$1@www.eclipse.org...
>I encountered strange positionning problems at the start of my gef editor
>implementation. As far as I remember, the problems where due to
>local/global coordinates (don't remember exactly, sorry).
>
> Another possibility is that you don't get the right bounds in the
> refreshVisuals() method of your child editpart. I use this piece of code
> at the beginning of each refreshVisuals() :
>
> // notify parent container of changed position & location
> // if this line is removed, the XYLayoutManager used by the parent
> container
> // (the Figure of the ParentEditPart), will not know the bounds of this
> figure
> // and will not draw it correctly.
> Rectangle bounds = new Rectangle(getCastedModel().getLocation(),
> getCastedModel().getSize());
>
> where getCastedModel is just a convenient method that returns the model
> casted in its right class.
>
> Hope this helps.
>
> --
> Arnaud
>
> Sebastian a
Re: EditPart Refresh Problem [message #170814 is a reply to message #170775] Mon, 07 March 2005 15:57 Go to previous messageGo to next message
Jean-Christophe Deprez is currently offline Jean-Christophe DeprezFriend
Messages: 133
Registered: July 2009
Senior Member
I had a similar problem. The symptom is that the edit part moved but not
the connections or the child editparts. I found out that this is becuase I
did the redrawing code in refreshVisual() rather than createFigure(). Once
i fix it, it is OK. Not sure whether this will help you.

Thanks,
Cinly

Sebastian wrote:

> Hi,

> Thanx for this advise.
> I already debug the location coordinates when doing a refresh
> and these values are correct, but for some reason the drawing
> is just not happening.

> Sebastian.

> "Arnaud" <no@mail.please> schrieb im Newsbeitrag
> news:d0h3d2$b68$1@www.eclipse.org...
>>I encountered strange positionning problems at the start of my gef editor
>>implementation. As far as I remember, the problems where due to
>>local/global coordinates (don't remember exactly, sorry).
>>
>> Another possibility is that you don't get the right bounds in the
>> refreshVisuals() method of your child editpart. I use this piece of code
>> at the beginning of each refreshVisuals() :
>>
>> // notify parent container of changed position & location
>> // if this line is removed, the XYLayoutManager used by the parent
>> container
>> // (the Figure of the ParentEditPart), will not know the bounds of this
>> figure
>> // and will not draw it correctly.
>> Rectangle bounds = new Rectangle(getCastedModel().getLocation(),
>> getCastedModel().getSize());
>>
>> where getCastedModel is just a convenient method that returns the model
>> casted in its right class.
>>
>> Hope this helps.
>>
>> --
>> Arnaud
>>
>> Sebastian a écrit :
>>
>>> Hi,
>>>
>>> I have an editpart representing a component and a child editpart
>>> representing
>>> the ports of this component. I implemented a function performing a
>>> rotation of
>>> the figure including its children which is working perfectly. But when I
>>> now move
>>> the editpart, the location of the editpart and its childeditparts gets
>>> updated correctly,
>>> but the ports (childeditparts) are drawn at a totally wrong position,
>>> although their
>>> location values are correct. If I now for example try to resize the
>>> figure (resize functionality
>>> is not implemented) the figure including its children gets updated and
>>> the ports are
>>> now at the correct position.
>>>
>>> I think there is obviously some kind of refresh problem.
>>>
>>> Does anybody have an idea.
>>>
>>> Thanks
>>> Sebastian.
>>>
Re: EditPart Refresh Problem [message #171161 is a reply to message #170814] Wed, 09 March 2005 15:25 Go to previous message
Eclipse UserFriend
Originally posted by: schmunk.upb.de

Ok, i found the solution by myself.
The editpart containing the childeditparts needs to have
a LayoutManager with a XYLayout in its contructor.
Then, everything is working desired.

Seb.

"Sinlee Huang" <nobody@nowhere.com> schrieb im Newsbeitrag
news:d0htks$tu9$1@www.eclipse.org...
>I had a similar problem. The symptom is that the edit part moved but not
>the connections or the child editparts. I found out that this is becuase I
>did the redrawing code in refreshVisual() rather than createFigure(). Once
>i fix it, it is OK. Not sure whether this will help you.
>
> Thanks,
> Cinly
>
> Sebastian wrote:
>
>> Hi,
>
>> Thanx for this advise.
>> I already debug the location coordinates when doing a refresh
>> and these values are correct, but for some reason the drawing
>> is just not happening.
>
>> Sebastian.
>
>> "Arnaud" <no@mail.please> schrieb im Newsbeitrag
>> news:d0h3d2$b68$1@www.eclipse.org...
>>>I encountered strange positionning problems at the start of my gef editor
>>>implementation. As far as I remember, the problems where due to
>>>local/global coordinates (don't remember exactly, sorry).
>>>
>>> Another possibility is that you don't get the right bounds in the
>>> refreshVisuals() method of your child editpart. I use this piece of code
>>> at the beginning of each refreshVisuals() :
>>>
>>> // notify parent container of changed position & location
>>> // if this line is removed, the XYLayoutManager used by the parent
>>> container
>>> // (the Figure of the ParentEditPart), will not know the bounds of this
>>> figure
>>> // and will not draw it correctly.
>>> Rectangle bounds = new Rectangle(getCastedModel().getLocation(),
>>> getCastedModel().getSize());
>>>
>>> where getCastedModel is just a convenient method that returns the model
>>> casted in its right class.
>>>
>>> Hope this helps.
>>>
>>> --
>>> Arnaud
>>>
>>> Sebastian a
Previous Topic:GEF Errors
Next Topic:Embed SWT Composite inside Draw2D Figures
Goto Forum:
  


Current Time: Thu Apr 25 09:29:06 GMT 2024

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

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

Back to the top