Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to synchronize the two scrollbar movements of two graphical viewers
How to synchronize the two scrollbar movements of two graphical viewers [message #219007] Thu, 06 July 2006 10:55 Go to next message
Eclipse UserFriend
Originally posted by: shruthi.cn.in.bosch.com

Hello all,
I have two graphical viewers of type
org.eclipse.gef.ui.parts.ScrollingGraphicalViewer. These two viewers are
placed in a sash form.

I want the movement of horizontal scrollbars of both viewers to be
synchronized i.e when i move one scrollbar of one viewer, the other
scrollbar of the second viewer should also move.

I tried the following to get the scrollbars instances but i dont know how
to synchronize :

Here firstViewer, secondViewer is of type BDEGraphicalViewer and
BDEGraphicalViewer extends ScrollingGraphicalViewer.
CODE:-
BDEGraphicalViewer baseViewer;
BDEGraphicalViewer targetViewer;

FigureCanvas baseCanvas = firstViewer.getFigureCanvasForViewer();
ScrollBar baseHorizontalScrollBar = baseCanvas.getHorizontalBar();

FigureCanvas targetCanvas = secondViewer.getFigureCanvasForViewer();
ScrollBar targetHorizontalScrollBar = targetCanvas.getHorizontalBar();

Please help me in solving this problem.
Thank you
Best Regards
Shruthi
Re: How to synchronize the two scrollbar movements of two graphical viewers [message #219055 is a reply to message #219007] Thu, 06 July 2006 20:48 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Use the RangeModel from the scrollbars.

"shruthi" <shruthi.cn@in.bosch.com> wrote in message
news:b7ab0239256e97442986a2e6560fe7ba$1@www.eclipse.org...
> Hello all,
> I have two graphical viewers of type
> org.eclipse.gef.ui.parts.ScrollingGraphicalViewer. These two viewers are
> placed in a sash form.
>
> I want the movement of horizontal scrollbars of both viewers to be
> synchronized i.e when i move one scrollbar of one viewer, the other
> scrollbar of the second viewer should also move.
>
> I tried the following to get the scrollbars instances but i dont know how
> to synchronize :
>
> Here firstViewer, secondViewer is of type BDEGraphicalViewer and
> BDEGraphicalViewer extends ScrollingGraphicalViewer.
> CODE:-
> BDEGraphicalViewer baseViewer;
> BDEGraphicalViewer targetViewer;
>
> FigureCanvas baseCanvas = firstViewer.getFigureCanvasForViewer();
> ScrollBar baseHorizontalScrollBar = baseCanvas.getHorizontalBar();
>
> FigureCanvas targetCanvas = secondViewer.getFigureCanvasForViewer();
> ScrollBar targetHorizontalScrollBar = targetCanvas.getHorizontalBar();
>
> Please help me in solving this problem.
> Thank you Best Regards
> Shruthi
>
Previous Topic:GEF in RCP
Next Topic:Two kinds of connections
Goto Forum:
  


Current Time: Fri Apr 26 20:38:39 GMT 2024

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

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

Back to the top