Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » scrollbar disappears when zooming
scrollbar disappears when zooming [message #245732] Wed, 08 October 2008 21:20 Go to next message
Mark Proe is currently offline Mark Proe
Messages: 29
Registered: July 2009
Junior Member
Hello,

Whenever I use ZoomManager to zoom in or out, my scrollbar vanishes.
What am I missing that would cause this to happen? I am using
ScrollingGraphicalViewer.

Thanks
Re: scrollbar disappears when zooming [message #245746 is a reply to message #245732] Thu, 09 October 2008 19:15 Go to previous messageGo to next message
Anthony Hunter is currently offline Anthony Hunter
Messages: 446
Registered: July 2009
Senior Member
Hi Mark,

You mean the scrollbar disappears when it is still needed?

The scrollbars currently disappear when the canvas shrinks smaller than the
viewport (there is nothing to scroll anymore).

Cheers...
Anthony

"Mark" <mproe@cerner.com> wrote in message
news:35abde542d706e329efdcd54ae9cd76d$1@www.eclipse.org...
> Hello,
>
> Whenever I use ZoomManager to zoom in or out, my scrollbar vanishes.
> What am I missing that would cause this to happen? I am using
> ScrollingGraphicalViewer.
>
> Thanks
>
Re: scrollbar disappears when zooming [message #245760 is a reply to message #245746] Fri, 10 October 2008 13:05 Go to previous messageGo to next message
Mark Proe is currently offline Mark Proe
Messages: 29
Registered: July 2009
Junior Member
Yes, the vertical scrollbar is disappearing when it is still needed. It
will always become visible again when I zoom back to 100%. But as soon as
I zoom in, it is gone. The mousewheel also becomes disabled, so I can't
scroll down period.

I should probably have mentioned I am using ScalableRootEditPart.

Thanks,
Mark


Anthony Hunter wrote:

> Hi Mark,

> You mean the scrollbar disappears when it is still needed?

> The scrollbars currently disappear when the canvas shrinks smaller than the
> viewport (there is nothing to scroll anymore).

> Cheers...
> Anthony

> "Mark" <mproe@cerner.com> wrote in message
> news:35abde542d706e329efdcd54ae9cd76d$1@www.eclipse.org...
>> Hello,
>>
>> Whenever I use ZoomManager to zoom in or out, my scrollbar vanishes.
>> What am I missing that would cause this to happen? I am using
>> ScrollingGraphicalViewer.
>>
>> Thanks
>>
Re: scrollbar disappears when zooming [message #245765 is a reply to message #245760] Mon, 13 October 2008 21:27 Go to previous messageGo to next message
Anthony Hunter is currently offline Anthony Hunter
Messages: 446
Registered: July 2009
Senior Member
Which OS platform ? Can you duplicate with the GEF Logic Example on your
Eclipse and OS platform ?

Cheers...
Anthony

"Mark" <mproe@cerner.com> wrote in message
news:2ed28c9db63971bd9f85d0a925096643$1@www.eclipse.org...
>
> Yes, the vertical scrollbar is disappearing when it is still needed. It
> will always become visible again when I zoom back to 100%. But as soon as
> I zoom in, it is gone. The mousewheel also becomes disabled, so I can't
> scroll down period.
>
> I should probably have mentioned I am using ScalableRootEditPart.
>
> Thanks,
> Mark
>
>
> Anthony Hunter wrote:
>
>> Hi Mark,
>
>> You mean the scrollbar disappears when it is still needed?
>
>> The scrollbars currently disappear when the canvas shrinks smaller than
>> the viewport (there is nothing to scroll anymore).
>
>> Cheers...
>> Anthony
>
>> "Mark" <mproe@cerner.com> wrote in message
>> news:35abde542d706e329efdcd54ae9cd76d$1@www.eclipse.org...
>>> Hello,
>>>
>>> Whenever I use ZoomManager to zoom in or out, my scrollbar vanishes.
>>> What am I missing that would cause this to happen? I am using
>>> ScrollingGraphicalViewer.
>>>
>>> Thanks
>>>
>
>
Re: scrollbar disappears when zooming [message #245787 is a reply to message #245765] Tue, 14 October 2008 15:01 Go to previous messageGo to next message
Mark Proe is currently offline Mark Proe
Messages: 29
Registered: July 2009
Junior Member
I am on Vista. I tried the GEF Logic Example, and the scrolling works
fine when zoomed.

The only significant coding difference I noticed is the example uses
ScalableFreeformRootEditPart, and my application uses
ScalableRootEditPart. I am also using a multipage FormEditor instead of a
single EditorPart, but I wouldn't think that would affect anything.

There must be something simple I am missing here???

Thanks,
Mark

Anthony Hunter wrote:

> Which OS platform ? Can you duplicate with the GEF Logic Example on your
> Eclipse and OS platform ?

> Cheers...
> Anthony

> "Mark" <mproe@cerner.com> wrote in message
> news:2ed28c9db63971bd9f85d0a925096643$1@www.eclipse.org...
>>
>> Yes, the vertical scrollbar is disappearing when it is still needed. It
>> will always become visible again when I zoom back to 100%. But as soon as
>> I zoom in, it is gone. The mousewheel also becomes disabled, so I can't
>> scroll down period.
>>
>> I should probably have mentioned I am using ScalableRootEditPart.
>>
>> Thanks,
>> Mark
>>
>>
>> Anthony Hunter wrote:
>>
>>> Hi Mark,
>>
>>> You mean the scrollbar disappears when it is still needed?
>>
>>> The scrollbars currently disappear when the canvas shrinks smaller than
>>> the viewport (there is nothing to scroll anymore).
>>
>>> Cheers...
>>> Anthony
>>
>>> "Mark" <mproe@cerner.com> wrote in message
>>> news:35abde542d706e329efdcd54ae9cd76d$1@www.eclipse.org...
>>>> Hello,
>>>>
>>>> Whenever I use ZoomManager to zoom in or out, my scrollbar vanishes.
>>>> What am I missing that would cause this to happen? I am using
>>>> ScrollingGraphicalViewer.
>>>>
>>>> Thanks
>>>>
>>
>>
Re: scrollbar disappears when zooming [message #245796 is a reply to message #245787] Tue, 14 October 2008 21:21 Go to previous messageGo to next message
Anthony Hunter is currently offline Anthony Hunter
Messages: 446
Registered: July 2009
Senior Member
Hi Mark,

I am on Windows XP and when I swap out ScalableFreeformRootEditPart with
ScalableRootEditPart in the GEF Logic Example, I do not see any issues. Zoom
and scrollbars are fine.

It could be that the outer composite on the multipage FormEditor also is
trying to scroll and is breaking your GEF editor. You would have to try in a
regular editor to see.

Cheers...
Anthony

"Mark" <mproe@cerner.com> wrote in message
news:ba29649ba2ffab96a39a8706d98898dc$1@www.eclipse.org...
>I am on Vista. I tried the GEF Logic Example, and the scrolling works fine
>when zoomed.
> The only significant coding difference I noticed is the example uses
> ScalableFreeformRootEditPart, and my application uses
> ScalableRootEditPart. I am also using a multipage FormEditor instead of a
> single EditorPart, but I wouldn't think that would affect anything.
>
> There must be something simple I am missing here???
>
> Thanks,
> Mark
>
> Anthony Hunter wrote:
>
>> Which OS platform ? Can you duplicate with the GEF Logic Example on your
>> Eclipse and OS platform ?
>
>> Cheers...
>> Anthony
>
>> "Mark" <mproe@cerner.com> wrote in message
>> news:2ed28c9db63971bd9f85d0a925096643$1@www.eclipse.org...
>>>
>>> Yes, the vertical scrollbar is disappearing when it is still needed. It
>>> will always become visible again when I zoom back to 100%. But as soon
>>> as I zoom in, it is gone. The mousewheel also becomes disabled, so I
>>> can't scroll down period.
>>>
>>> I should probably have mentioned I am using ScalableRootEditPart.
>>>
>>> Thanks,
>>> Mark
>>>
>>>
>>> Anthony Hunter wrote:
>>>
>>>> Hi Mark,
>>>
>>>> You mean the scrollbar disappears when it is still needed?
>>>
>>>> The scrollbars currently disappear when the canvas shrinks smaller than
>>>> the viewport (there is nothing to scroll anymore).
>>>
>>>> Cheers...
>>>> Anthony
>>>
>>>> "Mark" <mproe@cerner.com> wrote in message
>>>> news:35abde542d706e329efdcd54ae9cd76d$1@www.eclipse.org...
>>>>> Hello,
>>>>>
>>>>> Whenever I use ZoomManager to zoom in or out, my scrollbar vanishes.
>>>>> What am I missing that would cause this to happen? I am using
>>>>> ScrollingGraphicalViewer.
>>>>>
>>>>> Thanks
>>>>>
>>>
>>>
>
>
Re: scrollbar disappears when zooming [message #245827 is a reply to message #245796] Wed, 15 October 2008 16:04 Go to previous messageGo to next message
Mark Proe is currently offline Mark Proe
Messages: 29
Registered: July 2009
Junior Member
Okay, I narrowed down where the problem is occuring. But I don't know how
to get around it.


In my root edit part, I am creating a GridLayout to stack all my child
figures into a single column. For some strange reason, having a
GridLayout like this seems to screw up the scrolling calculations when
zoomed.


@Override
protected IFigure createFigure() {
Layer figure = new Layer();
GridLayout layout = new GridLayout(1, true);
layout.marginWidth = 15;
layout.marginHeight = 7;
layout.verticalSpacing = 5;
figure.setLayoutManager(layout);
return figure;
}


If I get rid of GridLayout and just display a single figure by itself, the
scrolling works fine.


@Override
protected IFigure createFigure() {
return new TestFigure();
}


Any ideas?


Thanks,
Mark


Anthony Hunter wrote:

> Hi Mark,

> I am on Windows XP and when I swap out ScalableFreeformRootEditPart with
> ScalableRootEditPart in the GEF Logic Example, I do not see any issues. Zoom
> and scrollbars are fine.

> It could be that the outer composite on the multipage FormEditor also is
> trying to scroll and is breaking your GEF editor. You would have to try in a
> regular editor to see.

> Cheers...
> Anthony

> "Mark" <mproe@cerner.com> wrote in message
> news:ba29649ba2ffab96a39a8706d98898dc$1@www.eclipse.org...
>>I am on Vista. I tried the GEF Logic Example, and the scrolling works fine
>>when zoomed.
>> The only significant coding difference I noticed is the example uses
>> ScalableFreeformRootEditPart, and my application uses
>> ScalableRootEditPart. I am also using a multipage FormEditor instead of a
>> single EditorPart, but I wouldn't think that would affect anything.
>>
>> There must be something simple I am missing here???
>>
>> Thanks,
>> Mark
>>
>> Anthony Hunter wrote:
>>
>>> Which OS platform ? Can you duplicate with the GEF Logic Example on your
>>> Eclipse and OS platform ?
>>
>>> Cheers...
>>> Anthony
>>
>>> "Mark" <mproe@cerner.com> wrote in message
>>> news:2ed28c9db63971bd9f85d0a925096643$1@www.eclipse.org...
>>>>
>>>> Yes, the vertical scrollbar is disappearing when it is still needed. It
>>>> will always become visible again when I zoom back to 100%. But as soon
>>>> as I zoom in, it is gone. The mousewheel also becomes disabled, so I
>>>> can't scroll down period.
>>>>
>>>> I should probably have mentioned I am using ScalableRootEditPart.
>>>>
>>>> Thanks,
>>>> Mark
>>>>
>>>>
>>>> Anthony Hunter wrote:
>>>>
>>>>> Hi Mark,
>>>>
>>>>> You mean the scrollbar disappears when it is still needed?
>>>>
>>>>> The scrollbars currently disappear when the canvas shrinks smaller than
>>>>> the viewport (there is nothing to scroll anymore).
>>>>
>>>>> Cheers...
>>>>> Anthony
>>>>
>>>>> "Mark" <mproe@cerner.com> wrote in message
>>>>> news:35abde542d706e329efdcd54ae9cd76d$1@www.eclipse.org...
>>>>>> Hello,
>>>>>>
>>>>>> Whenever I use ZoomManager to zoom in or out, my scrollbar vanishes.
>>>>>> What am I missing that would cause this to happen? I am using
>>>>>> ScrollingGraphicalViewer.
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>
>>>>
>>
>>
Re: scrollbar disappears when zooming [message #245833 is a reply to message #245827] Wed, 15 October 2008 21:04 Go to previous messageGo to next message
Anthony Hunter is currently offline Anthony Hunter
Messages: 446
Registered: July 2009
Senior Member
Hi Mark,

No ideas, but you can raise a bug report for this in Bugzilla now that you
have a test case.

Cheers...
Anthony

"Mark" <mproe@cerner.com> wrote in message
news:8090006ba23cf1d765a42495936ca112$1@www.eclipse.org...
> Okay, I narrowed down where the problem is occuring. But I don't know how
> to get around it.
>
>
> In my root edit part, I am creating a GridLayout to stack all my child
> figures into a single column. For some strange reason, having a
> GridLayout like this seems to screw up the scrolling calculations when
> zoomed.
>
>
> @Override
> protected IFigure createFigure() { Layer figure = new Layer();
> GridLayout layout = new GridLayout(1, true);
> layout.marginWidth = 15;
> layout.marginHeight = 7;
> layout.verticalSpacing = 5;
> figure.setLayoutManager(layout);
> return figure;
> }
>
>
> If I get rid of GridLayout and just display a single figure by itself, the
> scrolling works fine.
>
>
> @Override
> protected IFigure createFigure() { return new TestFigure();
> }
>
>
> Any ideas?
>
>
> Thanks,
> Mark
>
>
> Anthony Hunter wrote:
>
>> Hi Mark,
>
>> I am on Windows XP and when I swap out ScalableFreeformRootEditPart with
>> ScalableRootEditPart in the GEF Logic Example, I do not see any issues.
>> Zoom and scrollbars are fine.
>
>> It could be that the outer composite on the multipage FormEditor also is
>> trying to scroll and is breaking your GEF editor. You would have to try
>> in a regular editor to see.
>
>> Cheers...
>> Anthony
>
>> "Mark" <mproe@cerner.com> wrote in message
>> news:ba29649ba2ffab96a39a8706d98898dc$1@www.eclipse.org...
>>>I am on Vista. I tried the GEF Logic Example, and the scrolling works
>>>fine when zoomed.
>>> The only significant coding difference I noticed is the example uses
>>> ScalableFreeformRootEditPart, and my application uses
>>> ScalableRootEditPart. I am also using a multipage FormEditor instead of
>>> a single EditorPart, but I wouldn't think that would affect anything.
>>>
>>> There must be something simple I am missing here???
>>>
>>> Thanks,
>>> Mark
>>>
>>> Anthony Hunter wrote:
>>>
>>>> Which OS platform ? Can you duplicate with the GEF Logic Example on
>>>> your Eclipse and OS platform ?
>>>
>>>> Cheers...
>>>> Anthony
>>>
>>>> "Mark" <mproe@cerner.com> wrote in message
>>>> news:2ed28c9db63971bd9f85d0a925096643$1@www.eclipse.org...
>>>>>
>>>>> Yes, the vertical scrollbar is disappearing when it is still needed.
>>>>> It will always become visible again when I zoom back to 100%. But as
>>>>> soon as I zoom in, it is gone. The mousewheel also becomes disabled,
>>>>> so I can't scroll down period.
>>>>>
>>>>> I should probably have mentioned I am using ScalableRootEditPart.
>>>>>
>>>>> Thanks,
>>>>> Mark
>>>>>
>>>>>
>>>>> Anthony Hunter wrote:
>>>>>
>>>>>> Hi Mark,
>>>>>
>>>>>> You mean the scrollbar disappears when it is still needed?
>>>>>
>>>>>> The scrollbars currently disappear when the canvas shrinks smaller
>>>>>> than the viewport (there is nothing to scroll anymore).
>>>>>
>>>>>> Cheers...
>>>>>> Anthony
>>>>>
>>>>>> "Mark" <mproe@cerner.com> wrote in message
>>>>>> news:35abde542d706e329efdcd54ae9cd76d$1@www.eclipse.org...
>>>>>>> Hello,
>>>>>>>
>>>>>>> Whenever I use ZoomManager to zoom in or out, my scrollbar vanishes.
>>>>>>> What am I missing that would cause this to happen? I am using
>>>>>>> ScrollingGraphicalViewer.
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>
Re: scrollbar disappears when zooming [message #245847 is a reply to message #245833] Thu, 16 October 2008 15:14 Go to previous messageGo to next message
Mark Proe is currently offline Mark Proe
Messages: 29
Registered: July 2009
Junior Member
I appreciate all your help, Anthony!


I have logged Bug #251093.


Thanks,
Mark


Anthony Hunter wrote:

> Hi Mark,

> No ideas, but you can raise a bug report for this in Bugzilla now that you
> have a test case.

> Cheers...
> Anthony

> "Mark" <mproe@cerner.com> wrote in message
> news:8090006ba23cf1d765a42495936ca112$1@www.eclipse.org...
>> Okay, I narrowed down where the problem is occuring. But I don't know how
>> to get around it.
>>
>>
>> In my root edit part, I am creating a GridLayout to stack all my child
>> figures into a single column. For some strange reason, having a
>> GridLayout like this seems to screw up the scrolling calculations when
>> zoomed.
>>
>>
>> @Override
>> protected IFigure createFigure() { Layer figure = new Layer();
>> GridLayout layout = new GridLayout(1, true);
>> layout.marginWidth = 15;
>> layout.marginHeight = 7;
>> layout.verticalSpacing = 5;
>> figure.setLayoutManager(layout);
>> return figure;
>> }
>>
>>
>> If I get rid of GridLayout and just display a single figure by itself, the
>> scrolling works fine.
>>
>>
>> @Override
>> protected IFigure createFigure() { return new TestFigure();
>> }
>>
>>
>> Any ideas?
>>
>>
>> Thanks,
>> Mark
>>
>>
>> Anthony Hunter wrote:
>>
>>> Hi Mark,
>>
>>> I am on Windows XP and when I swap out ScalableFreeformRootEditPart with
>>> ScalableRootEditPart in the GEF Logic Example, I do not see any issues.
>>> Zoom and scrollbars are fine.
>>
>>> It could be that the outer composite on the multipage FormEditor also is
>>> trying to scroll and is breaking your GEF editor. You would have to try
>>> in a regular editor to see.
>>
>>> Cheers...
>>> Anthony
>>
>>> "Mark" <mproe@cerner.com> wrote in message
>>> news:ba29649ba2ffab96a39a8706d98898dc$1@www.eclipse.org...
>>>>I am on Vista. I tried the GEF Logic Example, and the scrolling works
>>>>fine when zoomed.
>>>> The only significant coding difference I noticed is the example uses
>>>> ScalableFreeformRootEditPart, and my application uses
>>>> ScalableRootEditPart. I am also using a multipage FormEditor instead of
>>>> a single EditorPart, but I wouldn't think that would affect anything.
>>>>
>>>> There must be something simple I am missing here???
>>>>
>>>> Thanks,
>>>> Mark
>>>>
>>>> Anthony Hunter wrote:
>>>>
>>>>> Which OS platform ? Can you duplicate with the GEF Logic Example on
>>>>> your Eclipse and OS platform ?
>>>>
>>>>> Cheers...
>>>>> Anthony
>>>>
>>>>> "Mark" <mproe@cerner.com> wrote in message
>>>>> news:2ed28c9db63971bd9f85d0a925096643$1@www.eclipse.org...
>>>>>>
>>>>>> Yes, the vertical scrollbar is disappearing when it is still needed.
>>>>>> It will always become visible again when I zoom back to 100%. But as
>>>>>> soon as I zoom in, it is gone. The mousewheel also becomes disabled,
>>>>>> so I can't scroll down period.
>>>>>>
>>>>>> I should probably have mentioned I am using ScalableRootEditPart.
>>>>>>
>>>>>> Thanks,
>>>>>> Mark
>>>>>>
>>>>>>
>>>>>> Anthony Hunter wrote:
>>>>>>
>>>>>>> Hi Mark,
>>>>>>
>>>>>>> You mean the scrollbar disappears when it is still needed?
>>>>>>
>>>>>>> The scrollbars currently disappear when the canvas shrinks smaller
>>>>>>> than the viewport (there is nothing to scroll anymore).
>>>>>>
>>>>>>> Cheers...
>>>>>>> Anthony
>>>>>>
>>>>>>> "Mark" <mproe@cerner.com> wrote in message
>>>>>>> news:35abde542d706e329efdcd54ae9cd76d$1@www.eclipse.org...
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> Whenever I use ZoomManager to zoom in or out, my scrollbar vanishes.
>>>>>>>> What am I missing that would cause this to happen? I am using
>>>>>>>> ScrollingGraphicalViewer.
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>
Re: scrollbar disappears when zooming [message #245980 is a reply to message #245847] Wed, 29 October 2008 09:42 Go to previous messageGo to next message
Dazhen Gao is currently offline Dazhen Gao
Messages: 21
Registered: July 2009
Junior Member
please try

protected IFigure createFigure() {
Figure figure = new FreeformLayer();
GridLayout layout = new GridLayout(1, true);
layout.marginWidth = 15;
layout.marginHeight = 7;
layout.verticalSpacing = 5;
figure.setLayoutManager(layout);
return figure;
}
Re: scrollbar disappears when zooming [message #515909 is a reply to message #245980] Mon, 22 February 2010 08:34 Go to previous messageGo to next message
Vijay Raj
Messages: 608
Registered: July 2009
Senior Member
any break thru in this???

---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Re: scrollbar disappears when zooming [message #523441 is a reply to message #515909] Fri, 26 March 2010 13:52 Go to previous message
Vijay Raj
Messages: 608
Registered: July 2009
Senior Member
sorry for revoking such an old issue...

This is a an old issue but still pending issue(another example of GEF is dead Twisted Evil )

upon analyses on certain zoom levels with a GridLayout on root figure...

The ScalableLayeredPane class asks for a prefered size in

/**
 * @see Figure#getPreferredSize(int, int)
 */
public Dimension getMinimumSize(int wHint, int hHint) {
	Dimension d = super.getMinimumSize((int) (wHint / getScale()), (int)(hHint / getScale()));
	int w = getInsets().getWidth();
	int h = getInsets().getHeight();
	return d.getExpanded(-w, -h)
		.scale(scale)
		.expand(w, h);
}



here width/hight hint is -1 in normal cases..

hence ((int) (wHint / getScale()) returns a zero(for higher then 1 scale) or some other negative value in lower scales

This leads to passing of width hint 0 in many cases.

ultimately in GridLayout.calculatePreferredSize method

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.draw2d.AbstractLayout#calculatePreferredSize(org.eclipse.draw2d.IFigure,
     *      int, int)
     */
    @Override
    protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint)
    {
        Dimension size = layout(container, false, 0, 0, wHint, hHint, /* flushCache */
        true);
        if (wHint != SWT.DEFAULT) size.width = wHint;
        if (hHint != SWT.DEFAULT) size.height = hHint;

        /*
         * Adjust for the size of the border
         */
        size.expand(container.getInsets().getWidth(), container.getInsets().getHeight());
        size.union(getBorderPreferredSize(container));

        return size;
    }


the zero width/height hint leads to 0 as prefered size.

The fix would be to check for SWT.DEFAULT width/height hint in ScalableLayeredPane class and accordingly pass on the SWT.DEFAULT value without applying scale changes.

Am i correct here,can any body varyfy the same so that this can be patched in the specified Bug #251093.


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Previous Topic:GEF for iPad?
Next Topic:tracing source/code from model developed in gmf based editor
Goto Forum:
  


Current Time: Thu Oct 23 03:55:16 GMT 2014

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

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