• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Java SVG DOM

Appendix D of the SVG 1.0 specification, “Java Language Binding,” points to a Zip file containing 160 small Java files, each of which contains an interface corresponding to an SVG component. What Java binds to is the SVG Document Object Model (DOM), which stands independent of any specific language. This is apparent if you compare it with Appendix E of the specification, which is the ECMAScript binding that is provided as an HTML document. Because it is tied to the same underlying model as the Java binding, it could almost be mistaken for documentation of the Java interfaces. As you learned earlier in the book, the SVG DOM is built on DOM Level 2, so pretty much anything you can do with regular DOM, you can do with SVG DOM as long as the implementation you're using supports it. If you've used the SVG DOM in ECMAScript, the Java version will seem very familiar.

There is at least one other implementation of the Java SVG DOM, but here we will use Batik's implementation, which offers wide support of the specification and is open source.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint