Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Figure always on top
Figure always on top [message #230817] Mon, 19 February 2007 14:22 Go to next message
Manuel Selva is currently offline Manuel SelvaFriend
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


Re: Figure always on top [message #230832 is a reply to message #230817] Mon, 19 February 2007 22:47 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 08:23 Go to previous messageGo to next message
Manuel Selva is currently offline Manuel SelvaFriend
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


Re: Figure always on top [message #231067 is a reply to message #230924] Mon, 26 February 2007 15:16 Go to previous messageGo to next message
Manuel Selva is currently offline Manuel SelvaFriend
Messages: 189
Registered: July 2009
Location: Grenoble, France
Senior Member
Hi Randy,

An enhancement request has been opened for this capability

Number: 175530

URL: https://bugs.eclipse.org/bugs/show_bug.cgi?id=175530


Re: Figure always on top [message #231121 is a reply to message #230901] Tue, 27 February 2007 09:20 Go to previous messageGo to next message
Manuel Selva is currently offline Manuel SelvaFriend
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


Re: Figure always on top [message #231129 is a reply to message #230832] Tue, 27 February 2007 09:39 Go to previous messageGo to next message
Manuel Selva is currently offline Manuel SelvaFriend
Messages: 189
Registered: July 2009
Location: Grenoble, France
Senior Member
Hi,

What example are you talking about ? And wath is exactly a ruler, i am not
sure to have it ??

Thanks

Manuel Selva


Re: Figure always on top [message #231208 is a reply to message #230817] Wed, 28 February 2007 14:24 Go to previous message
Manuel Selva is currently offline Manuel SelvaFriend
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


Previous Topic:PalleteFactory
Next Topic:HTML like WYSWYG Editor in GEF
Goto Forum:
  


Current Time: Tue Apr 23 08:17:04 GMT 2024

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

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

Back to the top