SVG 文書オブジェクトモデル定義に対する Java 言語バインディングは次の URL から入手できる:
The Java language binding for the SVG Document Object Model definitions is available at:
http://www.w3.org/TR/SVG11/java-binding.zip
この言語バインディングが正式なものでないことに注意。 IDL 定義が SVG DOM を構成する正式なものである。
Note that this language binding is not normative. The IDL Definitions are the normative parts of the SVG DOM.
ECMAScript などの言語による SVG に対するスクリプトでは、'script' 要素とイベント属性(例えば 'onload' や 'onclick' など)を利用して SVG 内容にスクリプトコードを直接書き込める。一方、 Java 言語などの実行形式がバイナリのプログラミング言語のコードを 'script' 要素やイベント属性に埋め込むことはできない。したがって、そのような言語をどのように SVG 文書にバインドし、イベント処理させるかを指定する必要がある。次の技法では Java 言語の場合にこれをどのようにして行うべきか、 Java 言語を通して動的な SVG 内容をサポートするUAには何が求められるのかを述べる。
When scripting SVG with a language such as ECMAScript, it is possible to embed script code directly in the SVG content using the 'script' element and the event attributes (e.g., 'onload' or 'onclick'). For programming languages with a binary delivery format, such as the Java language, it is not possible to embed the code into the 'script' element or within the event attributes. Therefore there is a need to specify how such languages can bind to and handle events in the SVG document. The following technique describes how this should be done when using the Java language and what is expected of the User Agent that supports dynamic SVG content through the Java language .
<script type="application/java-archive" xlink:href="myJavaHandlers.jar" />
<script type="application/java-archive" xlink:href="myJavaHandlers.jar" />
***************************************************** Manifest-Version: 1.1 SVG-Handler-Class: org.example.svg.SVGHandler *****************************************************
***************************************************** Manifest-Version: 1.1 SVG-Handler-Class: org.example.svg.SVGHandler *****************************************************
public interface EventListenerInitializer { /** * 必要なリスナの登録 */ void initializeEventListeners(SVGDocument doc) { /* DOM を利用するイベントハンドラの初期化を ここに記述 */ } }
public interface EventListenerInitializer { /** * Registers the listeners needed */ void initializeEventListeners(SVGDocument doc) { /* Initialization of event handlers using the DOM goes here */ } }
他のバイナリ・プログラミング言語に対するイベント・バインディングは定められていない。
The event binding of other binary programming languages is not specified.