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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Sunday, January 22, 2006 2:12 PM
To: [email protected]
Cc: [email protected]
Subject: RE: "Refreshing" the JSVGCanvas...

Hi Michael,

"Bishop, Michael W. CONTR J9C880" <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Sat 1/21/2006 6:12 PM
> To: [email protected]
> Cc: [email protected]
> Subject: RE: "Refreshing" the JSVGCanvas...
> 
> 
> 
> Hi Michael,
> 
> "Bishop, Michael W. CONTR J9C880" <[EMAIL PROTECTED]> 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:[EMAIL PROTECTED]
> > Sent: Sat 1/21/2006 12:51 AM
> > To: [email protected]
> > 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:
[EMAIL PROTECTED]
> > For additional commands, e-mail: 
[EMAIL PROTECTED]
> >
> >
> > [attachment "winmail.dat" deleted by Thomas E. DeWeese/449433/EKC]
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
[EMAIL PROTECTED]
> > For additional commands, e-mail: 
[EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
[EMAIL PROTECTED]
> 
> 
> 
> [attachment "winmail.dat" deleted by Thomas E. DeWeese/449433/EKC] 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to