You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by ca...@apache.org on 2007/12/05 04:03:48 UTC

svn commit: r601196 - in /xmlgraphics/site/deploy/batik: contributors.html using/scripting/ecmascript.html

Author: cam
Date: Tue Dec  4 19:03:46 2007
New Revision: 601196

URL: http://svn.apache.org/viewvc?rev=601196&view=rev
Log:
Automatic publish

Modified:
    xmlgraphics/site/deploy/batik/contributors.html
    xmlgraphics/site/deploy/batik/using/scripting/ecmascript.html

Modified: xmlgraphics/site/deploy/batik/contributors.html
URL: http://svn.apache.org/viewvc/xmlgraphics/site/deploy/batik/contributors.html?rev=601196&r1=601195&r2=601196&view=diff
==============================================================================
--- xmlgraphics/site/deploy/batik/contributors.html (original)
+++ xmlgraphics/site/deploy/batik/contributors.html Tue Dec  4 19:03:46 2007
@@ -568,6 +568,12 @@
         
 <li>
           
+<a class="external" href="mailto:tonny@kiyut.com">Tonny Kohar</a>&mdash;Contributed
+          a syntax highlight XML editor component for use in Squiggle.
+        </li>
+        
+<li>
+          
 <a class="external" href="mailto:webmaestro@mac.com">Clay Leeds</a>&mdash;Helped
           getting Batik&rsquo;s new site set up.
         </li>
@@ -656,7 +662,7 @@
 </div>
 
     
-<a name="N1018A"></a><a name="expertise"></a>
+<a name="N10191"></a><a name="expertise"></a>
 <h2 class="boxed">Areas of expertise</h2>
 <div class="section">
 <p>

Modified: xmlgraphics/site/deploy/batik/using/scripting/ecmascript.html
URL: http://svn.apache.org/viewvc/xmlgraphics/site/deploy/batik/using/scripting/ecmascript.html?rev=601196&r1=601195&r2=601196&view=diff
==============================================================================
--- xmlgraphics/site/deploy/batik/using/scripting/ecmascript.html (original)
+++ xmlgraphics/site/deploy/batik/using/scripting/ecmascript.html Tue Dec  4 19:03:46 2007
@@ -332,22 +332,25 @@
       </p>
 <pre class="code">import org.apache.batik.script.rhino.RhinoInterpreter;
 
+import java.net.URL;
+
 import org.mozilla.javascript.Context;
 import org.mozilla.javascript.Function;
 import org.mozilla.javascript.Scriptable;
 import org.mozilla.javascript.ScriptableObject;
 import org.mozilla.javascript.PropertyException;
 
-public class ExtendedRhinoInterpreter extends RhinoIntepreter {
+public class ExtendedRhinoInterpreter extends RhinoInterpreter {
 
-    public ExtendedRhinoInterpreter() {
+    public ExtendedRhinoInterpreter(URL documentURL) {
+        super(documentURL);
 
         // Array of functions to put in the global object.
         final String[] names = { "print" }
         try {
             // Add the functions to the global object.
             getGlobalObject().defineFunctionProperties
-                (names, ExtendedRhinoIntepreter.class,
+                (names, ExtendedRhinoInterpreter.class,
                  ScriptableObject.DONTENUM);
         } catch (PropertyException e) {
             throw new Error(e);
@@ -374,12 +377,12 @@
         instances of your interpreter.
       </p>
 <pre class="code">import org.apache.batik.script.Interpreter;
-import org.apache.batik.script.InterpreterFactory;
+import org.apache.batik.script.rhino.RhinoInterpreterFactory;
 
-public class ExtendedRhinoInterpreterFactory implements InterpreterFactory {
+public class ExtendedRhinoInterpreterFactory extends RhinoInterpreterFactory {
 
-    public Interpreter createInterpreter() {
-        return new ExtendedRhinoInterpreter();
+    public Interpreter createInterpreter(URL documentURL, boolean isSVG12) {
+        return new ExtendedRhinoInterpreter(documentURL);
     }
 }</pre>
 <p>
@@ -392,8 +395,14 @@
 <pre class="code">org.apache.batik.bridge.BridgeContext ctx = ...;
 org.apache.batik.script.InterpreterPool pool =
     new org.apache.batik.script.InterpreterPool();
-pool.putInterpreterFactory("text/ecmascript", 
-                           new ExtendedRhinoInterpreterFactory());
+InterpreterFactory f = new ExtendedRhinoInterpreterFactory();
+
+// Register the interpreter factory for all four MIME types that
+// Batik normally supports for ECMAScript.
+pool.putInterpreterFactory("text/ecmascript", f);
+pool.putInterpreterFactory("text/javascript", f);
+pool.putInterpreterFactory("application/ecmascript", f);
+pool.putInterpreterFactory("application/javascript", f);
 ctx.setIntepreterPool(pool);</pre>
 <p>
         For example if you are using the Batik SVG browser application you



---------------------------------------------------------------------
Apache XML Graphics Project URL: http://xmlgraphics.apache.org/
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org