Pan and zoom navigation history

View: New views
9 Messages — Rating Filter:   Alert me  

Pan and zoom navigation history

by Luc_B :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello all,

I am trying to implement a back / forward history in the svg whenever a user has panned or zoomed.

I have tried to reuse the TransformHistory class from the SVGBrowser but they seem to only store the RenderingTransform at load. I need more than that.

I want to know what AffineTransform should I store so when the user hits back in order to show him where he was before.

I am also wondering how to restore the svg view to that specific point...

Thanks for all your help,
Luc

Re: Pan and zoom navigation history

by Luc_B :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Anyone can refer me to any source or pointer?

Anyone?
Luc_B wrote:
Hello all,

I am trying to implement a back / forward history in the svg whenever a user has panned or zoomed.

I have tried to reuse the TransformHistory class from the SVGBrowser but they seem to only store the RenderingTransform at load. I need more than that.

I want to know what AffineTransform should I store so when the user hits back in order to show him where he was before.

I am also wondering how to restore the svg view to that specific point...

Thanks for all your help,
Luc

Re: Pan and zoom navigation history

by thomas.deweese :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Luc,

> Luc_B wrote:
> >
> > I am trying to implement a back / forward history in the svg whenever a
> > user has panned or zoomed.
> >
> > I have tried to reuse the TransformHistory class from the SVGBrowser but
> > they seem to only store the RenderingTransform at load. I need more than
> > that.


   In my tests it records all my pan and zoom actions.  Are you including
the code from the JSVGViewerFrame that notifies the history class of
transform changes?

> > I want to know what AffineTransform should I store so when the user hits
> > back in order to show him where he was before.

    'canvas.getRenderingTransform()'.

> > I am also wondering how to restore the svg view to that specific point...

    'canvas.setRenderingTransform( affine );'

    This is all in the JSVGViewerFrame class already.  Just look for all
the lines with 'transformHistory'.

Re: Pan and zoom navigation history

by Luc_B :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello again,

Ok I did some tests with the svg browser. In the view menu you have a "previous transform" and a "next transform" menu items.

So I did my test by choosing the "Transform..." menu item. I did a bunch of transforms and the next and previous menu item would never become enabled...

This did not work until I clicked on the Stop button that I noticed was enabled. Then all my transformations would trigger the gvtRenderingCompleted event and therefor update the transformHistory object...

