I tried using bbox but my bbox is null.  My coding is as follows:

private void renderIcon(String url){
       
canvasIcon.setDocumentState(org.apache.batik.swing.JSVGCanvas.ALWAYS_DYNAMIC);
        canvasIcon.addGVTTreeBuilderListener(new GVTTreeBuilderAdapter() {
         public void gvtBuildCompleted(GVTTreeBuilderEvent e) {
                System.out.println("gvt tree build done");
            }
         });
        
        canvasIcon.setURI(url);
}

public void mouseClicked(MouseEvent e) {
        JGVTComponent c = (JGVTComponent)e.getSource();
        SVGSVGElement rootElement = svgDocument.getRootElement();
        
        System.out.println(rootElement);
        System.out.println(rootElement.getTagName());

        if(rootElement instanceof SVGLocatable)
            System.out.println("instance of locatable");

        SVGLocatableSupport svgLoc = new SVGLocatableSupport();
        SVGRect bbox = svgLoc.getBBox(ele);
        System.out.println(bbox);
        ...

What am I doing wrong here?  Any hints is much appreciated.
-- 
View this message in context: 
http://www.nabble.com/Determine-points-in-JSVGCanvas-tf2948761.html#a8278076
Sent from the Batik - Users mailing list archive at Nabble.com.


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

Reply via email to