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 "Caesar Ralf (Fenrir) Franz Hoppen" <da...@gmail.com> on 2008/08/22 14:37:39 UTC

The Rendering problem

Hey list, how are you? I am new here, but anyway I'ven working with batik
for some time now. It's a great tool, but it is giving some problems that I
don't know why.

I have an application that dynammicaly loads SVGs to canvas, put them in
JSVGScrollpane and then in a JTabbedPane. The problem is that it simply
doesnt renders in some computers, what's really strange. Already checked the
application, java and batik version an they are all the same in all
computers. The documents are there, but they are simply not being rendered,
while in my computer and my tutors computer, for example, it renders.

So, what I want to ask is, someone imagine what the problem can be? Or is
there any way to force the JSVGCanvas to starts to render.

The code that I load the canvas in the tabbedpane  :

*JSVGCanvas canvas = data.getCanvas();
*
*JSVGScrollPane svgView = new JSVGScrollPane(canvas);*
* //adds *to the tabbed pane
*tabbedPane.add(data.getName(),svgView);*
*
*The creation of the JSVGCanvas code, this code is inside a thread that
creates the element, but they are added to the JSVGScrollPane
in the EDT Thread :

*JSVGCanvas canvas = new JSVGCanvas();
*
*          canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
          canvas.setURI(data.getSvgURI());

          canvas.setEnableImageZoomInteractor(false);
          canvas.setEnableZoomInteractor(false);*

-- 
What said Odin to the Gods and to the Champions who surrounded him? "We will
give our lives and let our world be destroyed, but we will battle so that
these evil powers will not live after us." Out of Hel's ship sprang Fenrir
the Wolf. His mouth gaped; his lower jaw hung against the earth, and his
upper jaw scraped the sky. Against the Wolf Odin All-Father fought...

...By Fenrir the Wolf Odin was slain.

Re: The Rendering problem

Posted by "Caesar Ralf (Fenrir) Franz Hoppen" <da...@gmail.com>.
Yes, I am doing this now, although the frame now is going to resize always
when the user loads a svg, but that can be fixed.

Thanks anyway, Caesar Ralf.

2008/8/27 <th...@kodak.com>

>
> Hi Caesar,
>
> "Caesar Ralf (Fenrir) Franz Hoppen" <da...@gmail.com> wrote on
> 08/26/2008 11:25:27 AM:
>
> > I got a solution, but it was kind of strange. I compiled everything
> > to a jar and executed it using java -Xms500 -Xmx800 myjar.jar and it
> > started to work as it should, rendering everything without problems.
>
>    So I believe the bug is still present, but since it's a race
> condition between building the document and swing putting the
> canvas into the frame you have simply shifted the likelihood of
> swing winning the race.  I strong suggest that you call pack on
> the frame once you are done building it.
>
>
> > 2008/8/26 <th...@kodak.com>
> >
> > Hi Caesar,
> >
> > "Caesar Ralf (Fenrir) Franz Hoppen" <da...@gmail.com> wrote
> > on 08/22/2008 08:37:39 AM:
> >
> >
> > > I have an application that dynammicaly loads SVGs to canvas, put
> > > them in JSVGScrollpane and then in a JTabbedPane. The problem is
> > > that it simply doesnt renders in some computers, what's really
> > > strange. Already checked the application, java and batik version an
> > > they are all the same in all computers. The documents are there, but
> > > they are simply not being rendered, while in my computer and my
> > > tutors computer, for example, it renders.
> >
> > > JSVGCanvas canvas = data.getCanvas();
> > > JSVGScrollPane svgView = new JSVGScrollPane(canvas);
> > >  //adds to the tabbed pane
> > > tabbedPane.add(data.getName(),svgView);
> > >
> > > The creation of the JSVGCanvas code, this code is inside a thread
> > > that creates the element, but they are added to the JSVGScrollPane
> > > in the EDT Thread :
> >
> > > JSVGCanvas canvas = new JSVGCanvas();
> > >           canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
> > >           canvas.setURI(data.getSvgURI());
> > >
> > >           canvas.setEnableImageZoomInteractor(false);
> > >           canvas.setEnableZoomInteractor(false);
>
> >   If you load the document before the canvas is in a window
> > it will size it's self to 1x1.  IIRC you can get it to resize
> > it's self by calling pack on the Frame that you put things
> > into.  You could also try not loading the document until you
> > have added the canvas to the frame that it will be in.
> >
> >
> >
> > --
> > What said Odin to the Gods and to the Champions who surrounded him?
> > "We will give our lives and let our world be destroyed, but we will
> > battle so that these evil powers will not live after us." Out of
> > Hel's ship sprang Fenrir the Wolf. His mouth gaped; his lower jaw
> > hung against the earth, and his upper jaw scraped the sky. Against
> > the Wolf Odin All-Father fought...
> >
> > ...By Fenrir the Wolf Odin was slain.
>



