Figure always on top [message #230817] |
Mon, 19 February 2007 14: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 22:47 |
Eclipse User |
|
|
|
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 06:41 |
Eclipse User |
|
|
|
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 16:05 |
Eclipse User |
|
|
|
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 #231208 is a reply to message #230817] |
Wed, 28 February 2007 14: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.05615 seconds