Skip to main content



      Home
Home » Eclipse Projects » GEF » Control how components layout in a ScrollPane
Control how components layout in a ScrollPane [message #38505] Fri, 01 November 2002 16:28 Go to next message
Eclipse UserFriend
Originally posted by: radienssmgs2.hotmail.com

Hi,

How can I control how the components layout in a ScrollPane every time users
scroll?

For example, I have a number of components in a ScrollPane, and some of
them are visible and some are not depends on how much users scroll up/down.
But can I change the location of the components in a ScrollPane myself
whenever users scroll?

Thank you.
Re: Control how components layout in a ScrollPane [message #38677 is a reply to message #38505] Sat, 02 November 2002 14:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: radienssmgs2.hotmail.com

How can I change the scrollPane behaviour so that any connection connecting
to a component inside the scrollPane is NOT visible when the connecting
component is not visible?

In the logic editor example, you draw a component (e.g. And Gate) in a
Circuit (a container with ScrollPane) and then draw a connection from that
And Gate to another compoent outiside the container.

Now if you scroll the Circuit and make the And Gate not visible, you can
still see the connection.

How can I change the scrollPane scorlling so that when a component is not
visible, all the connections to it is not visible as well?

Thank you for any help.


"Jack R." <radienssmgs2@hotmail.com> wrote in message
news:apupsa$3jm$1@rogue.oti.com...
> Hi,
>
> How can I control how the components layout in a ScrollPane every time
users
> scroll?
>
> For example, I have a number of components in a ScrollPane, and some of
> them are visible and some are not depends on how much users scroll
up/down.
> But can I change the location of the components in a ScrollPane myself
> whenever users scroll?
>
> Thank you.
>
>
Re: Control how components layout in a ScrollPane [message #38828 is a reply to message #38677] Sun, 03 November 2002 18:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: radienssmgs2.hotmail.com

Basically, I want to avoid case show in the after.jpg.

In the beginning I have a connection to the Or Gate (before.jpg), but later,
I change the size of the Circuit so that Or Gate is not longer visible but
the connection between the Or Gate and XOR Gate still is. I would like to
make the connection between Or Gate and XOR Gate become invisible whenever
Or Gate becomes invisible.

Thank you.

"Jack R." <radienssmgs2@hotmail.com> wrote in message
news:aq17rd$s8m$1@rogue.oti.com...
> How can I change the scrollPane behaviour so that any connection
connecting
> to a component inside the scrollPane is NOT visible when the connecting
> component is not visible?
>
> In the logic editor example, you draw a component (e.g. And Gate) in a
> Circuit (a container with ScrollPane) and then draw a connection from that
> And Gate to another compoent outiside the container.
>
> Now if you scroll the Circuit and make the And Gate not visible, you can
> still see the connection.
>
> How can I change the scrollPane scorlling so that when a component is not
> visible, all the connections to it is not visible as well?
>
> Thank you for any help.
>
>
> "Jack R." <radienssmgs2@hotmail.com> wrote in message
> news:apupsa$3jm$1@rogue.oti.com...
> > Hi,
> >
> > How can I control how the components layout in a ScrollPane every time
> users
> > scroll?
> >
> > For example, I have a number of components in a ScrollPane, and some of
> > them are visible and some are not depends on how much users scroll
> up/down.
> > But can I change the location of the components in a ScrollPane myself
> > whenever users scroll?
> >
> > Thank you.
> >
> >
>
>



  • Attachment: before.jpg
    (Size: 37.91KB, Downloaded 111 times)
  • Attachment: after.jpg
    (Size: 37.73KB, Downloaded 119 times)
Re: Control how components layout in a ScrollPane [message #38891 is a reply to message #38677] Sun, 03 November 2002 18:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

You could do this 2 ways. Does your application have connections from one
scrollpane to another? Or just within a a single scrollpane?

I'll assume you have connections across scrollpanes like in the Logic
example. ConnectionAnchor will already fire when the node figure's or any
of their ancestors move or resize. And, PolylineConnection will already
revalidate itself if this happens. So, all you need to do is override
validate() on the ConnectionFigure. Then, for each node at each end, take a
copy of the node's bounds, and walk up the parent hierarchy, as you go you
will 1) clip the bounds to the current ancestor's clientArea, 2) transform
that result to the next parent figure, since coordinate systems can change
as you go up. The exact code for this (except it is using getBounds()
instead of getClientArea()) is already in
DeferredUpdateManager.repairDamage(). Once you have clipped the Rectangle
to be isEmpty(), you know the figure isn't visible.

I think this is going to look weird. You might not want to walk all the way
up to the GraphicalViewer's Viewport, because then you will have
connection's flashing in and out as you scroll the entire diagram.

I've seen an alternative to this. Instead of having connections scroll down
in the middle of nowhere like in the Logic example, you could clip the
ConnectionAnchor to the top/bottom of the parent's scrollpane. So, once a
connection scrolls to the edge of the scrollpane, it stops there even though
scrolling continues.

"Jack R." <radienssmgs2@hotmail.com> wrote in message
news:aq17rd$s8m$1@rogue.oti.com...
> How can I change the scrollPane behaviour so that any connection
connecting
> to a component inside the scrollPane is NOT visible when the connecting
> component is not visible?
>
> In the logic editor example, you draw a component (e.g. And Gate) in a
> Circuit (a container with ScrollPane) and then draw a connection from that
> And Gate to another compoent outiside the container.
>
> Now if you scroll the Circuit and make the And Gate not visible, you can
> still see the connection.
>
> How can I change the scrollPane scorlling so that when a component is not
> visible, all the connections to it is not visible as well?
>
> Thank you for any help.
>
>
> "Jack R." <radienssmgs2@hotmail.com> wrote in message
> news:apupsa$3jm$1@rogue.oti.com...
> > Hi,
> >
> > How can I control how the components layout in a ScrollPane every time
> users
> > scroll?
> >
> > For example, I have a number of components in a ScrollPane, and some of
> > them are visible and some are not depends on how much users scroll
> up/down.
> > But can I change the location of the components in a ScrollPane myself
> > whenever users scroll?
> >
> > Thank you.
> >
> >
>
>
Re: Control how components layout in a ScrollPane [message #39130 is a reply to message #38891] Mon, 04 November 2002 11:00 Go to previous message
Eclipse UserFriend
Originally posted by: radienssmgs2.hotmail.com

"Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
news:aq4ao1$vaj$1@rogue.oti.com...

> I've seen an alternative to this. Instead of having connections scroll
down
> in the middle of nowhere like in the Logic example, you could clip the
> ConnectionAnchor to the top/bottom of the parent's scrollpane. So, once a
> connection scrolls to the edge of the scrollpane, it stops there even
though
> scrolling continues.

Could you tell me how to find which ConnectionAnchor to chip (the connection
anchor connecting to Visible component does not need to chip, right)? And
how can I un-chip those ConnectionAnchor when the connecting component
become visible again? How can I find out when user scrolls to trigger that
new code?

Thanks for your help again.

> "Jack R." <radienssmgs2@hotmail.com> wrote in message
> news:aq17rd$s8m$1@rogue.oti.com...
> > How can I change the scrollPane behaviour so that any connection
> connecting
> > to a component inside the scrollPane is NOT visible when the connecting
> > component is not visible?
> >
> > In the logic editor example, you draw a component (e.g. And Gate) in a
> > Circuit (a container with ScrollPane) and then draw a connection from
that
> > And Gate to another compoent outiside the container.
> >
> > Now if you scroll the Circuit and make the And Gate not visible, you can
> > still see the connection.
> >
> > How can I change the scrollPane scorlling so that when a component is
not
> > visible, all the connections to it is not visible as well?
> >
> > Thank you for any help.
> >
> >
> > "Jack R." <radienssmgs2@hotmail.com> wrote in message
> > news:apupsa$3jm$1@rogue.oti.com...
> > > Hi,
> > >
> > > How can I control how the components layout in a ScrollPane every time
> > users
> > > scroll?
> > >
> > > For example, I have a number of components in a ScrollPane, and some
of
> > > them are visible and some are not depends on how much users scroll
> > up/down.
> > > But can I change the location of the components in a ScrollPane myself
> > > whenever users scroll?
> > >
> > > Thank you.
> > >
> > >
> >
> >
>
>
Previous Topic:[Draw2d] How to rotate a figure
Next Topic:In place editing of Label text?
Goto Forum:
  


Current Time: Fri May 09 18:17:00 EDT 2025

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

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

Back to the top