-- 
What said Odin to the Gods and to the Champions who surrounded him? "We will
give our lives and let our world be destroyed, but we will battle so that
these evil powers will not live after us." Out of Hel's ship sprang Fenrir
the Wolf. His mouth gaped; his lower jaw hung against the earth, and his
upper jaw scraped the sky. Against the Wolf Odin All-Father fought...

...By Fenrir the Wolf Odin was slain.

Re: The Rendering problem

Posted by th...@kodak.com.
Hi Caesar,

"Caesar Ralf (Fenrir) Franz Hoppen" <da...@gmail.com> wrote on 
08/26/2008 11:25:27 AM:

> I got a solution, but it was kind of strange. I compiled everything 
> to a jar and executed it using java -Xms500 -Xmx800 myjar.jar and it
> started to work as it should, rendering everything without problems. 

   So I believe the bug is still present, but since it's a race
condition between building the document and swing putting the
canvas into the frame you have simply shifted the likelihood of
swing winning the race.  I strong suggest that you call pack on
the frame once you are done building it.


> 2008/8/26 <th...@kodak.com>
> 
> Hi Caesar, 
> 
> "Caesar Ralf (Fenrir) Franz Hoppen" <da...@gmail.com> wrote
> on 08/22/2008 08:37:39 AM:
> 
> 
> > I have an application that dynammicaly loads SVGs to canvas, put 
> > them in JSVGScrollpane and then in a JTabbedPane. The problem is 
> > that it simply doesnt renders in some computers, what's really 
> > strange. Already checked the application, java and batik version an 
> > they are all the same in all computers. The documents are there, but
> > they are simply not being rendered, while in my computer and my 
> > tutors computer, for example, it renders. 
> 
> > JSVGCanvas canvas = data.getCanvas(); 
> > JSVGScrollPane svgView = new JSVGScrollPane(canvas); 
> >  //adds to the tabbed pane 
> > tabbedPane.add(data.getName(),svgView); 
> > 
> > The creation of the JSVGCanvas code, this code is inside a thread 
> > that creates the element, but they are added to the JSVGScrollPane
> > in the EDT Thread :
> 
> > JSVGCanvas canvas = new JSVGCanvas(); 
> >           canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
> >           canvas.setURI(data.getSvgURI()); 
> > 
> >           canvas.setEnableImageZoomInteractor(false);
> >           canvas.setEnableZoomInteractor(false);

>   If you load the document before the canvas is in a window 
> it will size it's self to 1x1.  IIRC you can get it to resize 
> it's self by calling pack on the Frame that you put things 
> into.  You could also try not loading the document until you 
> have added the canvas to the frame that it will be in. 
> 
> 
> 
> -- 
> What said Odin to the Gods and to the Champions who surrounded him? 
> "We will give our lives and let our world be destroyed, but we will 
> battle so that these evil powers will not live after us." Out of 
> Hel's ship sprang Fenrir the Wolf. His mouth gaped; his lower jaw 
> hung against the earth, and his upper jaw scraped the sky. Against 
> the Wolf Odin All-Father fought...
> 
> ...By Fenrir the Wolf Odin was slain.

