Hi Rich.

rich k:
> I would have thought that this would be a FAQ, but apparently not.  So here 
> is the question:
> How do you set the "overflow" attribute or property to "visible" on a 
> Document?

It probably should go in the FAQ…

> The reason I want to do this is because squiggle is acting as if the area 
> of my drawing that does not fit in the initial viewport does not exist.  

Yes, the initial value of ‘overflow’ is ‘hidden’.

>       // Get a DOMImplementation
>        DOMImplementation domImpl =
>            GenericDOMImplementation.getDOMImplementation();
> 
>        // Create an instance of org.w3c.dom.Document
>        Document document = domImpl.createDocument(null, "svg", null);

Change this to:

  Document document =
      domImpl.createDocument("http://www.w3.org/2000/svg";, "svg", null);

>        // Create an instance of the SVG Generator
>        SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
> 
>        // Ask the test to render into the SVG Graphics2D implementation
>        TestSVGGen test = new TestSVGGen();
>        test.paint(svgGenerator);
> 
>        // Finally, stream out SVG to the standard output using UTF-8
>        // character to byte encoding
>        boolean useCSS = true; // we want to use CSS style attribute
>        Writer out = new OutputStreamWriter(System.out, "UTF-8");
>        svgGenerator.stream(out, useCSS);

and then instead of streaming out the SVG to a Writer, you can get it to
construct the SVG, which you can then modify to add your ‘overflow’
property:

  Element svg = document.getDocumentElement();
  svgGenerator.getRoot(svg);
  svg.setAttributeNS(null, "overflow", "visible");

And then write out ‘document’.

-- 
Cameron McCormack, http://mcc.id.au/
        xmpp:[EMAIL PROTECTED]  ▪  ICQ 26955922  ▪  MSN [EMAIL PROTECTED]

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

Reply via email to