Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Refresh Connection Figures
Refresh Connection Figures [message #137462] Thu, 10 June 2004 09:25 Go to next message
Eclipse UserFriend
Originally posted by: bbdaffy.hotmail.com

Hi,

Need help again... Is my understanding correct to say that connections
actually reside on another layer from the other figures? If so, from my
ContentEditPart, how can I invoke the connection figures to be redrawn?

Somehow when I call refreshChildren() or refreshVisuals() from my
ContentEditPart, my connections will disappear.

Regards,
Lee
Re: Refresh Connection Figures [message #137532 is a reply to message #137462] Thu, 10 June 2004 13:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rlemaigr.ulb.ac.be

Hello Lee,

> Hi,
>
> Need help again... Is my understanding correct to say that connections=

> actually reside on another layer from the other figures?

Yes there is a special layer for the connections figures. I think it is =
=

just on top of the "normal figures" layer (called primary layer in the =

docs) but below the handles layer and the feedback layer. You can find =

informations about the layers in the javadoc of your RootEditPart class.=

Connections have their own layer because it seems logic to display them =
at =

the top of the other figures but also because they are special draw2d =

figures which can not be placed as children of a parent which has a layo=
ut =

manager, like the primary layer usually has, because setBounds() can't b=
e =

called on a connection figure.
I think the connection layer is an instance of the draw2d ConnectionLaye=
r =

class, and thus this layer has a ConnectionRouter you can set which is =

automatically associated to the connections added to the layer.

> If so, from my
> ContentEditPart, how can I invoke the connection figures to be redrawn=
?

I don't really see why you should have to repaint your connection figure=
s. =

If the constraint associated to a connection changes, you should just ca=
ll =

connection.setRoutingConstraint() in the refreshVisual method of the =

connection editpart, and draw2d should handle the rest (the rest =3D =

revalidation and maybe repainting if the revalidation process changes =

smthg) for you. But maybe your case is particular, I don't know.

> Somehow when I call refreshChildren() or refreshVisuals() from my
> ContentEditPart, my connections will disappear.


I don't know why, sorry.

Is your content editpart the one which links the whole model to the whol=
e =

diagram (the background figure of the primary layer) ?
Maybe you have copy/pasted the refreshVisual method of the logic example=
?
In that case, I think you shouldn't call refreshVisual by yourself, =

because it will reset the ConnectionRouter associated to the connection =
=

layer and all the constraints associated to the connections will be lost=
, =

unless you refresh them by calling refreshVisual on all the connection =

editparts (I never did this so maybe this isn't the good way to do it). =
=

But the connections shouldn't totally disappear...
And I don't see why a call to refreshChildren on the content editpart =

makes the connections disappear...

Maybe you could copy/paste the code of the refreshChildren method of the=
=

content editpart and some other parts of your code which could help us t=
o =

understand ?

Or you can wait for a better answer by someone else too (maybe at the ti=
me =

I post this, there is already another answer I didn't see).

r=E9gis
Re: Refresh Connection Figures [message #137668 is a reply to message #137532] Fri, 11 June 2004 01:33 Go to previous message
Eclipse UserFriend
Originally posted by: bbdaffy.hotmail.com

Hi,

Thanks for helping...

Yes, the content EditPart I meant is the one which links the whole model
to the whole diagram. But I did not overwrite any of the refresh methods
here. Maybe the problem doesn't lie with the content EditPart... I will
check my code again. Thanks a lot... :)

Regards,
Lee

rlemaigr@ulb.ac.be wrote:

> Hello Lee,

> > Hi,
> >
> > Need help again... Is my understanding correct to say that connections
> > actually reside on another layer from the other figures?

> Yes there is a special layer for the connections figures. I think it is
> just on top of the "normal figures" layer (called primary layer in the
> docs) but below the handles layer and the feedback layer. You can find
> informations about the layers in the javadoc of your RootEditPart class.
> Connections have their own layer because it seems logic to display them at
> the top of the other figures but also because they are special draw2d
> figures which can not be placed as children of a parent which has a layout
> manager, like the primary layer usually has, because setBounds() can't be
> called on a connection figure.
> I think the connection layer is an instance of the draw2d ConnectionLayer
> class, and thus this layer has a ConnectionRouter you can set which is
> automatically associated to the connections added to the layer.

> > If so, from my
> > ContentEditPart, how can I invoke the connection figures to be redrawn?

> I don't really see why you should have to repaint your connection figures.
> If the constraint associated to a connection changes, you should just call
> connection.setRoutingConstraint() in the refreshVisual method of the
> connection editpart, and draw2d should handle the rest (the rest =
> revalidation and maybe repainting if the revalidation process changes
> smthg) for you. But maybe your case is particular, I don't know.

> > Somehow when I call refreshChildren() or refreshVisuals() from my
> > ContentEditPart, my connections will disappear.


> I don't know why, sorry.

> Is your content editpart the one which links the whole model to the whole
> diagram (the background figure of the primary layer) ?
> Maybe you have copy/pasted the refreshVisual method of the logic example ?
> In that case, I think you shouldn't call refreshVisual by yourself,
> because it will reset the ConnectionRouter associated to the connection
> layer and all the constraints associated to the connections will be lost,
> unless you refresh them by calling refreshVisual on all the connection
> editparts (I never did this so maybe this isn't the good way to do it).
> But the connections shouldn't totally disappear...
> And I don't see why a call to refreshChildren on the content editpart
> makes the connections disappear...

> Maybe you could copy/paste the code of the refreshChildren method of the
> content editpart and some other parts of your code which could help us to
> understand ?

> Or you can wait for a better answer by someone else too (maybe at the time
> I post this, there is already another answer I didn't see).

> régis
Previous Topic:WYSIWYG Editor Howto
Next Topic:Automatic Routing of Connections
Goto Forum:
  


Current Time: Fri Apr 19 06:58:33 GMT 2024

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

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

Back to the top