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 Daniel Noll <da...@nuix.com.au> on 2003/05/22 08:54:20 UTC

JSVGCanvas blank

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi.

I've been trying to figure out what's going on here for a couple of hours now.  
Basically I'm just trying to load a URL into the JSVGCanvas, inside an 
applet.

Code (trimmed somewhat to remove anything resembling IP):

public class SvgViewer extends JComponent {
    public static final String INITIAL_SVG_PARAM = "initialSvg";
    private JSVGCanvas svgCanvas;
    
    public SvgViewer(Applet applet) {
        String initialUrl = applet.getParameter(INITIAL_SVG_PARAM);
        try {
            String svgUrl = new URL(applet.getDocumentBase(),
                                    initialUrl).toString();
            svgCanvas = new JSVGCanvas();
            svgCanvas.setDocumentState(JSVGCanvas.ALWAYS_STATIC);
            add(svgCanvas, BorderLayout.CENTER);
            
            // Load the SVG.
            System.out.println("Loading " + svgUrl);
            svgCanvas.setURI(svgUrl);
        } catch (MalformedURLException e) {
            throw new IllegalArgumentException("Initial URL is not valid");
        }
    }
}

(This component is then placed as a child of the applet.)

As far as I can tell from the examples, there's nothing more I should have to 
do.  I've tried using loadSVGDocument() instead, and I've tried listening for 
various events and manually setting the size etc.

The SVG does exist at the URL, as I can go there in another browser window and 
it will display.

The background comes up as light grey (a lighter grey than what you get while 
the applet is loading), but the background of the SVG is white (besides the 
SVG having content itself.)

The content is loaded via HTTPS, which shouldn't be a problem because the 
applet is loaded from there also and other working applets gather data the 
same way.

Anyone seen this sort of symptom before?

Daniel


- -- 
- ------------------------------------------------------------------------
Daniel Noll
NUIX Pty Ltd
Level 8, 143 York Street
Sydney 2000

Phone: (02) 9283 9010
Email: daniel@nuix.com.au

This message is intended only for the named recipient. If you are not the
intended recipient you are notified that disclosing, copying, distributing
or taking any action in reliance on the contents of this message or
attachment is strictly prohibited.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (GNU/Linux)

iD8DBQE+zHQcEhkwhZ4+KPkRAkn1AJ9t4GoFWWgP8WCjEkOQdc9vgzg5wgCeMcdZ
UPTd3847mqkXLdGiqhyAFbs=
=3MaW
-----END PGP SIGNATURE-----


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