Skip to main content



      Home
Home » Eclipse Projects » GEF » infinite zoom + zoom tool
infinite zoom + zoom tool [message #110247] Mon, 29 December 2003 17:48 Go to next message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

I'm building an editor which displays a graph. The number of zoom levels
required and the actual zoom percentages cannot be determined beforehand.

I would like to support a possibly infinite zoom in and zoom out. Right now
we can only zoom to discrete positions which were passed to
ZoomManager#setZoomValues. I don't mind the discrete steps, but I would like
it to be infinite in both directions.

Since zooming is an important activity in a graph displaying tool; I would
like to include a ZoomTool (something like the selectionTool) which allows
me to click on the diagram and thus zoom it in or out. Also a marquee based
zoom would be cool (select a region and that region zooms to the size of
your viewport).

Any suggestions on how I can go about implementing this ?
Thanks,
Brian.
Re: infinite zoom + zoom tool [message #110260 is a reply to message #110247] Mon, 29 December 2003 22:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

For "infinite" zoom, you'll probably want to use some form of floating-point
coordinates. If you use integers, as you zoom in, you start to see
grid-like placement since you can only place things at zoomed integer
locations. So at 1600%, that would be every sixteen pixels.

To do this, you'd have to implement zoom functionality inside a special
double-precision XYLayout which knows about a scaling factor. For many
people, a "free" zoom is good enough, and that is what GEF has provided.
But something like this needs a more involved scaling mechanism.

Do you really need unlimited zoom amounts? I've never seen something like
this. Usually at some point you'd be going inside another structure, and
could reset the input to your viewer.

"Brian Fernandes" <brian.fernandes@codito.com> wrote in message
news:bsqa0i$k3r$1@eclipse.org...
> I'm building an editor which displays a graph. The number of zoom levels
> required and the actual zoom percentages cannot be determined beforehand.
>
> I would like to support a possibly infinite zoom in and zoom out. Right
now
> we can only zoom to discrete positions which were passed to
> ZoomManager#setZoomValues. I don't mind the discrete steps, but I would
like
> it to be infinite in both directions.
>
> Since zooming is an important activity in a graph displaying tool; I would
> like to include a ZoomTool (something like the selectionTool) which allows
> me to click on the diagram and thus zoom it in or out. Also a marquee
based
> zoom would be cool (select a region and that region zooms to the size of
> your viewport).
>
> Any suggestions on how I can go about implementing this ?
> Thanks,
> Brian.
>
>
>
>
Re: infinite zoom + zoom tool [message #110273 is a reply to message #110260] Mon, 29 December 2003 22:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

"Randy Hudson" <none@us.ibm.com> wrote in message
news:bsqq2g$1il$1@eclipse.org...
> For "infinite" zoom, you'll probably want to use some form of
floating-point
> coordinates. If you use integers, as you zoom in, you start to see
> grid-like placement since you can only place things at zoomed integer
> locations. So at 1600%, that would be every sixteen pixels.
>
okay; that could be a problem - I'll check and see whether the error is
acceptable.

> To do this, you'd have to implement zoom functionality inside a special
> double-precision XYLayout which knows about a scaling factor. For many
> people, a "free" zoom is good enough, and that is what GEF has provided.
> But something like this needs a more involved scaling mechanism.


>
> Do you really need unlimited zoom amounts? I've never seen something like
> this. Usually at some point you'd be going inside another structure, and
> could reset the input to your viewer.
>

Well, I'm drawing really huge graphs (gantt charts) - they are quite large
along the horizontal axis. Even after scaling down the coordinates by about
2000 I get a diagram that is about 20000 pixels wide. So to get an overall
picture I would like to zoom out a lot.

On the other hand, there are a lot of gantt bars in the same chart that are
quite small in length and to view them properly you might want to zoom in.

Since I'm scaling the input anyway, I suppose I could implement my own
zooming by changing the scaling factor and then refreshing the entire
diagram. Do you think this is a better approach instead of pottering about
with a specialized XYLayout ?

What about the ZoomTool ? I assume to use a tool (I need both selection and
zooming) I have to use a palette ? Right now I don't need a palette because
selection is enough; but if I need to put in the ZoomTool ? Do I subclass
AbstractTool to create my ZoomTool ?

Thanks,
Brian
Re: infinite zoom + zoom tool [message #110285 is a reply to message #110273] Mon, 29 December 2003 22:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

It sounds like you might want to consider zooming along a single axis only.
The free zooming which we offer is not always the best solution. The
primary motivation for implementing our type of zoom was to support
printing.

"Brian Fernandes" <brian.fernandes@codito.com> wrote in message
news:bsqrdf$2hf$1@eclipse.org...
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:bsqq2g$1il$1@eclipse.org...
> > For "infinite" zoom, you'll probably want to use some form of
> floating-point
> > coordinates. If you use integers, as you zoom in, you start to see
> > grid-like placement since you can only place things at zoomed integer
> > locations. So at 1600%, that would be every sixteen pixels.
> >
> okay; that could be a problem - I'll check and see whether the error is
> acceptable.
>
> > To do this, you'd have to implement zoom functionality inside a special
> > double-precision XYLayout which knows about a scaling factor. For many
> > people, a "free" zoom is good enough, and that is what GEF has provided.
> > But something like this needs a more involved scaling mechanism.
>
>
> >
> > Do you really need unlimited zoom amounts? I've never seen something
like
> > this. Usually at some point you'd be going inside another structure,
and
> > could reset the input to your viewer.
> >
>
> Well, I'm drawing really huge graphs (gantt charts) - they are quite large
> along the horizontal axis. Even after scaling down the coordinates by
about
> 2000 I get a diagram that is about 20000 pixels wide. So to get an overall
> picture I would like to zoom out a lot.
>
> On the other hand, there are a lot of gantt bars in the same chart that
are
> quite small in length and to view them properly you might want to zoom in.
>
> Since I'm scaling the input anyway, I suppose I could implement my own
> zooming by changing the scaling factor and then refreshing the entire
> diagram. Do you think this is a better approach instead of pottering about
> with a specialized XYLayout ?
>
> What about the ZoomTool ? I assume to use a tool (I need both selection
and
> zooming) I have to use a palette ? Right now I don't need a palette
because
> selection is enough; but if I need to put in the ZoomTool ? Do I subclass
> AbstractTool to create my ZoomTool ?
>
> Thanks,
> Brian
>
>
Re: infinite zoom + zoom tool [message #110501 is a reply to message #110285] Sat, 03 January 2004 05:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

I do need to zoom only along the X axis - that's right.
Also, the accuracy provided by the inbuilt zooming is more or less
acceptable - what pushes me to use this is that it is much faster than me
changing the scale of my editparts and forcing them to redraw.

I had to hack around a lot to get the zoom working in the X direction only -
this is what I had to do.
I saw that ultimately I had to change ScalableGraphics so that it scales
only in X. Which means I had to subclass ScalableLayeredPane and
ScalableRootEditPart in turn.

I had to first subclass ScalableRootEditPart so that it uses my
XScalableLayeredPane and not the default ScalableLayeredPane. But because of
the private layers (innerLayers , printableLayers) I ended up copying most
of the implementation from ScalableRootEditPart.

Again for my XScalableLayeredPane, because the "scale" member was private, I
had to copy most of the implementation from ScalableLayeredPane and make a
few corrections.

Finally because of so many private members in ScalableGraphics, I had to
simply copy its implementation (instead of cleanly extending it) into my
XScalableGraphics and make a few changes.

I'd definitely like to avoid all this hacking AND copying code from GEF - is
there a better way ?

Thanks,
Brian.
Re: infinite zoom + zoom tool [message #123280 is a reply to message #110501] Sat, 20 March 2004 13:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: const.NOSPAM.users.sourceforge.net

BTW how do you plan to deal with text in Gantt chart in your horizontal
scalling? Most Gantt charts controls that I have seen allows some text
to be attached to tasks on charts. For example, MS Project attaches
resource names and their load.

Constantine


Brian Fernandes wrote:
> I do need to zoom only along the X axis - that's right.
> Also, the accuracy provided by the inbuilt zooming is more or less
> acceptable - what pushes me to use this is that it is much faster than me
> changing the scale of my editparts and forcing them to redraw.
>
> I had to hack around a lot to get the zoom working in the X direction only -
> this is what I had to do.
> I saw that ultimately I had to change ScalableGraphics so that it scales
> only in X. Which means I had to subclass ScalableLayeredPane and
> ScalableRootEditPart in turn.
>
> I had to first subclass ScalableRootEditPart so that it uses my
> XScalableLayeredPane and not the default ScalableLayeredPane. But because of
> the private layers (innerLayers , printableLayers) I ended up copying most
> of the implementation from ScalableRootEditPart.
>
> Again for my XScalableLayeredPane, because the "scale" member was private, I
> had to copy most of the implementation from ScalableLayeredPane and make a
> few corrections.
>
> Finally because of so many private members in ScalableGraphics, I had to
> simply copy its implementation (instead of cleanly extending it) into my
> XScalableGraphics and make a few changes.
>
> I'd definitely like to avoid all this hacking AND copying code from GEF - is
> there a better way ?
>
> Thanks,
> Brian.
>
>
Re: infinite zoom + zoom tool [message #123477 is a reply to message #123280] Mon, 22 March 2004 08:16 Go to previous message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

> BTW how do you plan to deal with text in Gantt chart in your horizontal
> scalling?

Good point - but I don't display text on the chart, simply becuase there is
too much to display . So I display some of it using Draw2d tooltips and the
rest of the information is displayed when you select the EditPart in the
PropertyView.

I suppose when some text needs to be displayed - I just won't magnify the
text - but I will correct the co-ordinates so that it is displayed at the
right positions.

Come to think of it, becuase my gantt chart has editparts which vary in
length - some are as wide at 5 pixels and the others might span 20K pixels -
displaying text on mousover might be my permanent solution.

Appreciate the interest,

Brian.
Previous Topic:Hooking into CopyRetargetAction
Next Topic:Reflection Problems
Goto Forum:
  


Current Time: Tue Jul 22 14:03:44 EDT 2025

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

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

Back to the top