Re: The Rendering problem

Posted by "Caesar Ralf (Fenrir) Franz Hoppen" <da...@gmail.com>.
I got a solution, but it was kind of strange. I compiled everything to a jar
and executed it using java -Xms500 -Xmx800 myjar.jar and it started to work
as it should, rendering everything without problems.

2008/8/26 <th...@kodak.com>

>
> Hi Caesar,
>
> "Caesar Ralf (Fenrir) Franz Hoppen" <da...@gmail.com> wrote on
> 08/22/2008 08:37:39 AM:
>
> > I have an application that dynammicaly loads SVGs to canvas, put
> > them in JSVGScrollpane and then in a JTabbedPane. The problem is
> > that it simply doesnt renders in some computers, what's really
> > strange. Already checked the application, java and batik version an
> > they are all the same in all computers. The documents are there, but
> > they are simply not being rendered, while in my computer and my
> > tutors computer, for example, it renders.
>
> > JSVGCanvas canvas = data.getCanvas();
> > JSVGScrollPane svgView = new JSVGScrollPane(canvas);
> >  //adds to the tabbed pane
> > tabbedPane.add(data.getName(),svgView);
> >
> > The creation of the JSVGCanvas code, this code is inside a thread
> > that creates the element, but they are added to the JSVGScrollPane
> > in the EDT Thread :
>
> > JSVGCanvas canvas = new JSVGCanvas();
> >           canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
> >           canvas.setURI(data.getSvgURI());
> >
> >           canvas.setEnableImageZoomInteractor(false);
> >           canvas.setEnableZoomInteractor(false);
>
>   If you load the document before the canvas is in a window
> it will size it's self to 1x1.  IIRC you can get it to resize
> it's self by calling pack on the Frame that you put things
> into.  You could also try not loading the document until you
> have added the canvas to the frame that it will be in.
>



-- 
What said Odin to the Gods and to the Champions who surrounded him? "We will
give our lives and let our world be destroyed, but we will battle so that
these evil powers will not live after us." Out of Hel's ship sprang Fenrir
the Wolf. His mouth gaped; his lower jaw hung against the earth, and his
upper jaw scraped the sky. Against the Wolf Odin All-Father fought...

...By Fenrir the Wolf Odin was slain.

Re: The Rendering problem

Posted by th...@kodak.com.
Hi Caesar, 

"Caesar Ralf (Fenrir) Franz Hoppen" <da...@gmail.com> wrote on 
08/22/2008 08:37:39 AM:

> I have an application that dynammicaly loads SVGs to canvas, put 
> them in JSVGScrollpane and then in a JTabbedPane. The problem is 
> that it simply doesnt renders in some computers, what's really 
> strange. Already checked the application, java and batik version an 
> they are all the same in all computers. The documents are there, but
> they are simply not being rendered, while in my computer and my 
> tutors computer, for example, it renders. 

> JSVGCanvas canvas = data.getCanvas(); 
> JSVGScrollPane svgView = new JSVGScrollPane(canvas);
>  //adds to the tabbed pane
> tabbedPane.add(data.getName(),svgView);
> 
> The creation of the JSVGCanvas code, this code is inside a thread 
> that creates the element, but they are added to the JSVGScrollPane
> in the EDT Thread :

> JSVGCanvas canvas = new JSVGCanvas();
>           canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
>           canvas.setURI(data.getSvgURI()); 
> 
>           canvas.setEnableImageZoomInteractor(false);
>           canvas.setEnableZoomInteractor(false);

   If you load the document before the canvas is in a window
it will size it's self to 1x1.  IIRC you can get it to resize 
it's self by calling pack on the Frame that you put things
into.  You could also try not loading the document until you 
have added the canvas to the frame that it will be in.