Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Resizing the Canvas when scrolling
Resizing the Canvas when scrolling [message #147086] Tue, 10 August 2004 14:45 Go to next message
Sean Kirby is currently offline Sean KirbyFriend
Messages: 14
Registered: July 2009
Junior Member
Hi,

I have a graphical editor and i want the canvas to grow when the
viewport is at the edge of the canvas and the user clicks on a
scrollbar. So far, looking at the code, it seems as if i need to
subclass FigureCanvas and at the very least override scrollToX(int
hOffset) and scrollToY(int vOffset) to resize the RangeModels. This is
not a problem. The problem is that i want the ScrollingGraphicalViewer
of my editor to now use my new FigureCanvas. First i tried simply
setting my new FigureCanvas as the ScrollingGraphicalViewers control,
but i had difficulty getting ahold of the LightweightSystem. Then, i
tried subclassing ScrollingGraphicalViewer. Unfortunately, the
createControl(Composite parent) method on the ScrollingGraphicalViewer
(where the FigureCanvas is created) is final!

Am i on the right track here or is there an easier way of setting a new
type of FigureCanvas on the ScrollingGraphicalViewer? Does my approach
to growing the canvas when the user scrolls even make sense?

Thanks for any insight,
Sean Kirby
Re: Resizing the Canvas when scrolling [message #147113 is a reply to message #147086] Tue, 10 August 2004 16:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

All you need to do is modify the RangeModel which is used by the
figurecanvas.

"Sean Kirby" <sskirby@alumni.uwaterloo.ca> wrote in message
news:cfamtn$9o8$1@eclipse.org...
> Hi,
>
> I have a graphical editor and i want the canvas to grow when the
> viewport is at the edge of the canvas and the user clicks on a
> scrollbar. So far, looking at the code, it seems as if i need to
> subclass FigureCanvas and at the very least override scrollToX(int
> hOffset) and scrollToY(int vOffset) to resize the RangeModels. This is
> not a problem. The problem is that i want the ScrollingGraphicalViewer
> of my editor to now use my new FigureCanvas. First i tried simply
> setting my new FigureCanvas as the ScrollingGraphicalViewers control,
> but i had difficulty getting ahold of the LightweightSystem. Then, i
> tried subclassing ScrollingGraphicalViewer. Unfortunately, the
> createControl(Composite parent) method on the ScrollingGraphicalViewer
> (where the FigureCanvas is created) is final!
>
> Am i on the right track here or is there an easier way of setting a new
> type of FigureCanvas on the ScrollingGraphicalViewer? Does my approach
> to growing the canvas when the user scrolls even make sense?
>
> Thanks for any insight,
> Sean Kirby
Re: Resizing the Canvas when scrolling [message #147238 is a reply to message #147113] Wed, 11 August 2004 14:18 Go to previous message
Sean Kirby is currently offline Sean KirbyFriend
Messages: 14
Registered: July 2009
Junior Member
Thanks Randy,

The functionality that i wanted is actually more or less already
implemented by the auto scrolling feature provided by the
ViewPortAutoexposeHelper.

sk

Randy Hudson wrote:
> All you need to do is modify the RangeModel which is used by the
> figurecanvas.
>
> "Sean Kirby" <sskirby@alumni.uwaterloo.ca> wrote in message
> news:cfamtn$9o8$1@eclipse.org...
>
>>Hi,
>>
>>I have a graphical editor and i want the canvas to grow when the
>>viewport is at the edge of the canvas and the user clicks on a
>>scrollbar. So far, looking at the code, it seems as if i need to
>>subclass FigureCanvas and at the very least override scrollToX(int
>>hOffset) and scrollToY(int vOffset) to resize the RangeModels. This is
>>not a problem. The problem is that i want the ScrollingGraphicalViewer
>>of my editor to now use my new FigureCanvas. First i tried simply
>>setting my new FigureCanvas as the ScrollingGraphicalViewers control,
>>but i had difficulty getting ahold of the LightweightSystem. Then, i
>>tried subclassing ScrollingGraphicalViewer. Unfortunately, the
>>createControl(Composite parent) method on the ScrollingGraphicalViewer
>>(where the FigureCanvas is created) is final!
>>
>>Am i on the right track here or is there an easier way of setting a new
>>type of FigureCanvas on the ScrollingGraphicalViewer? Does my approach
>>to growing the canvas when the user scrolls even make sense?
>>
>>Thanks for any insight,
>>Sean Kirby
>
>
>
Previous Topic:Force Minimum Figure Size on Resize?
Next Topic:Can we change the color of DragSource Feedback Figure when it move from one containner to other?
Goto Forum:
  


Current Time: Tue Apr 23 06:22:56 GMT 2024

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

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

Back to the top