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 Chris Clarke <cc...@opencola.com> on 2001/06/11 21:51:31 UTC

Having a problem

I am trying to write a program that utilizes the JSVGCanvas part of batik.

I downloaded the src dist or batik and did a 'build.bat compile'

I put the classes in my classpath for my compiler and also on my web server.

My program starts to load an SVG file.... and never gets past that point.

You'll find my code attached.

I don't know if this is the right venue for this kind of thing but I can't seem to find any other spots for help with this problem.

-c


Re: Having a problem

Posted by Thierry Kormann <tk...@sophia.inria.fr>.
On Monday 11 June 2001 21:51, Chris Clarke wrote:
> I am trying to write a program that utilizes the JSVGCanvas part of batik.
>
> I downloaded the src dist or batik and did a 'build.bat compile'
>
> I put the classes in my classpath for my compiler and also on my web
> server.
>
> My program starts to load an SVG file.... and never gets past that point.
>
> You'll find my code attached.
>
> I don't know if this is the right venue for this kind of thing but I can't
> seem to find any other spots for help with this problem.

After taking a quick look at your code, here is some tips:

- be sure that the size of your canvas is set correctly (using an appropriate 
layout manager or by setting the preferredSize).

- create your own UserAgent to track all errors. A simple System.err in the 
displayError method may be really helpful.

Thierry.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: OT: stdout vs. stderr (was: Having a problem)

Posted by Vincent Hardy <vi...@sun.com>.
Peter,

I have entered a bug in Bugzilla (2157) to make sure we use stderr
and not stdout for error messages.
Thanks!
Vincent.

Peter Becker wrote:
> 
> Stephane Hillion wrote:
> [...]
> > A way to have some feedback from the JSVGCanvas is to set your own
> > SVGUserAgent. For example:
> >
> >     svgCanvas = new JSVGCanvas(new SVGUserAgent() {
> >         public void displayError(String message) {
> >             System.out.println(message);
> >         }
> [...]
> >
> > Every error will be displayed using the standard output.
> 
> Errors should go to stderr, i.e. you should use System.err instead of
> System.out. This might get important if someone wants to embed a program
> in a script -- it can be quite nasty if you are not able to distinguish
> between ordinary messages and real errors, e.g. you can't send mail like
> "Program X produced error messages" with only the errors, not all the
> other output.
> 
> Probably you don't want to build scripts around GUI programs but you
> never know -- e.g. I usually pipe all the Mozilla output into different
> files. The System.err output should be visible on each system, so you
> shouldn't get any problems with this approach but you make the Unix
> people happy ;-)
> 
> HTH,
>    PeterB
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


OT: stdout vs. stderr (was: Having a problem)

Posted by Peter Becker <pb...@meganesia.int.gu.edu.au>.
Stephane Hillion wrote:
[...]
> A way to have some feedback from the JSVGCanvas is to set your own
> SVGUserAgent. For example:
> 
>     svgCanvas = new JSVGCanvas(new SVGUserAgent() {
>         public void displayError(String message) {
>             System.out.println(message);
>         }
[...]
> 
> Every error will be displayed using the standard output.

Errors should go to stderr, i.e. you should use System.err instead of
System.out. This might get important if someone wants to embed a program
in a script -- it can be quite nasty if you are not able to distinguish
between ordinary messages and real errors, e.g. you can't send mail like
"Program X produced error messages" with only the errors, not all the
other output.

Probably you don't want to build scripts around GUI programs but you
never know -- e.g. I usually pipe all the Mozilla output into different
files. The System.err output should be visible on each system, so you
shouldn't get any problems with this approach but you make the Unix
people happy ;-)

HTH,
   PeterB

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: Having a problem

Posted by Stephane Hillion <St...@sophia.inria.fr>.
On Monday 11 June 2001 21:51, Chris Clarke wrote:
> I am trying to write a program that utilizes the JSVGCanvas part of batik.
>
> I downloaded the src dist or batik and did a 'build.bat compile'
>
> I put the classes in my classpath for my compiler and also on my web
> server.
>
> My program starts to load an SVG file.... and never gets past that point.
>
> You'll find my code attached.
>
> I don't know if this is the right venue for this kind of thing but I can't
> seem to find any other spots for help with this problem.
>

A way to have some feedback from the JSVGCanvas is to set your own 
SVGUserAgent. For example:

    svgCanvas = new JSVGCanvas(new SVGUserAgent() {
        public void displayError(String message) {
            System.out.println(message);
        }
        public void displayError(Exception ex) {
            ex.printStackTrace();
        }
        public void displayMessage(String message) {
        }
        public float getPixelToMM() {
            return 0.264583333333333333333f; // 96 dpi
        }
        public String getLanguages() {
            return "en";
        }
        public String getUserStyleSheetURI() {
            return null;
        }
        public String getXMLParserClassName() {
            return "org.apache.crimson.parser.XMLReaderImpl";
        }
        public void openLink(String uri, boolean newc) {
            svgCanvas.setURI(uri);
        }
        public boolean supportExtension(String s) {
            return false;
        }
    }, true, true);

Every error will be displayed using the standard output.
--
  Stephane.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org