Skip to main content



      Home
Home » Eclipse Projects » GEF » understanding connection invalidation
understanding connection invalidation [message #81212] Tue, 27 May 2003 17:52 Go to next message
Eclipse UserFriend
I had a scenario that worked, and then I changed it and it doesn't
work

Here is the scenario that worked

Parent object with FlowLayout
Editpart A with FlowLayout
child EditPart B with FlowLayout
children of EditPart B have Connections between them

If I insert a part before A, everything works as expected:
- A moves over on the screen
- B moves over
- children of B move over
- connections in children move over.

Now:

I changed child EditPart B to have a FreeFormLayer and XYLayout (I had
to override FreeFormLayer to use LocalCoordinates) so that the
children can be manually placed.

Now if I insert a part before A, everything but the connections inside
B moves over.

The connectionparts in the first scenario get invalidated and
re-layout but this doesn't happen anymore in B.

How do I force the connections to reLayout in the second case?

thanks
Ray
Re: understanding connection invalidation [message #81241 is a reply to message #81212] Wed, 28 May 2003 00:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Freeform figures cannot be translated or have their bounds set. By
definition, they shrink-wrap their bounds to the smallest Rectangle that
will contain their children (and the point 0,0). Will just a plain figure
in XYLayout work in this case?

Freeform figures are only intended to be placed inside FreeformViewports,
since that is the only way in which they can expand into the negative X and
Y coordinates anyway.

"Ray Tsui" <Raymond_Tsui@ca.ibm.com> wrote in message
news:nvm7dvsd8ngi2p9o7v6kc74uuohiir8udi@4ax.com...
> I had a scenario that worked, and then I changed it and it doesn't
> work
>
> Here is the scenario that worked
>
> Parent object with FlowLayout
> Editpart A with FlowLayout
> child EditPart B with FlowLayout
> children of EditPart B have Connections between them
>
> If I insert a part before A, everything works as expected:
> - A moves over on the screen
> - B moves over
> - children of B move over
> - connections in children move over.
>
> Now:
>
> I changed child EditPart B to have a FreeFormLayer and XYLayout (I had
> to override FreeFormLayer to use LocalCoordinates) so that the
> children can be manually placed.
>
> Now if I insert a part before A, everything but the connections inside
> B moves over.
>
> The connectionparts in the first scenario get invalidated and
> re-layout but this doesn't happen anymore in B.
>
> How do I force the connections to reLayout in the second case?
>
> thanks
> Ray
Re: understanding connection invalidation [message #81268 is a reply to message #81241] Wed, 28 May 2003 01:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You probably can call setBounds(), but the children will not get translated
as a result of doing so. This is by design, since setting the bounds comes
after the children are layed out.

"Randy Hudson" <none@us.ibm.com> wrote in message
news:bb1edb$5ge$1@rogue.oti.com...
> Freeform figures cannot be translated or have their bounds set. By
> definition, they shrink-wrap their bounds to the smallest Rectangle that
> will contain their children (and the point 0,0). Will just a plain figure
> in XYLayout work in this case?
>
> Freeform figures are only intended to be placed inside FreeformViewports,
> since that is the only way in which they can expand into the negative X
and
> Y coordinates anyway.
>
> "Ray Tsui" <Raymond_Tsui@ca.ibm.com> wrote in message
> news:nvm7dvsd8ngi2p9o7v6kc74uuohiir8udi@4ax.com...
> > I had a scenario that worked, and then I changed it and it doesn't
> > work
> >
> > Here is the scenario that worked
> >
> > Parent object with FlowLayout
> > Editpart A with FlowLayout
> > child EditPart B with FlowLayout
> > children of EditPart B have Connections between them
> >
> > If I insert a part before A, everything works as expected:
> > - A moves over on the screen
> > - B moves over
> > - children of B move over
> > - connections in children move over.
> >
> > Now:
> >
> > I changed child EditPart B to have a FreeFormLayer and XYLayout (I had
> > to override FreeFormLayer to use LocalCoordinates) so that the
> > children can be manually placed.
> >
> > Now if I insert a part before A, everything but the connections inside
> > B moves over.
> >
> > The connectionparts in the first scenario get invalidated and
> > re-layout but this doesn't happen anymore in B.
> >
> > How do I force the connections to reLayout in the second case?
> >
> > thanks
> > Ray
>
>
Re: understanding connection invalidation [message #81326 is a reply to message #81268] Wed, 28 May 2003 09:15 Go to previous messageGo to next message
Eclipse UserFriend
It seems to me that the freeformlayer "breaks" the notification chain
by overriding FireMoved(). Normally, it seems that the figures pass on
this notification to allow the connections to lay out themselves, but
I guess since the Freeformlayer is not normally placed inside a
Flowlayout, this was intentional.

I can get it to work by cloning the Freeformlayer class and removing
the override. I don't know if this is a bad approach though.

thanks
Ray



On Wed, 28 May 2003 01:15:45 -0400, "Randy Hudson" <none@us.ibm.com>
wrote:

>You probably can call setBounds(), but the children will not get translated
>as a result of doing so. This is by design, since setting the bounds comes
>after the children are layed out.
>
Re: understanding connection invalidation [message #81355 is a reply to message #81326] Wed, 28 May 2003 10:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

If you are really useing the Freeform layer as intended, then restoring the
notification may cause an infinite loop. Why do you need a FreeFormLayer?
Have you placed it inside a ScrollPane figure?

"Ray Tsui" <Raymond_Tsui@ca.ibm.com> wrote in message
news:jfc9dvgo83a51kajq3du5r59k7t7jmjmq1@4ax.com...
> It seems to me that the freeformlayer "breaks" the notification chain
> by overriding FireMoved(). Normally, it seems that the figures pass on

The FreeformLayer never moves. Only its children move. Firing figure moved
is used in two ways. It may indicate that the figure itself moved. But it
is also used to indicate that the coordinate system in which the children
"live" has changed. AncestorListeners, such as connection anchors, are
interested in whether their source figure, or *any* of its ancestors move or
otherwise change the absolute coordinate of the connection anchor.

> this notification to allow the connections to lay out themselves, but
> I guess since the Freeformlayer is not normally placed inside a
> Flowlayout, this was intentional.
>
> I can get it to work by cloning the Freeformlayer class and removing
> the override. I don't know if this is a bad approach though.
>
> thanks
> Ray
>
>
>
> On Wed, 28 May 2003 01:15:45 -0400, "Randy Hudson" <none@us.ibm.com>
> wrote:
>
> >You probably can call setBounds(), but the children will not get
translated
> >as a result of doing so. This is by design, since setting the bounds
comes
> >after the children are layed out.
> >
>
Re: understanding connection invalidation [message #81410 is a reply to message #81355] Wed, 28 May 2003 10:56 Go to previous messageGo to next message
Eclipse UserFriend
Maybe you can suggest the proper approach?

I have an contaner editpart (I call XYContainer) which contains other
objects with x,y relative coordiantes and connections. This container
can be inside other editparts with FlowLayouts or itself be contained
inside XYContainer.

What kind of figure and layout would you suggest I use? The
XYContainer should automatically grow to enclose all its XY children,
but move all its contents automatically when its parent FlowLayout
causes it to move.

Ray

On Wed, 28 May 2003 10:32:57 -0400, "Randy Hudson" <none@us.ibm.com>
wrote:

>If you are really useing the Freeform layer as intended, then restoring the
>notification may cause an infinite loop. Why do you need a FreeFormLayer?
>Have you placed it inside a ScrollPane figure?
>
>"Ray Tsui" <Raymond_Tsui@ca.ibm.com> wrote in message
>news:jfc9dvgo83a51kajq3du5r59k7t7jmjmq1@4ax.com...
>> It seems to me that the freeformlayer "breaks" the notification chain
>> by overriding FireMoved(). Normally, it seems that the figures pass on
>
>The FreeformLayer never moves. Only its children move. Firing figure moved
>is used in two ways. It may indicate that the figure itself moved. But it
>is also used to indicate that the coordinate system in which the children
>"live" has changed. AncestorListeners, such as connection anchors, are
>interested in whether their source figure, or *any* of its ancestors move or
>otherwise change the absolute coordinate of the connection anchor.
>
>> this notification to allow the connections to lay out themselves, but
>> I guess since the Freeformlayer is not normally placed inside a
>> Flowlayout, this was intentional.
>>
>> I can get it to work by cloning the Freeformlayer class and removing
>> the override. I don't know if this is a bad approach though.
>>
>> thanks
>> Ray
>>
>>
>>
>> On Wed, 28 May 2003 01:15:45 -0400, "Randy Hudson" <none@us.ibm.com>
>> wrote:
>>
>> >You probably can call setBounds(), but the children will not get
>translated
>> >as a result of doing so. This is by design, since setting the bounds
>comes
>> >after the children are layed out.
>> >
>>
>
Re: understanding connection invalidation [message #81439 is a reply to message #81410] Wed, 28 May 2003 14:56 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

"Ray Tsui" <Raymond_Tsui@ca.ibm.com> wrote in message
news:d4j9dvcp7l5obpdtjinvs2s4bgt9rofu3o@4ax.com...
>
> Maybe you can suggest the proper approach?
>
> I have an contaner editpart (I call XYContainer) which contains other
> objects with x,y relative coordiantes and connections. This container
> can be inside other editparts with FlowLayouts or itself be contained
> inside XYContainer.
>
> What kind of figure and layout would you suggest I use? The
> XYContainer should automatically grow to enclose all its XY children,
> but move all its contents automatically when its parent FlowLayout
> causes it to move.

A Figure in XYLayout will do this.

> Ray
>
> On Wed, 28 May 2003 10:32:57 -0400, "Randy Hudson" <none@us.ibm.com>
> wrote:
>
> >If you are really useing the Freeform layer as intended, then restoring
the
> >notification may cause an infinite loop. Why do you need a
FreeFormLayer?
> >Have you placed it inside a ScrollPane figure?
> >
> >"Ray Tsui" <Raymond_Tsui@ca.ibm.com> wrote in message
> >news:jfc9dvgo83a51kajq3du5r59k7t7jmjmq1@4ax.com...
> >> It seems to me that the freeformlayer "breaks" the notification chain
> >> by overriding FireMoved(). Normally, it seems that the figures pass on
> >
> >The FreeformLayer never moves. Only its children move. Firing figure
moved
> >is used in two ways. It may indicate that the figure itself moved. But
it
> >is also used to indicate that the coordinate system in which the children
> >"live" has changed. AncestorListeners, such as connection anchors, are
> >interested in whether their source figure, or *any* of its ancestors move
or
> >otherwise change the absolute coordinate of the connection anchor.
> >
> >> this notification to allow the connections to lay out themselves, but
> >> I guess since the Freeformlayer is not normally placed inside a
> >> Flowlayout, this was intentional.
> >>
> >> I can get it to work by cloning the Freeformlayer class and removing
> >> the override. I don't know if this is a bad approach though.
> >>
> >> thanks
> >> Ray
> >>
> >>
> >>
> >> On Wed, 28 May 2003 01:15:45 -0400, "Randy Hudson" <none@us.ibm.com>
> >> wrote:
> >>
> >> >You probably can call setBounds(), but the children will not get
> >translated
> >> >as a result of doing so. This is by design, since setting the bounds
> >comes
> >> >after the children are layed out.
> >> >
> >>
> >
>
Previous Topic:Show tooltip for handle
Next Topic:Connection creation
Goto Forum:
  


Current Time: Wed Jul 16 21:36:20 EDT 2025

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

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

Back to the top