Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Synch 2 scolling viewer set on composite
Synch 2 scolling viewer set on composite [message #192721] Mon, 22 August 2005 16:14 Go to next message
Eclipse UserFriend
Originally posted by: xpmansami.msn.com

Hi all,

I have 2 ScrollingGraphicalViewers let say v1 and v2.
Then these are on a composite comp via
v1.createControl(comp) and v2.createControl(comp)
The 2 viewer are shown in the GUI and each one scroll without any problem.
Now I tried to share the range model and used the following code

FigureCanvas canvas1 = (FigureCanvas) v1.getControl();
RangeModel sharedRange = canvas.getViewport().getHorizontalRangeModel();

FigureCanvas canvas2 = (FigureCanvas) v2.getControl();
canvas.getViewport().setHorizontalRangeModel(sharedRange);

Each viewer contain sufficient large figure to make them show the
scrollbar.
The problem is that the v2 scrollbar only scroll a small part of its
figure and of the one of v2.

I have made a lot of search in the gef threads and did not found a solution
Please help.
Many thanks.
Re: Synch 2 scolling viewer set on composite [message #192729 is a reply to message #192721] Mon, 22 August 2005 16:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

Sami, are both the viewers going to have scrollbars? I am not sure if you
can share range models in that case since each of the two scrollbars would
have to be proportionate to the contents of the two different viewers.

GEF's rulers do something similar in that they share a range model with the
graphical viewer. The difference is that the rulers themselves never show
the scrollbars. You can look at RulerRootEditPart.RulerViewport to see how
we've implemented this.

"sami" <xpmansami@msn.com> wrote in message
news:057c675bbdfea2bb520f7adecc4806fa$1@www.eclipse.org...
> Hi all,
>
> I have 2 ScrollingGraphicalViewers let say v1 and v2.
> Then these are on a composite comp via
> v1.createControl(comp) and v2.createControl(comp)
> The 2 viewer are shown in the GUI and each one scroll without any problem.
> Now I tried to share the range model and used the following code
>
> FigureCanvas canvas1 = (FigureCanvas) v1.getControl();
> RangeModel sharedRange = canvas.getViewport().getHorizontalRangeModel();
>
> FigureCanvas canvas2 = (FigureCanvas) v2.getControl();
> canvas.getViewport().setHorizontalRangeModel(sharedRange);
>
> Each viewer contain sufficient large figure to make them show the
> scrollbar.
> The problem is that the v2 scrollbar only scroll a small part of its
> figure and of the one of v2.
>
> I have made a lot of search in the gef threads and did not found a
solution
> Please help.
> Many thanks.
>
>
Re: Synch 2 scolling viewer set on composite [message #192736 is a reply to message #192729] Mon, 22 August 2005 17:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: xpmansami.msn.com

Thanks Pratick

Actually the 2 viewers have scrollbars but only the second viewer will
have horizontal scrollbar driving the first one.
In that case, is it possible to set the first viewer scrollbar visibility
to never and in that cas how can I get it from the viewer

Many thanks
Re: Synch 2 scolling viewer set on composite [message #192750 is a reply to message #192736] Mon, 22 August 2005 17:08 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You can hide one viewer's scrollbar and it will still "be there".

The best approach might be to try to keep the values in sync with a
listener.

"sami" <xpmansami@msn.com> wrote in message
news:34b3eadb4462f160eaf7cb68a4dca81c$1@www.eclipse.org...
> Thanks Pratick
>
> Actually the 2 viewers have scrollbars but only the second viewer will
> have horizontal scrollbar driving the first one.
> In that case, is it possible to set the first viewer scrollbar visibility
> to never and in that cas how can I get it from the viewer
>
> Many thanks
>
Previous Topic:"Folder" parts
Next Topic:Need to override GraphicalEditor.selectionChanged() when using MultiPageEditorPart and selection act
Goto Forum:
  


Current Time: Sat Apr 20 01:48:19 GMT 2024

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

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

Back to the top