You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by "Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> on 2006/02/03 15:06:36 UTC
RE: "Refreshing" the JSVGCanvas...
Revisiting this point, I did add a refresh button because it was
requested. If I refresh the canvas (using setDocument() instead of
setURI() since I'm working with a document in memory), it resets the
view transform. If the user is zoomed/panned, it gets reset. Is there
a way to refresh a document, then restore their view transform?
Michael Bishop
-----Original Message-----
From: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com]
Sent: Sunday, January 22, 2006 2:12 PM
To: batik-users@xmlgraphics.apache.org
Cc: batik-users@xmlgraphics.apache.org
Subject: RE: "Refreshing" the JSVGCanvas...
Hi Michael,
"Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> wrote on
01/22/2006 12:31:54 AM:
> Yes, I'm using JSVGScrollPane. I get all kinds of weirdness. If I
zoom
in
> (triggering the "default" zoom action JSVGCanvas.ZoomInAction), it
puts
scroll
> bars on the JSVGCanvas. So far, so good. Zooming back out (again
with
> default JSVGCanvas.ZoomOutAction), does not remove the scroll bars.
Zooming
> out once more will.
Hmmm, these sound like some bugs that I fixed in the scroll pane.
You might try the SVN version if you aren't using it already...
> But that's no major issue. It's the lack of screen
> updates (I won't say repaint() since JSVGCanvas.repaint() IS called)
which is
> the real frequent problem-causer.
The problem is that if repaint is being called then it is drawing
what it has... One way to force a redraw is to tweak the scale of
the renderingTransform on the Canvas. But I suspect there is something
really wrong here...
> From: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com]
> Sent: Sat 1/21/2006 6:12 PM
> To: batik-users@xmlgraphics.apache.org
> Cc: batik-users@xmlgraphics.apache.org
> Subject: RE: "Refreshing" the JSVGCanvas...
>
>
>
> Hi Michael,
>
> "Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> wrote
on
> 01/21/2006 06:03:36 PM:
>
> > setURI() is a good idea. I never ran into issues with the
JSVGCanvas
> painting
> > correctly until I added scroll bars. It seems that if I zoom in or
out
> on my
> > application, then try to draw (add data to the document), nothing
> appears on
> > the canvas until I move the scroll bars.
>
> What scroll bars are you using? JSVGScrollPane?
>
> > I did a little debugging and it turns out that repaint() on the
canvas
> IS
> > being called. It just doesn't show on the screen until I move a
scroll
> > bar. Any idea how that could be related?
>
> Well I am unsure how well the Canvas will work with the
> standard JScrollPane.
>
> >
> > Michael Bishop
> >
> > ________________________________
> >
> > From: Andrew Plotkin [mailto:erkyrath@eblong.com]
> > Sent: Sat 1/21/2006 12:51 AM
> > To: batik-users@xmlgraphics.apache.org
> > Subject: Re: "Refreshing" the JSVGCanvas...
> >
> >
> >
> > On Fri, 20 Jan 2006, Bishop, Michael W. CONTR J9C880 wrote:
> >
> > > Is there a way to refresh the JSVGCanvas? Basically tell it to
> > > re-render the entire document? I'm thinking repaint(); but I
don't
> know
> > > how that's implemented in the JSVGCanvas, so I figured I'd ask to
make
> > > sure it really does redraw the entire document.
> >
> > If you used setURI() to load the SVG in the first place, you can
call
it
> > again with the same argument.
> >
> > However, if you're manipulating the canvas correctly (i.e., from the
> right
> > thread) you shouldn't need to do any redraws. I've always found that
it
> > redraws itself when necessary, *unless* I had thread bugs.
> >
> > (I only use the setURI() trick when the file on disk has changed,
and
I
> > want to reload it.)
> >
> > --Z
> >
> > --
> > "And Aholibamah bare Jeush, and Jaalam, and Korah: these were the
> borogoves..."
> > *
> > Just because you vote for the Republicans, doesn't mean they let you
be
> one.
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
batik-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail:
batik-users-help@xmlgraphics.apache.org
> >
> >
> > [attachment "winmail.dat" deleted by Thomas E. DeWeese/449433/EKC]
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
batik-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail:
batik-users-help@xmlgraphics.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail:
batik-users-help@xmlgraphics.apache.org
>
>
>
> [attachment "winmail.dat" deleted by Thomas E. DeWeese/449433/EKC]
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail:
batik-users-help@xmlgraphics.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
RE: "Refreshing" the JSVGCanvas...
Posted by Tonny Kohar <to...@kiyut.com>.
Hi,
On Fri, 2006-02-03 at 09:06 -0500, Bishop, Michael W. CONTR J9C880
wrote:
> Revisiting this point, I did add a refresh button because it was
> requested. If I refresh the canvas (using setDocument() instead of
> setURI() since I'm working with a document in memory), it resets the
> view transform. If the user is zoomed/panned, it gets reset. Is there
> a way to refresh a document, then restore their view transform?
I am not sure if the method below works
1) you need to get the current view transform before refresh
(setURI/setDocument)
2) Refresh the canvas
3) apply back the transform you acquired before to the canvas after
refreshing
Regards
Tonny Kohar
--
Sketsa
SVG Graphics Editor
http://www.kiyut.com
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org