infinite zoom + zoom tool [message #110247] |
Mon, 29 December 2003 17:48  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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 #123477 is a reply to message #123280] |
Mon, 22 March 2004 08:16  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.04970 seconds