| Figure always on top [message #230817] |
Mon, 19 February 2007 09:22  |
Manuel Selva Messages: 189 Registered: July 2009 Location: Grenoble, France |
Senior Member |
|
|
Hi all,
I am dealing with draw2d inside an eclipse view. Inside this view i have a
child composite, a FigureCanvas, displaying a draw2d diagram. When my
diagram becomes larger than the visible screen, automatically, the
FigureCanvas displays and manages scrollbars for me : very nice !!!!
Now, i would like to add to my Draw2d figure hierarchy, a figure at top
most level which always stay visible at the center of the diagram, even
when the figure canvas is scrolled. After a lot of research, i didn't find
any way to do this .... excepted a "bad" workaround consisting of moving
the figure inside the root figure of my diagram(a Panel) each time the
figure canvas is scrolled in order to always put it at the center of
screen. The problem with this solution is that we can clearly see the
figure moving creating a flicking effect.
Has someone ideas about this subject ? I really need a way to implement
correctly this.
Thanks in advance
Manuel Selva
http://manuelselva.wordpress.com/
|
|
|
| Re: Figure always on top [message #230832 is a reply to message #230817] |
Mon, 19 February 2007 17:47   |
|
Originally posted by: lamont_gilbert.rigidsoftware.com
On Mon, 19 Feb 2007 14:22:50 +0000, Manuel Selva wrote:
> Hi all,
>
> I am dealing with draw2d inside an eclipse view. Inside this view i have a
> child composite, a FigureCanvas, displaying a draw2d diagram. When my
> diagram becomes larger than the visible screen, automatically, the
> FigureCanvas displays and manages scrollbars for me : very nice !!!!
>
> Now, i would like to add to my Draw2d figure hierarchy, a figure at top
> most level which always stay visible at the center of the diagram, even
> when the figure canvas is scrolled. After a lot of research, i didn't find
> any way to do this .... excepted a "bad" workaround consisting of moving
> the figure inside the root figure of my diagram(a Panel) each time the
> figure canvas is scrolled in order to always put it at the center of
> screen. The problem with this solution is that we can clearly see the
> figure moving creating a flicking effect.
>
> Has someone ideas about this subject ? I really need a way to implement
> correctly this.
>
> Thanks in advance
>
> Manuel Selva
Perhaps you can do something similar to what the example does with rulers?
|
|
|
| Re: Figure always on top [message #230901 is a reply to message #230817] |
Thu, 22 February 2007 01:41   |
|
Originally posted by: none.unknown.com
Usually, the simple fix is to add the figure to the viewport instead of the
view. But that most likely won't work here since the root figure is the
view.
The flickering however could be the effect of some optimization that happens
when you scroll. Pixels are copied and pasted for the area that was already
visible, to increase performance. Perhaps you'd get better results if you
simply turned that off.
"Manuel Selva" <manuel.selva@st.com> wrote in message
news:8410534bd3db8c6dd8d981c9ee27d3da$1@www.eclipse.org...
> Hi all,
>
> I am dealing with draw2d inside an eclipse view. Inside this view i have a
> child composite, a FigureCanvas, displaying a draw2d diagram. When my
> diagram becomes larger than the visible screen, automatically, the
> FigureCanvas displays and manages scrollbars for me : very nice !!!!
> Now, i would like to add to my Draw2d figure hierarchy, a figure at top
> most level which always stay visible at the center of the diagram, even
> when the figure canvas is scrolled. After a lot of research, i didn't find
> any way to do this .... excepted a "bad" workaround consisting of moving
> the figure inside the root figure of my diagram(a Panel) each time the
> figure canvas is scrolled in order to always put it at the center of
> screen. The problem with this solution is that we can clearly see the
> figure moving creating a flicking effect.
> Has someone ideas about this subject ? I really need a way to implement
> correctly this.
>
> Thanks in advance
>
> Manuel Selva
>
|
|
|
| Re: Figure always on top [message #230924 is a reply to message #230817] |
Thu, 22 February 2007 11:05   |
|
Originally posted by: none.ibm.com
You should open a bug and investigate creating a patch. Other's have
requested background figures which scroll in only one direction (e.g. swim
lanes), "ruler figures" that scroll in only one direction and push down the
area available for the main "view" (e.g. a column header for a table), and
of course things that just don't scroll at all.
The reason you are seeing flicker, is that FigureCanvas is using the native
scroll method in SWT to BitBLT the pixels when you scroll. You'll need to
disable this because some of your pixels aren't supposed to move, so you'll
see a performance hit.
If your guy on top is not transparent and is rectangular, you might be able
to create another SWT Control completely outside of the FigureCanvas.
"Manuel Selva" <manuel.selva@st.com> wrote in message
news:8410534bd3db8c6dd8d981c9ee27d3da$1@www.eclipse.org...
> Hi all,
>
> I am dealing with draw2d inside an eclipse view. Inside this view i have a
> child composite, a FigureCanvas, displaying a draw2d diagram. When my
> diagram becomes larger than the visible screen, automatically, the
> FigureCanvas displays and manages scrollbars for me : very nice !!!!
> Now, i would like to add to my Draw2d figure hierarchy, a figure at top
> most level which always stay visible at the center of the diagram, even
> when the figure canvas is scrolled. After a lot of research, i didn't find
> any way to do this .... excepted a "bad" workaround consisting of moving
> the figure inside the root figure of my diagram(a Panel) each time the
> figure canvas is scrolled in order to always put it at the center of
> screen. The problem with this solution is that we can clearly see the
> figure moving creating a flicking effect.
> Has someone ideas about this subject ? I really need a way to implement
> correctly this.
>
> Thanks in advance
>
> Manuel Selva
>
|
|
|
| Re: Figure always on top [message #230946 is a reply to message #230924] |
Fri, 23 February 2007 03:23   |
Manuel Selva Messages: 189 Registered: July 2009 Location: Grenoble, France |
Senior Member |
|
|
Thanks for all your answers.
I am going to open an enhancement request but still have some questions.
Concerning the flicking: when i scroll, my FigureCanvas call the scroll
method of Canvas class to translate my drawing and next i manually move
the figure. So there is 2 "drawing operations" (moving caused by scroll
and moving caused by me with a setConstraint method call) performed by the
underlying OS causing the flickering effect, am i right ?
Your are speaking about disable the native scroll performed by SWT because
some of my pixel aren't supposed to move. I agree with you, but these
pixel are only the ones associated to an "always visible figure". So i
must selectively disable the native scrolling, isn't it ? May be i should
compute which rectangle areas need scrolling and scroll them and don't do
anything with other areas ...
The solution consisting in add an SWT composite on top of my figure canvas
can't be used in my case because in fact my "always visible figure" is an
ImageFigure. And this figure doesn't really need to stay exactly in the
center of the screen but exactly where the user clicked... Is there any
way using SWT to perform XYLayout ?? (i don't think so but may be i am
wrong)
Manuel Selva
http://manuelselva.wordpress.com/
|
|
|
|
| Re: Figure always on top [message #231121 is a reply to message #230901] |
Tue, 27 February 2007 04:20   |
Manuel Selva Messages: 189 Registered: July 2009 Location: Grenoble, France |
Senior Member |
|
|
Hi,
Turning off the native scrolling (Canvas.scroll) doesn't solve the
problem. To turn off this I need to call a full redraw on the figure
canvas instead of a partial redraw on the new reveled part of the chart
to have my chart scrolling correctly. Do you agree ?
This means my always visible figure is also scrolled with the rest of the
chart and next when i moved it the flicker effect can be seen ...
I really need to find a solution for this
Any help is welcomed.
Manuel Selva
http://manuelselva.wordpress.com/
|
|
|
|
| Re: Figure always on top [message #231208 is a reply to message #230817] |
Wed, 28 February 2007 09:24  |
Manuel Selva Messages: 189 Registered: July 2009 Location: Grenoble, France |
Senior Member |
|
|
Hi all,
I forgot to mention that what i want to achieve is to reproduce the
Internet Explorer (or may be windows one ...) behavior when clicking on
the middle button of the mouse. When we click on this button inside a
large page we can next move the mouse to define "a vector" indicating
which way (8 possibilities) and which speed to scroll.
Manuel Selva
http://manuelselva.wordpress.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02006 seconds