Ruler on an EditPartViewer [message #3925] |
Thu, 23 May 2002 12:13  |
Eclipse User |
|
|
|
Originally posted by: chyliko.dev.disnet.cz
Hello everybody,
I'm currently working on an application that uses an EditPartViewer
(with overview) to display a grid-like structured data and I need the viewer
to have a horizontal ruler -- i.e. a top bar that displays the units,
scrolls horizontally with the viewer, but stays on it's place (visible) when
the view is scrolled vertically.
Is there any direct support in GEF to attain this? Or could you point me
to some examples/applications that may be helpful when finding out how to do
such thing?
I'd appreciate any response, thanks in advance.
Ondrej
|
|
|
|
|
|
Re: Ruler on an EditPartViewer [message #3987 is a reply to message #3981] |
Fri, 24 May 2002 13:14  |
Eclipse User |
|
|
|
Originally posted by: chyliko.dev.disnet.cz
> How will you be sure that the ruler width matches the Viewport's content's
> width?
I added following to the MyScrollPaneLayout.layout method:
IFigure ruler = ((Viewport) hRuler).getContents();
IFigure view = viewport.getContents();
ruler.setPreferredSize(new Dimension(view.getPreferredSize().width,
hRulerHeight));
These lines seem to ensure that the ruler width and the view (the viewport's
content) width match.
> I would probably do this as a Figure which paints ticks based on the
> RangeModel, and have the ruler just be the size of the viewport.
That means that the ruler figure would have to know that it's inside a
Viewport, doesn't it? My solution above can use simply any figure to be the
ruler. Am I right or is there some issue (performance maybe) I can't see?
> I'm just trying to imagine how Zoom will affect the ruler.
I don't know anything about how the zoom support is intended to be done, but
if it's a feature of the Viewport figure, couldn't the ScrollPane simply
synchronize the "ZoomModel" of the viewports (the main and those for
rulers), the same way it synchronizes their RangeModels now?
|
|
|
Powered by
FUDForum. Page generated in 0.08155 seconds