Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Draw2d FigureCanvas scrollbar visibility issue
Draw2d FigureCanvas scrollbar visibility issue [message #196491] Wed, 21 September 2005 23:19 Go to next message
Brad Reynolds is currently offline Brad ReynoldsFriend
Messages: 309
Registered: July 2009
Senior Member
I have a component I wrote using draw2d that I'm having issues with
getting the scrollbar to appear. The scrollbars on my FigureCanvas are
set to always display so space for the scrollbar is allocated and
visible but when I should be able to scroll the scrollbar there is
nothing to scroll. I'm having a hard time coming up with a snippet that
displays the behavior and was hoping that I might be able to get some
suggestions here as to how to debug this or what to try. If I resize my
FigureCanvas a few times (having quite figured out what is the trigger
here) the scrollbar will appear and all is well. I've stepped through
the code into ScrollPaneSolver.solve(...) and found that the preferred
size of the viewport is being returned as height=2 width=2. But somehow
after a few resizes this gets recalculated. If anyone has any ideas or
suggestions feel free to shoot them my way. I'll keep trying to dig and
come up with a snippet that shows the issue.

-Brad
Re: Draw2d FigureCanvas scrollbar visibility issue [message #196509 is a reply to message #196491] Thu, 22 September 2005 14:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

The figure inside the viewport must return its preferredSize via its layout
manager. It sounds like your viewports contents doesn't have a layout.

"Brad Reynolds" <bradleyjames@gmail.com> wrote in message
news:dgsppr$4b6$1@news.eclipse.org...
>I have a component I wrote using draw2d that I'm having issues with getting
>the scrollbar to appear. The scrollbars on my FigureCanvas are set to
>always display so space for the scrollbar is allocated and visible but when
>I should be able to scroll the scrollbar there is nothing to scroll. I'm
>having a hard time coming up with a snippet that displays the behavior and
>was hoping that I might be able to get some suggestions here as to how to
>debug this or what to try. If I resize my FigureCanvas a few times (having
>quite figured out what is the trigger here) the scrollbar will appear and
>all is well. I've stepped through the code into
>ScrollPaneSolver.solve(...) and found that the preferred size of the
>viewport is being returned as height=2 width=2. But somehow after a few
>resizes this gets recalculated. If anyone has any ideas or suggestions
>feel free to shoot them my way. I'll keep trying to dig and come up with a
>snippet that shows the issue.
>
> -Brad
Re: Draw2d FigureCanvas scrollbar visibility issue [message #196555 is a reply to message #196509] Fri, 23 September 2005 00:51 Go to previous messageGo to next message
Brad Reynolds is currently offline Brad ReynoldsFriend
Messages: 309
Registered: July 2009
Senior Member
Randy, thank you for the response. I looked through my hierarchy and
they all seem to have layouts. If there wasn't a layout I would have
assumed that it would have exhibited the issue at all times. The part
that confuses me is that after a few resizes the scrollbars appear and
behave as expected. It seems like something is getting cached as the
preferred size but after the resizes it gets flushed. If I didn't have
a layout manager would it remedy itself with resizes?

Randy Hudson wrote:
> The figure inside the viewport must return its preferredSize via its layout
> manager. It sounds like your viewports contents doesn't have a layout.
>
> "Brad Reynolds" <bradleyjames@gmail.com> wrote in message
> news:dgsppr$4b6$1@news.eclipse.org...
>
>>I have a component I wrote using draw2d that I'm having issues with getting
>>the scrollbar to appear. The scrollbars on my FigureCanvas are set to
>>always display so space for the scrollbar is allocated and visible but when
>>I should be able to scroll the scrollbar there is nothing to scroll. I'm
>>having a hard time coming up with a snippet that displays the behavior and
>>was hoping that I might be able to get some suggestions here as to how to
>>debug this or what to try. If I resize my FigureCanvas a few times (having
>>quite figured out what is the trigger here) the scrollbar will appear and
>>all is well. I've stepped through the code into
>>ScrollPaneSolver.solve(...) and found that the preferred size of the
>>viewport is being returned as height=2 width=2. But somehow after a few
>>resizes this gets recalculated. If anyone has any ideas or suggestions
>>feel free to shoot them my way. I'll keep trying to dig and come up with a
>>snippet that shows the issue.
>>
>>-Brad
>
>
>
Re: Draw2d FigureCanvas scrollbar visibility issue [message #196562 is a reply to message #196555] Fri, 23 September 2005 03:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

If a figure doesn't have a layout, then its preferred size is its current
size.
Viewport stretches out its figure to fill up the avialable space. So, if you
stretch the figure, that becomes its new preferred size and when the canvas
gets smaller it would display scrollbars.

Anyway, you should just step into the FigureCanvas method that determines
scrollbar visibility, and find out who is lying about preferred size.

"Brad Reynolds" <bradleyjames@gmail.com> wrote in message
news:4333518B.6080305@gmail.com...
> Randy, thank you for the response. I looked through my hierarchy and they
> all seem to have layouts. If there wasn't a layout I would have assumed
> that it would have exhibited the issue at all times. The part that
> confuses me is that after a few resizes the scrollbars appear and behave
> as expected. It seems like something is getting cached as the preferred
> size but after the resizes it gets flushed. If I didn't have a layout
> manager would it remedy itself with resizes?
>
> Randy Hudson wrote:
>> The figure inside the viewport must return its preferredSize via its
>> layout manager. It sounds like your viewports contents doesn't have a
>> layout.
>>
>> "Brad Reynolds" <bradleyjames@gmail.com> wrote in message
>> news:dgsppr$4b6$1@news.eclipse.org...
>>
>>>I have a component I wrote using draw2d that I'm having issues with
>>>getting the scrollbar to appear. The scrollbars on my FigureCanvas are
>>>set to always display so space for the scrollbar is allocated and visible
>>>but when I should be able to scroll the scrollbar there is nothing to
>>>scroll. I'm having a hard time coming up with a snippet that displays
>>>the behavior and was hoping that I might be able to get some suggestions
>>>here as to how to debug this or what to try. If I resize my FigureCanvas
>>>a few times (having quite figured out what is the trigger here) the
>>>scrollbar will appear and all is well. I've stepped through the code
>>>into ScrollPaneSolver.solve(...) and found that the preferred size of the
>>>viewport is being returned as height=2 width=2. But somehow after a few
>>>resizes this gets recalculated. If anyone has any ideas or suggestions
>>>feel free to shoot them my way. I'll keep trying to dig and come up with
>>>a snippet that shows the issue.
>>>
>>>-Brad
>>
>>
Re: Draw2d FigureCanvas scrollbar visibility issue [message #197311 is a reply to message #196562] Mon, 03 October 2005 02:27 Go to previous message
Brad Reynolds is currently offline Brad ReynoldsFriend
Messages: 309
Registered: July 2009
Senior Member
Thanks for the help. I ended up writing my own layout which solved
quite a few of my issues and the provided information about Viewport
helped me with a different problem I was having. Thanks again.

Randy Hudson wrote:
> If a figure doesn't have a layout, then its preferred size is its current
> size.
> Viewport stretches out its figure to fill up the avialable space. So, if you
> stretch the figure, that becomes its new preferred size and when the canvas
> gets smaller it would display scrollbars.
>
> Anyway, you should just step into the FigureCanvas method that determines
> scrollbar visibility, and find out who is lying about preferred size.
>
> "Brad Reynolds" <bradleyjames@gmail.com> wrote in message
> news:4333518B.6080305@gmail.com...
>
>>Randy, thank you for the response. I looked through my hierarchy and they
>>all seem to have layouts. If there wasn't a layout I would have assumed
>>that it would have exhibited the issue at all times. The part that
>>confuses me is that after a few resizes the scrollbars appear and behave
>>as expected. It seems like something is getting cached as the preferred
>>size but after the resizes it gets flushed. If I didn't have a layout
>>manager would it remedy itself with resizes?
>>
>>Randy Hudson wrote:
>>
>>>The figure inside the viewport must return its preferredSize via its
>>>layout manager. It sounds like your viewports contents doesn't have a
>>>layout.
>>>
>>>"Brad Reynolds" <bradleyjames@gmail.com> wrote in message
>>>news:dgsppr$4b6$1@news.eclipse.org...
>>>
>>>
>>>>I have a component I wrote using draw2d that I'm having issues with
>>>>getting the scrollbar to appear. The scrollbars on my FigureCanvas are
>>>>set to always display so space for the scrollbar is allocated and visible
>>>>but when I should be able to scroll the scrollbar there is nothing to
>>>>scroll. I'm having a hard time coming up with a snippet that displays
>>>>the behavior and was hoping that I might be able to get some suggestions
>>>>here as to how to debug this or what to try. If I resize my FigureCanvas
>>>>a few times (having quite figured out what is the trigger here) the
>>>>scrollbar will appear and all is well. I've stepped through the code
>>>>into ScrollPaneSolver.solve(...) and found that the preferred size of the
>>>>viewport is being returned as height=2 width=2. But somehow after a few
>>>>resizes this gets recalculated. If anyone has any ideas or suggestions
>>>>feel free to shoot them my way. I'll keep trying to dig and come up with
>>>>a snippet that shows the issue.
>>>>
>>>>-Brad
>>>
>>>
>
Previous Topic:How to get the correct zoomManger when using a MultiPageEditorPart
Next Topic:AbstractEditPart and IAdaptable
Goto Forum:
  


Current Time: Thu Apr 25 14:24:53 GMT 2024

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

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

Back to the top