Why is my SVG enabling the Stop button and others don`t because that seems to be my problem.

Thanks a lot,
Luc

thomas.deweese wrote:
Hi Luc,

> Luc_B wrote:
> >
> > I am trying to implement a back / forward history in the svg whenever
a
> > user has panned or zoomed.
> >
> > I have tried to reuse the TransformHistory class from the SVGBrowser
but
> > they seem to only store the RenderingTransform at load. I need more
than
> > that.

   In my tests it records all my pan and zoom actions.  Are you including
the code from the JSVGViewerFrame that notifies the history class of
transform changes?

> > I want to know what AffineTransform should I store so when the user
hits
> > back in order to show him where he was before.

    'canvas.getRenderingTransform()'.

> > I am also wondering how to restore the svg view to that specific
point...

    'canvas.setRenderingTransform( affine );'

    This is all in the JSVGViewerFrame class already.  Just look for all
the lines with 'transformHistory'.

Re: Pan and zoom navigation history

by thomas.deweese :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Luc,

Luc_B <lucbard@...> wrote on 06/29/2009 04:03:39 PM:

> So I did my test by choosing the "Transform..." menu item. I did a bunch of
> transforms and the next and previous menu item would never become enabled...
>
> This did not work until I clicked on the Stop button that I noticed was
> enabled. Then all my transformations would trigger the gvtRenderingCompleted
> event and therefor update the transformHistory object...

   Ok, I see the problem.  It used to be that all rendering transform
changes caused a gvtRenderingComplete, that is no longer the case for
'interactive' documents - i.e. ones with script and/or animation.  So
the right thing to do now is to register a JGVTComponentListener with
the canvas to catch componentTransformChanged events instead.

> thomas.deweese wrote:
> >
> > Hi Luc,
> >
> >> Luc_B wrote:
> >> >
> >> > I am trying to implement a back / forward history in the svg whenever
> > a
> >> > user has panned or zoomed.
> >> >
> >> > I have tried to reuse the TransformHistory class from the SVGBrowser
> > but
> >> > they seem to only store the RenderingTransform at load. I need more
> > than
> >> > that.
> >
> >    In my tests it records all my pan and zoom actions.  Are you including
> > the code from the JSVGViewerFrame that notifies the history class of
> > transform changes?
> >
> >> > I want to know what AffineTransform should I store so when the user
> > hits
> >> > back in order to show him where he was before.
> >
> >     'canvas.getRenderingTransform()'.
> >
> >> > I am also wondering how to restore the svg view to that specific
> > point...
> >
> >     'canvas.setRenderingTransform( affine );'
> >
> >     This is all in the JSVGViewerFrame class already.  Just look for all
> > the lines with 'transformHistory'.
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Pan-and-zoom-
> navigation-history-tp24074338p24260583.html
> Sent from the Batik - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@...
> For additional commands, e-mail: batik-users-help@...
>

Re: Pan and zoom navigation history

by Luc_B :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you Thomas for your quick answer.

I got it working except for one thing which is major for me. Let me explain. All transformations such as zoom and pan are working fine with the history now.

My only problem is views. Whenever I set a new view via
canvas.setFragmentIdentifier("MyView");

It will be stored into the history but when I hit back it brings me back but not at the same zoom level I was prior to calling setFragmentIdentifier.

If I can nail this one I will be a happy camper :)

I suspect I need in this case to store the ViewBoxTransform in history instead of the RederingTransform

But if so how can I distinguish between a regular interaction(zoom, pan)  and a setFragmentIdentifier call?

Thanks again,
Luc
thomas.deweese wrote:
Hi Luc,

Luc_B <lucbard@gmail.com> wrote on 06/29/2009 04:03:39 PM:

> So I did my test by choosing the "Transform..." menu item. I did a bunch
of
> transforms and the next and previous menu item would never become
enabled...
>
> This did not work until I clicked on the Stop button that I noticed was
> enabled. Then all my transformations would trigger the
gvtRenderingCompleted
> event and therefor update the transformHistory object...

   Ok, I see the problem.  It used to be that all rendering transform
changes caused a gvtRenderingComplete, that is no longer the case for
'interactive' documents - i.e. ones with script and/or animation.  So
the right thing to do now is to register a JGVTComponentListener with
the canvas to catch componentTransformChanged events instead.

> thomas.deweese wrote:
> >
> > Hi Luc,
> >
> >> Luc_B wrote:
> >> >
> >> > I am trying to implement a back / forward history in the svg
whenever
> > a
> >> > user has panned or zoomed.
> >> >
> >> > I have tried to reuse the TransformHistory class from the
SVGBrowser
> > but
> >> > they seem to only store the RenderingTransform at load. I need more

> > than
> >> > that.
> >
> >    In my tests it records all my pan and zoom actions.  Are you
including
> > the code from the JSVGViewerFrame that notifies the history class of
> > transform changes?
> >
> >> > I want to know what AffineTransform should I store so when the user

> > hits
> >> > back in order to show him where he was before.
> >
> >     'canvas.getRenderingTransform()'.
> >
> >> > I am also wondering how to restore the svg view to that specific
> > point...
> >
> >     'canvas.setRenderingTransform( affine );'
> >
> >     This is all in the JSVGViewerFrame class already.  Just look for
all
> > the lines with 'transformHistory'.
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Pan-and-zoom-
> navigation-history-tp24074338p24260583.html
> Sent from the Batik - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>

Re: Pan and zoom navigation history

by thomas.deweese :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Luc,

Luc_B <lucbard@...> wrote on 06/30/2009 03:43:57 PM:

> I got it working except for one thing which is major for me. Let me explain.
> All transformations such as zoom and pan are working fine with the history
> now.
>
> My only problem is views. Whenever I set a new view via
> canvas.setFragmentIdentifier("MyView");
>
> It will be stored into the history but when I hit back it brings me back but
> not at the same zoom level I was prior to calling setFragmentIdentifier.

   This is because setting the fragment identifier clears the rendering
transform (this is done because in general the fragment identifier specifies
a viewbox).  You may need to provide your own version of the setFragmentIdent
that incorporates the renderingTransform you want - in particular replace
the call to computeRenderingTransform such that initalTransform is replaced
with your desired history transform.

> I suspect I need in this case to store the ViewBoxTransform in history
> instead of the RederingTransform

   I don't think this is needed, you just need to install both.

>
> But if so how can I distinguish between a regular interaction(zoom, pan)
> and a setFragmentIdentifier call?
>
> Thanks again,
> Luc
>
> thomas.deweese wrote:
> >
> > Hi Luc,
> >
> > Luc_B <lucbard@...> wrote on 06/29/2009 04:03:39 PM:
> >
> >> So I did my test by choosing the "Transform..." menu item. I did a bunch
> > of
> >> transforms and the next and previous menu item would never become
> > enabled...
> >>
> >> This did not work until I clicked on the Stop button that I noticed was
> >> enabled. Then all my transformations would trigger the
> > gvtRenderingCompleted
> >> event and therefor update the transformHistory object...
> >
> >    Ok, I see the problem.  It used to be that all rendering transform
> > changes caused a gvtRenderingComplete, that is no longer the case for
> > 'interactive' documents - i.e. ones with script and/or animation.  So
> > the right thing to do now is to register a JGVTComponentListener with
> > the canvas to catch componentTransformChanged events instead.
> >
> >> thomas.deweese wrote:
> >> >
> >> > Hi Luc,
> >> >
> >> >> Luc_B wrote:
> >> >> >
> >> >> > I am trying to implement a back / forward history in the svg
> > whenever
> >> > a
> >> >> > user has panned or zoomed.
> >> >> >
> >> >> > I have tried to reuse the TransformHistory class from the
> > SVGBrowser
> >> > but
> >> >> > they seem to only store the RenderingTransform at load. I need more
> >
> >> > than
> >> >> > that.
> >> >
> >> >    In my tests it records all my pan and zoom actions.  Are you
> > including
> >> > the code from the JSVGViewerFrame that notifies the history class of
> >> > transform changes?
> >> >
> >> >> > I want to know what AffineTransform should I store so when the user
> >
> >> > hits
> >> >> > back in order to show him where he was before.
> >> >
> >> >     'canvas.getRenderingTransform()'.
> >> >
> >> >> > I am also wondering how to restore the svg view to that specific
> >> > point...
> >> >
> >> >     'canvas.setRenderingTransform( affine );'
> >> >
> >> >     This is all in the JSVGViewerFrame class already.  Just look for
> > all
> >> > the lines with 'transformHistory'.
> >> >
> >> >
> >>
> >> --
> >> View this message in context: http://www.nabble.com/Pan-and-zoom-
> >> navigation-history-tp24074338p24260583.html
> >> Sent from the Batik - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: batik-users-unsubscribe@...
> >> For additional commands, e-mail: batik-users-help@...
> >>
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Pan-and-zoom-
> navigation-history-tp24074338p24277832.html
> Sent from the Batik - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@...
> For additional commands, e-mail: batik-users-help@...
>

Re: Pan and zoom navigation history

by Luc_B :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

How do I implement My own setFragmentIdentifiyer ?

Sorry I don't have good knowledge of Tranforms is there an example on that?
thomas.deweese wrote:
Hi Luc,

Luc_B <lucbard@gmail.com> wrote on 06/30/2009 03:43:57 PM:

> I got it working except for one thing which is major for me. Let me
explain.
> All transformations such as zoom and pan are working fine with the
history
> now.
>
> My only problem is views. Whenever I set a new view via
> canvas.setFragmentIdentifier("MyView");
>
> It will be stored into the history but when I hit back it brings me back
but
> not at the same zoom level I was prior to calling setFragmentIdentifier.

   This is because setting the fragment identifier clears the rendering
transform (this is done because in general the fragment identifier
specifies
a viewbox).  You may need to provide your own version of the
setFragmentIdent
that incorporates the renderingTransform you want - in particular replace
the call to computeRenderingTransform such that initalTransform is
replaced
with your desired history transform.

> I suspect I need in this case to store the ViewBoxTransform in history
> instead of the RederingTransform

   I don't think this is needed, you just need to install both.

>
> But if so how can I distinguish between a regular interaction(zoom, pan)

> and a setFragmentIdentifier call?
>
> Thanks again,
> Luc
>
> thomas.deweese wrote:
> >
> > Hi Luc,
> >
> > Luc_B <lucbard@gmail.com> wrote on 06/29/2009 04:03:39 PM:
> >
> >> So I did my test by choosing the "Transform..." menu item. I did a
bunch
> > of
> >> transforms and the next and previous menu item would never become
> > enabled...
> >>
> >> This did not work until I clicked on the Stop button that I noticed
was
> >> enabled. Then all my transformations would trigger the
> > gvtRenderingCompleted
> >> event and therefor update the transformHistory object...
> >
> >    Ok, I see the problem.  It used to be that all rendering transform
> > changes caused a gvtRenderingComplete, that is no longer the case for
> > 'interactive' documents - i.e. ones with script and/or animation.  So
> > the right thing to do now is to register a JGVTComponentListener with
> > the canvas to catch componentTransformChanged events instead.
> >
> >> thomas.deweese wrote:
> >> >
> >> > Hi Luc,
> >> >
> >> >> Luc_B wrote:
> >> >> >
> >> >> > I am trying to implement a back / forward history in the svg
> > whenever
> >> > a
> >> >> > user has panned or zoomed.
> >> >> >
> >> >> > I have tried to reuse the TransformHistory class from the
> > SVGBrowser
> >> > but
> >> >> > they seem to only store the RenderingTransform at load. I need
more
> >
> >> > than
> >> >> > that.
> >> >
> >> >    In my tests it records all my pan and zoom actions.  Are you
> > including
> >> > the code from the JSVGViewerFrame that notifies the history class
of
> >> > transform changes?
> >> >
> >> >> > I want to know what AffineTransform should I store so when the
user
> >
> >> > hits
> >> >> > back in order to show him where he was before.
> >> >
> >> >     'canvas.getRenderingTransform()'.
> >> >
> >> >> > I am also wondering how to restore the svg view to that specific

> >> > point...
> >> >
> >> >     'canvas.setRenderingTransform( affine );'
> >> >
> >> >     This is all in the JSVGViewerFrame class already.  Just look
for
> > all
> >> > the lines with 'transformHistory'.
> >> >
> >> >
> >>
> >> --
> >> View this message in context: http://www.nabble.com/Pan-and-zoom-
> >> navigation-history-tp24074338p24260583.html
> >> Sent from the Batik - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
batik-users-unsubscribe@xmlgraphics.apache.org
> >> For additional commands, e-mail:
batik-users-help@xmlgraphics.apache.org
> >>
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Pan-and-zoom-
> navigation-history-tp24074338p24277832.html
> Sent from the Batik - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>

Re: Pan and zoom navigation history

by thomas.deweese :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Luc,

Luc_B <lucbard@...> wrote on 07/02/2009 11:03:14 AM:

> How do I implement My own setFragmentIdentifiyer ?

   Subclass the JSVGCanvas and override the method.

> Sorry I don't have good knowledge of Tranforms is there an example on that?

   Search the net for "Affine Transform".

> thomas.deweese wrote:
> >
> > Hi Luc,
> >
> > Luc_B <lucbard@...> wrote on 06/30/2009 03:43:57 PM:
> >
> >> I got it working except for one thing which is major for me. Let me
> > explain.
> >> All transformations such as zoom and pan are working fine with the
> > history
> >> now.
> >>
> >> My only problem is views. Whenever I set a new view via
> >> canvas.setFragmentIdentifier("MyView");
> >>
> >> It will be stored into the history but when I hit back it brings me back
> > but
> >> not at the same zoom level I was prior to calling setFragmentIdentifier.
> >
> >    This is because setting the fragment identifier clears the rendering
> > transform (this is done because in general the fragment identifier
> > specifies
> > a viewbox).  You may need to provide your own version of the
> > setFragmentIdent
> > that incorporates the renderingTransform you want - in particular replace
> > the call to computeRenderingTransform such that initalTransform is
> > replaced
> > with your desired history transform.
> >
> >> I suspect I need in this case to store the ViewBoxTransform in history
> >> instead of the RederingTransform
> >
> >    I don't think this is needed, you just need to install both.
> >
> >>
> >> But if so how can I distinguish between a regular interaction(zoom, pan)
> >
> >> and a setFragmentIdentifier call?
> >>
> >> Thanks again,
> >> Luc
> >>
> >> thomas.deweese wrote:
> >> >
> >> > Hi Luc,
> >> >
> >> > Luc_B <lucbard@...> wrote on 06/29/2009 04:03:39 PM:
> >> >
> >> >> So I did my test by choosing the "Transform..." menu item. I did a
> > bunch
> >> > of
> >> >> transforms and the next and previous menu item would never become
> >> > enabled...
> >> >>
> >> >> This did not work until I clicked on the Stop button that I noticed
> > was
> >> >> enabled. Then all my transformations would trigger the
> >> > gvtRenderingCompleted
> >> >> event and therefor update the transformHistory object...
> >> >
> >> >    Ok, I see the problem.  It used to be that all rendering transform
> >> > changes caused a gvtRenderingComplete, that is no longer the case for
> >> > 'interactive' documents - i.e. ones with script and/or animation.  So
> >> > the right thing to do now is to register a JGVTComponentListener with
> >> > the canvas to catch componentTransformChanged events instead.
> >> >
> >> >> thomas.deweese wrote:
> >> >> >
> >> >> > Hi Luc,
> >> >> >
> >> >> >> Luc_B wrote:
> >> >> >> >
> >> >> >> > I am trying to implement a back / forward history in the svg
> >> > whenever
> >> >> > a
> >> >> >> > user has panned or zoomed.
> >> >> >> >
> >> >> >> > I have tried to reuse the TransformHistory class from the
> >> > SVGBrowser
> >> >> > but
> >> >> >> > they seem to only store the RenderingTransform at load. I need
> > more
> >> >
> >> >> > than
> >> >> >> > that.
> >> >> >
> >> >> >    In my tests it records all my pan and zoom actions.  Are you
> >> > including
> >> >> > the code from the JSVGViewerFrame that notifies the history class
> > of
> >> >> > transform changes?
> >> >> >
> >> >> >> > I want to know what AffineTransform should I store so when the
> > user
> >> >
> >> >> > hits
> >> >> >> > back in order to show him where he was before.
> >> >> >
> >> >> >     'canvas.getRenderingTransform()'.
> >> >> >
> >> >> >> > I am also wondering how to restore the svg view to that specific
> >
> >> >> > point...
> >> >> >
> >> >> >     'canvas.setRenderingTransform( affine );'
> >> >> >
> >> >> >     This is all in the JSVGViewerFrame class already.  Just look
> > for
> >> > all
> >> >> > the lines with 'transformHistory'.
> >> >> >
> >> >> >
> >> >>
> >> >> --
> >> >> View this message in context: http://www.nabble.com/Pan-and-zoom-
> >> >> navigation-history-tp24074338p24260583.html
> >> >> Sent from the Batik - Users mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail:
> > batik-users-unsubscribe@...
> >> >> For additional commands, e-mail:
> > batik-users-help@...
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context: http://www.nabble.com/Pan-and-zoom-
> >> navigation-history-tp24074338p24277832.html
> >> Sent from the Batik - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: batik-users-unsubscribe@...
> >> For additional commands, e-mail: batik-users-help@...
> >>
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Pan-and-zoom-
> navigation-history-tp24074338p24308395.html
> Sent from the Batik - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@...
> For additional commands, e-mail: batik-users-help@...
>