Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/MultiResGraphicsNode.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/MultiResGraphicsNode.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/MultiResGraphicsNode.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/MultiResGraphicsNode.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,233 @@ +/* + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package org.apache.batik.bridge; + +import java.awt.Dimension; +import java.awt.Graphics2D; +import java.awt.Shape; +import java.awt.geom.AffineTransform; +import java.awt.geom.Rectangle2D; +import java.lang.ref.SoftReference; + +import org.apache.batik.gvt.AbstractGraphicsNode; +import org.apache.batik.gvt.GraphicsNode; +import org.apache.batik.util.SVGConstants; +import org.w3c.dom.Element; + +/** + * RasterRable This is used to wrap a Rendered Image back into the + * RenderableImage world. + * + * @author <a href="mailto:thomas.dewe...@kodak.com">Thomas DeWeese</a> + * @version $Id$ + */ +public class MultiResGraphicsNode + extends AbstractGraphicsNode implements SVGConstants { + + SoftReference [] srcs; + Element [] srcElems; + Dimension [] minSz; + Dimension [] maxSz; + Rectangle2D bounds; + + BridgeContext ctx; + + Element multiImgElem; + + public MultiResGraphicsNode(Element multiImgElem, + Rectangle2D bounds, + Element [] srcElems, + Dimension [] minSz, + Dimension [] maxSz, + BridgeContext ctx) { + + this.multiImgElem = multiImgElem; + this.srcElems = new Element [srcElems.length]; + this.minSz = new Dimension[srcElems.length]; + this.maxSz = new Dimension[srcElems.length]; + this.ctx = ctx; + + for (int i=0; i<srcElems.length; i++) { + this.srcElems[i] = srcElems[i]; + this.minSz[i] = minSz[i]; + this.maxSz[i] = maxSz[i]; + } + + this.srcs = new SoftReference[srcElems.length]; + this.bounds = bounds; + } + + /** + * Paints this node without applying Filter, Mask, Composite, and clip. + * + * @param g2d the Graphics2D to use + */ + public void primitivePaint(Graphics2D g2d) { + // get the current affine transform + AffineTransform at = g2d.getTransform(); + + double scx = Math.sqrt(at.getShearY()*at.getShearY()+ + at.getScaleX()*at.getScaleX()); + double scy = Math.sqrt(at.getShearX()*at.getShearX()+ + at.getScaleY()*at.getScaleY()); + + GraphicsNode gn = null; + int idx =-1; + double w = bounds.getWidth()*scx; + double minDist = calcDist(w, minSz[0], maxSz[0]); + int minIdx = 0; + // System.err.println("Width: " + w); + for (int i=0; i<minSz.length; i++) { + double dist = calcDist(w, minSz[i], maxSz[i]); + // System.err.println("Dist: " + dist); + if (dist < minDist) { + minDist = dist; + minIdx = i; + } + + if (((minSz[i] == null) || (w >= minSz[i].width)) && + ((maxSz[i] == null) || (w <= maxSz[i].width))) { + // We have a range match + // System.err.println("Match: " + i + " " + + // minSz[i] + " -> " + maxSz[i]); + if ((idx == -1) || (minIdx == i)) { + idx = i; + } + } + } + + if (idx == -1) + idx = minIdx; + gn = getGraphicsNode(idx); + if (gn == null) return; + + // This makes sure that the image 'pushes out' to it's pixel + // bounderies. + Rectangle2D gnBounds = gn.getBounds(); + if (gnBounds == null) return; + + double gnDevW = gnBounds.getWidth()*scx; + double gnDevH = gnBounds.getHeight()*scy; + double gnDevX = gnBounds.getX()*scx; + double gnDevY = gnBounds.getY()*scy; + double gnDevX0, gnDevX1, gnDevY0, gnDevY1; + if (gnDevW < 0) { + gnDevX0 = gnDevX+gnDevW; + gnDevX1 = gnDevX; + } else { + gnDevX0 = gnDevX; + gnDevX1 = gnDevX+gnDevW; + } + if (gnDevH < 0) { + gnDevY0 = gnDevY+gnDevH; + gnDevY1 = gnDevY; + } else { + gnDevY0 = gnDevY; + gnDevY1 = gnDevY+gnDevH; + } + // This calculate the width/height in pixels given 'worst + // case' assessment. + gnDevW = (int)(Math.ceil(gnDevX1)-Math.floor(gnDevX0)); + gnDevH = (int)(Math.ceil(gnDevY1)-Math.floor(gnDevY0)); + scx = (gnDevW/gnBounds.getWidth())/scx; + scy = (gnDevH/gnBounds.getHeight())/scy; + + // This scales things up slightly so our edges fall on device + // pixel boundries. + AffineTransform nat = g2d.getTransform(); + nat = new AffineTransform(nat.getScaleX()*scx, nat.getShearY()*scx, + nat.getShearX()*scy, nat.getScaleY()*scy, + nat.getTranslateX(), nat.getTranslateY()); + g2d.setTransform(nat); + + // double sx = bounds.getWidth()/sizes[idx].getWidth(); + // double sy = bounds.getHeight()/sizes[idx].getHeight(); + // System.err.println("Scale: [" + sx + ", " + sy + "]"); + + gn.paint(g2d); + } + + // This function can be tweaked to any extent. This is a very + // simple measure of 'goodness'. It has two main flaws as is, + // mostly in regards to distance calc with 'unbounded' ranges. + // First it doesn't punish if the distance is the wrong way on the + // unbounded range (so over a max by 10 is the same as under a max + // by 10) this is compensated by the absolute preference for + // matches 'in range' above. The other issue is that unbounded + // ranages tend to 'win' when the value is near the boundry point + // since they use distance from the boundry point rather than the + // middle of the range. As it is this seems to meet all the + // requirements of the SVG specification however. + public double calcDist(double loc, Dimension min, Dimension max) { + if (min == null) { + if (max == null) + return 10E10; // very large number. + else + return Math.abs(loc-max.width); + } else { + if (max == null) + return Math.abs(loc-min.width); + else { + double mid = (max.width+min.width)/2.0; + return Math.abs(loc-mid); + } + } + } + + /** + * Returns the bounds of the area covered by this node's primitive paint. + */ + public Rectangle2D getPrimitiveBounds() { + return bounds; + } + + public Rectangle2D getGeometryBounds(){ + return bounds; + } + + public Rectangle2D getSensitiveBounds(){ + return bounds; + } + + /** + * Returns the outline of this node. + */ + public Shape getOutline() { + return bounds; + } + + public GraphicsNode getGraphicsNode(int idx) { + if (srcs[idx] != null) { + Object o = srcs[idx].get(); + if (o != null) + return (GraphicsNode)o; + } + + try { + GVTBuilder builder = ctx.getGVTBuilder(); + GraphicsNode gn; + gn = builder.build(ctx, srcElems[idx]); + srcs[idx] = new SoftReference(gn); + return gn; + } catch (Exception ex) { ex.printStackTrace(); } + + return null; + } +} +
Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/RhinoInterpreter.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/RhinoInterpreter.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/RhinoInterpreter.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/RhinoInterpreter.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,606 @@ +/* + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package org.apache.batik.bridge; + +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.io.Writer; +import java.net.URL; +import java.security.AccessControlContext; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.MissingResourceException; + +import org.apache.batik.script.Interpreter; +import org.apache.batik.script.InterpreterException; +import org.apache.batik.script.ImportInfo; +import org.apache.batik.script.rhino.BatikSecurityController; +import org.apache.batik.script.rhino.RhinoClassLoader; +import org.apache.batik.script.rhino.RhinoClassShutter; + +import org.mozilla.javascript.Context; +import org.mozilla.javascript.ContextAction; +import org.mozilla.javascript.ContextFactory; +import org.mozilla.javascript.ClassCache; +import org.mozilla.javascript.ClassShutter; +import org.mozilla.javascript.Function; +import org.mozilla.javascript.JavaScriptException; +import org.mozilla.javascript.Script; +import org.mozilla.javascript.Scriptable; +import org.mozilla.javascript.ScriptableObject; +import org.mozilla.javascript.SecurityController; +import org.mozilla.javascript.WrapFactory; +import org.mozilla.javascript.WrappedException; +import org.w3c.dom.events.EventTarget; + +/** + * A simple implementation of <code>Interpreter</code> interface to use + * Rhino ECMAScript interpreter. + * @author <a href="mailto:cjo...@ilog.fr">Christophe Jolif</a> + * @version $Id$ + */ +public class RhinoInterpreter implements Interpreter { + + /** + * The number of cached compiled scripts to store. + */ + private static final int MAX_CACHED_SCRIPTS = 32; + + /** + * Constant used to describe an SVG source + */ + public static final String SOURCE_NAME_SVG = "<SVG>"; + + /** + * Name of the "window" object when referenced by scripts + */ + public static final String BIND_NAME_WINDOW = "window"; + + /** + * Context vector, to make sure we are not + * setting the security context too many times + */ + protected static List contexts = new LinkedList(); + + /** + * The window object. + */ + protected Window window; + + /** + * The global object. + */ + protected ScriptableObject globalObject = null; + + /** + * List of cached compiled scripts. + */ + protected LinkedList compiledScripts = new LinkedList(); + + /** + * Factory for Java wrapper objects. + */ + protected WrapFactory wrapFactory = new BatikWrapFactory(this); + + /** + * Class shutter. + */ + protected ClassShutter classShutter = new RhinoClassShutter(); + + /** + * The Rhino 'security domain'. We use the RhinoClassLoader + * which will grant permissions to connect to the document + * URL. + */ + protected RhinoClassLoader rhinoClassLoader; + + /** + * The SecurityController implementation for Batik, + * which ensures scripts have access to the + * server they were downloaded from + */ + protected SecurityController securityController + = new BatikSecurityController(); + + /** + * Factory object for creating Contexts. + */ + protected ContextFactory contextFactory = new Factory(); + + /** + * Default Context for scripts. This is used only for efficiency + * reasons. + */ + protected Context defaultContext; + + /** + * Build a <code>Interpreter</code> for ECMAScript using Rhino. + * + * @param documentURL the URL for the document which references + * + * @see org.apache.batik.script.Interpreter + * @see org.apache.batik.script.InterpreterPool + */ + public RhinoInterpreter(URL documentURL) { + init(documentURL, null); + } + + /** + * Build a <code>Interpreter</code> for ECMAScript using Rhino. + * + * @param documentURL the URL for the document which references + * @param imports the set of Java classes/packages to import + * into the scripting enviornment. + * + * @see org.apache.batik.script.Interpreter + * @see org.apache.batik.script.InterpreterPool + */ + public RhinoInterpreter(URL documentURL, + ImportInfo imports) { + init(documentURL, imports); + } + + protected void init(URL documentURL, + final ImportInfo imports) + { + try { + rhinoClassLoader = new RhinoClassLoader + (documentURL, getClass().getClassLoader()); + } catch (SecurityException se) { + rhinoClassLoader = null; + } + ContextAction initAction = new ContextAction() { + public Object run(Context cx) { + Scriptable scriptable = cx.initStandardObjects(null, false); + defineGlobalWrapperClass(scriptable); + globalObject = createGlobalObject(cx); + ClassCache cache = ClassCache.get(globalObject); + cache.setCachingEnabled(rhinoClassLoader != null); + + ImportInfo ii = imports; + if (ii == null) ii = ImportInfo.getImports(); + + // import Java lang package & DOM Level 3 & SVG DOM packages + StringBuffer sb = new StringBuffer(); + Iterator iter; + iter = ii.getPackages(); + while (iter.hasNext()) { + String pkg = (String)iter.next(); + sb.append("importPackage(Packages."); + sb.append(pkg); + sb.append(");"); + } + iter = ii.getClasses(); + while (iter.hasNext()) { + String cls = (String)iter.next(); + sb.append("importClass(Packages."); + sb.append(cls); + sb.append(");"); + } + cx.evaluateString(globalObject, sb.toString(), null, 0, + rhinoClassLoader); + return null; + } + }; + contextFactory.call(initAction); + } + + /** + * Returns the content types of the scripting languages this interpreter + * handles. + */ + public String[] getMimeTypes() { + return RhinoInterpreterFactory.RHINO_MIMETYPES; + } + + /** + * Returns the window object for this interpreter. + */ + public Window getWindow() { + return window; + } + + /** + * Returns the ContextFactory for this interpreter. + */ + public ContextFactory getContextFactory() { + return contextFactory; + } + + /** + * Defines the class for the global object. + */ + protected void defineGlobalWrapperClass(Scriptable global) { + try { + ScriptableObject.defineClass(global, WindowWrapper.class); + } catch (Exception ex) { + // cannot happen + } + } + + /** + * Creates the global object. + */ + protected ScriptableObject createGlobalObject(Context ctx) { + return new WindowWrapper(ctx); + } + + /** + * Returns the AccessControlContext associated with this Interpreter. + * @see org.apache.batik.script.rhino.RhinoClassLoader + */ + public AccessControlContext getAccessControlContext() { + if (rhinoClassLoader == null) return null; + return rhinoClassLoader.getAccessControlContext(); + } + + /** + * This method returns the ECMAScript global object used by this + * interpreter. + */ + protected ScriptableObject getGlobalObject() { + return globalObject; + } + + // org.apache.batik.script.Intepreter implementation + + /** + * This method evaluates a piece of ECMAScript. + * @param scriptreader a <code>java.io.Reader</code> on the piece of script + * @return if no exception is thrown during the call, should return the + * value of the last expression evaluated in the script. + */ + public Object evaluate(Reader scriptreader) throws IOException { + return evaluate(scriptreader, SOURCE_NAME_SVG); + } + + /** + * This method evaluates a piece of ECMAScript. + * @param scriptReader a <code>java.io.Reader</code> on the piece of script + * @param description description which can be later used (e.g., for error + * messages). + * @return if no exception is thrown during the call, should return the + * value of the last expression evaluated in the script. + */ + public Object evaluate(final Reader scriptReader, final String description) + throws IOException { + + ContextAction evaluateAction = new ContextAction() { + public Object run(Context cx) { + try { + return cx.evaluateReader(globalObject, + scriptReader, + description, + 1, rhinoClassLoader); + } catch (IOException ioe) { + throw new WrappedException(ioe); + } + } + }; + try { + return contextFactory.call(evaluateAction); + } catch (JavaScriptException e) { + // exception from JavaScript (possibly wrapping a Java Ex) + Object value = e.getValue(); + Exception ex = value instanceof Exception ? (Exception) value : e; + throw new InterpreterException(ex, ex.getMessage(), -1, -1); + } catch (WrappedException we) { + Throwable w = we.getWrappedException(); + if (w instanceof Exception) { + throw new InterpreterException + ((Exception) w, w.getMessage(), -1, -1); + } else { + throw new InterpreterException(w.getMessage(), -1, -1); + } + } catch (InterruptedBridgeException ibe) { + throw ibe; + } catch (RuntimeException re) { + throw new InterpreterException(re, re.getMessage(), -1, -1); + } + } + + /** + * This method evaluates a piece of ECMA script. + * The first time a String is passed, it is compiled and evaluated. + * At next call, the piece of script will only be evaluated to + * prevent from recompiling it. + * @param scriptStr the piece of script + * @return if no exception is thrown during the call, should return the + * value of the last expression evaluated in the script. + */ + public Object evaluate(final String scriptStr) { + + ContextAction evalAction = new ContextAction() { + public Object run(final Context cx) { + Script script = null; + Entry entry = null; + Iterator it = compiledScripts.iterator(); + // between nlog(n) and log(n) because it is + // an AbstractSequentialList + while (it.hasNext()) { + if ((entry = (Entry) it.next()).str.equals(scriptStr)) { + // if it is not at the end, remove it because + // it will change from place (it is faster + // to remove it now) + script = entry.script; + it.remove(); + break; + } + } + + if (script == null) { + // this script has not been compiled yet or has been + // forgotten since the compilation: + // compile it and store it for future use. + + PrivilegedAction compile = new PrivilegedAction() { + public Object run() { + try { + return cx.compileReader + (new StringReader(scriptStr), + SOURCE_NAME_SVG, 1, rhinoClassLoader); + } catch (IOException ioEx ) { + // Should never happen: using a string + throw new Error( ioEx.getMessage() ); + } + } + }; + script = (Script)AccessController.doPrivileged(compile); + + if (compiledScripts.size() + 1 > MAX_CACHED_SCRIPTS) { + // too many cached items - we should delete the + // oldest entry. all of this is very fast on + // linkedlist + compiledScripts.removeFirst(); + } + // storing is done here: + compiledScripts.addLast(new Entry(scriptStr, script)); + } else { + // this script has been compiled before, + // just update its index so it won't get deleted soon. + compiledScripts.addLast(entry); + } + + return script.exec(cx, globalObject); + } + }; + try { + return contextFactory.call(evalAction); + } catch (InterpreterException ie) { + throw ie; + } catch (JavaScriptException e) { + // exception from JavaScript (possibly wrapping a Java Ex) + Object value = e.getValue(); + Exception ex = value instanceof Exception ? (Exception) value : e; + throw new InterpreterException(ex, ex.getMessage(), -1, -1); + } catch (WrappedException we) { + Throwable w = we.getWrappedException(); + if (w instanceof Exception) { + throw new InterpreterException + ((Exception) w, w.getMessage(), -1, -1); + } else { + throw new InterpreterException(w.getMessage(), -1, -1); + } + } catch (RuntimeException re) { + throw new InterpreterException(re, re.getMessage(), -1, -1); + } + } + + /** + * For <code>RhinoInterpreter</code> this method flushes the + * Rhino caches to avoid memory leaks. + */ + public void dispose() { + if (rhinoClassLoader != null) { + ClassCache cache = ClassCache.get(globalObject); + cache.setCachingEnabled(false); + } + } + + /** + * This method registers a particular Java <code>Object</code> in + * the environment of the interpreter. + * @param name the name of the script object to create + * @param object the Java object + */ + public void bindObject(final String name, final Object object) { + contextFactory.call(new ContextAction() { + public Object run(Context cx) { + Object o = object; + if (name.equals(BIND_NAME_WINDOW) && object instanceof Window) { + ((WindowWrapper) globalObject).window = (Window) object; + window = (Window) object; + o = globalObject; + } + Scriptable jsObject; + jsObject = Context.toObject(o, globalObject); + globalObject.put(name, globalObject, jsObject); + return null; + } + }); + } + + /** + * To be used by <code>EventTargetWrapper</code>. + */ + void callHandler(final Function handler, final Object arg) { + contextFactory.call(new ContextAction() { + public Object run(Context cx) { + Object a = Context.toObject(arg, globalObject); + Object[] args = { a }; + handler.call(cx, globalObject, globalObject, args); + return null; + } + }); + } + + /** + * To be used by <code>WindowWrapper</code>. + */ + void callMethod(final ScriptableObject obj, + final String methodName, + final ArgumentsBuilder ab) { + contextFactory.call(new ContextAction() { + public Object run(Context cx) { + ScriptableObject.callMethod + (obj, methodName, ab.buildArguments()); + return null; + } + }); + } + + /** + * To be used by <code>WindowWrapper</code>. + */ + void callHandler(final Function handler, final Object[] args) { + contextFactory.call(new ContextAction() { + public Object run(Context cx) { + handler.call(cx, globalObject, globalObject, args); + return null; + } + }); + } + + /** + * To be used by <code>WindowWrapper</code>. + */ + void callHandler(final Function handler, final ArgumentsBuilder ab) { + contextFactory.call(new ContextAction() { + public Object run(Context cx) { + Object[] args = ab.buildArguments(); + handler.call(cx, handler.getParentScope(), globalObject, args); + return null; + } + }); + } + + /** + * To be used by <code>EventTargetWrapper</code>. + */ + Object call(ContextAction action) { + return contextFactory.call(action); + } + + /** + * To build an argument list. + */ + public interface ArgumentsBuilder { + Object[] buildArguments(); + } + + /** + * Build the wrapper for objects implement <code>EventTarget</code>. + */ + Scriptable buildEventTargetWrapper(EventTarget obj) { + return new EventTargetWrapper(globalObject, obj, this); + } + + /** + * By default Rhino has no output method in its language. That's why + * this method does nothing. + * @param out the new out <code>Writer</code>. + */ + public void setOut(Writer out) { + // no implementation of a default output function in Rhino + } + + // org.apache.batik.i18n.Localizable implementation + + /** + * Returns the current locale or null if the locale currently used is + * the default one. + */ + public Locale getLocale() { + // <!> TODO : in Rhino the locale is for a thread not a scope.. + return null; + } + + /** + * Provides a way to the user to specify a locale which override the + * default one. If null is passed to this method, the used locale + * becomes the global one. + * @param locale The locale to set. + */ + public void setLocale(Locale locale) { + // <!> TODO : in Rhino the local is for a thread not a scope.. + } + + /** + * Creates and returns a localized message, given the key of the message, 0, data.length + * in the resource bundle and the message parameters. + * The messages in the resource bundle must have the syntax described in + * the java.text.MessageFormat class documentation. + * @param key The key used to retreive the message from the resource + * bundle. + * @param args The objects that compose the message. + * @exception MissingResourceException if the key is not in the bundle. + */ + public String formatMessage(String key, Object[] args) { + return null; + } + + /** + * Class to store cached compiled scripts. + */ + protected static class Entry { + + /** + * The script string. + */ + public String str; + + /** + * The compiled script. + */ + public Script script; + + /** + * Creates a new script cache entry object. + */ + public Entry(String str, Script script) { + this.str = str; + this.script = script; + } + } + + /** + * Factory for Context objects. + */ + protected class Factory extends ContextFactory { + + /** + * Creates a Context object for use with the interpreter. + */ + protected Context makeContext() { + Context cx = super.makeContext(); + cx.setWrapFactory(wrapFactory); + cx.setSecurityController(securityController); + cx.setClassShutter(classShutter); + if (rhinoClassLoader == null) { + cx.setOptimizationLevel(-1); + } + return cx; + } + } +} Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/RhinoInterpreterFactory.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/RhinoInterpreterFactory.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/RhinoInterpreterFactory.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/RhinoInterpreterFactory.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,84 @@ +/* + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package org.apache.batik.bridge; + +import java.net.URL; + +import org.apache.batik.script.ImportInfo; +import org.apache.batik.script.Interpreter; +import org.apache.batik.script.InterpreterFactory; + +/** + * Allows to create instances of <code>RhinoInterpreter</code> class. + * + * @author <a href="mailto:cjo...@ilog.fr">Christophe Jolif</a> + * @author <a href="mailto:vha...@apache.org">Vincent Hardy</a> + * @version $Id$ + */ +public class RhinoInterpreterFactory implements InterpreterFactory { + + /** + * The MIME types that Rhino can handle. + */ + public static final String[] RHINO_MIMETYPES = { + "application/ecmascript", + "application/javascript", + "text/ecmascript", + "text/javascript", + }; + + /** + * Builds a <code>RhinoInterpreterFactory</code>. + */ + public RhinoInterpreterFactory() { + } + + /** + * Returns the mime-types to register this interpereter with. + */ + public String[] getMimeTypes() { + return RHINO_MIMETYPES; + } + + /** + * Creates an instance of <code>RhinoInterpreter</code> class. + * + * @param documentURL the url for the document which will be scripted + * @param svg12 whether the document is an SVG 1.2 document + */ + public Interpreter createInterpreter(URL documentURL, boolean svg12) { + return createInterpreter(documentURL, svg12, null); + } + + /** + * Creates an instance of <code>RhinoInterpreter</code> class. + * + * @param documentURL the url for the document which will be scripted + * @param svg12 whether the document is an SVG 1.2 document + * @param imports The set of classes/packages to import (if + * the interpreter supports that), may be null. + */ + public Interpreter createInterpreter(URL documentURL, boolean svg12, + ImportInfo imports) { + if (svg12) { + return new SVG12RhinoInterpreter(documentURL, imports); + } + return new RhinoInterpreter(documentURL, imports); + } +} Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVG12RhinoInterpreter.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVG12RhinoInterpreter.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVG12RhinoInterpreter.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVG12RhinoInterpreter.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,69 @@ +/* + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package org.apache.batik.bridge; + +import java.net.URL; + +import org.apache.batik.script.ImportInfo; + +import org.mozilla.javascript.Context; +import org.mozilla.javascript.Scriptable; +import org.mozilla.javascript.ScriptableObject; + +/** + * A RhinoInterpreter for SVG 1.2 documents. + * + * @author <a href="mailto:cam%40mcc%2eid%2eau">Cameron McCormack</a> + * @version $Id$ + */ +public class SVG12RhinoInterpreter extends RhinoInterpreter { + + /** + * Creates an SVG12RhinoInterpreter object. + */ + public SVG12RhinoInterpreter(URL documentURL) { + super(documentURL); + } + + /** + * Creates an SVG12RhinoInterpreter object. + */ + public SVG12RhinoInterpreter(URL documentURL, + ImportInfo imports) { + super(documentURL, imports); + } + + /** + * Defines the class for the global object. + */ + protected void defineGlobalWrapperClass(Scriptable global) { + try { + ScriptableObject.defineClass(global, GlobalWrapper.class); + } catch (Exception ex) { + // cannot happen + } + } + + /** + * Creates the global object. + */ + protected ScriptableObject createGlobalObject(Context ctx) { + return new GlobalWrapper(ctx); + } +} Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAElementBridge.java Tue Dec 23 15:10:45 2014 @@ -23,11 +23,11 @@ import java.awt.Cursor; import java.util.Iterator; import java.util.List; +import org.apache.batik.anim.dom.SVGOMAElement; +import org.apache.batik.anim.dom.SVGOMAnimationElement; +import org.apache.batik.anim.dom.SVGOMDocument; import org.apache.batik.dom.events.AbstractEvent; import org.apache.batik.dom.events.NodeEventTarget; -import org.apache.batik.dom.svg.SVGOMAElement; -import org.apache.batik.dom.svg.SVGOMAnimationElement; -import org.apache.batik.dom.svg.SVGOMDocument; import org.apache.batik.gvt.GraphicsNode; import org.apache.batik.util.ParsedURL; import org.apache.batik.util.XMLConstants; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAltGlyphElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAltGlyphElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAltGlyphElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAltGlyphElementBridge.java Tue Dec 23 15:10:45 2014 @@ -20,8 +20,8 @@ package org.apache.batik.bridge; import java.text.AttributedCharacterIterator; +import org.apache.batik.anim.dom.SVGOMDocument; import org.apache.batik.dom.AbstractNode; -import org.apache.batik.dom.svg.SVGOMDocument; import org.apache.batik.dom.util.XLinkSupport; import org.apache.batik.gvt.font.Glyph; import org.apache.batik.gvt.text.GVTAttributedCharacterIterator; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimateColorElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimateColorElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimateColorElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimateColorElementBridge.java Tue Dec 23 15:10:45 2014 @@ -19,8 +19,8 @@ package org.apache.batik.bridge; import org.apache.batik.anim.AbstractAnimation; -import org.apache.batik.dom.anim.AnimationTarget; import org.apache.batik.anim.ColorAnimation; +import org.apache.batik.anim.dom.AnimationTarget; import org.apache.batik.anim.values.AnimatableColorValue; import org.apache.batik.anim.values.AnimatablePaintValue; import org.apache.batik.anim.values.AnimatableValue; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimateElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimateElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimateElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimateElementBridge.java Tue Dec 23 15:10:45 2014 @@ -23,8 +23,8 @@ import java.util.List; import org.apache.batik.anim.AbstractAnimation; import org.apache.batik.anim.AnimationEngine; -import org.apache.batik.dom.anim.AnimationTarget; import org.apache.batik.anim.SimpleAnimation; +import org.apache.batik.anim.dom.AnimationTarget; import org.apache.batik.anim.values.AnimatableValue; import org.apache.batik.util.SMILConstants; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimateMotionElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimateMotionElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimateMotionElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimateMotionElementBridge.java Tue Dec 23 15:10:45 2014 @@ -23,14 +23,14 @@ import java.util.List; import org.apache.batik.anim.AbstractAnimation; import org.apache.batik.anim.AnimationEngine; -import org.apache.batik.dom.anim.AnimationTarget; import org.apache.batik.anim.MotionAnimation; +import org.apache.batik.anim.dom.AnimationTarget; +import org.apache.batik.anim.dom.SVGOMElement; +import org.apache.batik.anim.dom.SVGOMPathElement; import org.apache.batik.anim.values.AnimatableMotionPointValue; import org.apache.batik.anim.values.AnimatableValue; import org.apache.batik.ext.awt.geom.ExtendedGeneralPath; import org.apache.batik.dom.svg.SVGAnimatedPathDataSupport; -import org.apache.batik.dom.svg.SVGOMElement; -import org.apache.batik.dom.svg.SVGOMPathElement; import org.apache.batik.dom.util.XLinkSupport; import org.apache.batik.parser.AWTPathProducer; import org.apache.batik.parser.AngleHandler; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimateTransformElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimateTransformElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimateTransformElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimateTransformElementBridge.java Tue Dec 23 15:10:45 2014 @@ -21,8 +21,8 @@ package org.apache.batik.bridge; import java.util.ArrayList; import org.apache.batik.anim.AbstractAnimation; -import org.apache.batik.dom.anim.AnimationTarget; import org.apache.batik.anim.TransformAnimation; +import org.apache.batik.anim.dom.AnimationTarget; import org.apache.batik.anim.values.AnimatableValue; import org.apache.batik.anim.values.AnimatableTransformListValue; import org.apache.batik.dom.svg.SVGOMTransform; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimationElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimationElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimationElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimationElementBridge.java Tue Dec 23 15:10:45 2014 @@ -25,16 +25,16 @@ import java.util.Calendar; import org.apache.batik.anim.AbstractAnimation; import org.apache.batik.anim.AnimationEngine; +import org.apache.batik.anim.dom.AnimatableElement; +import org.apache.batik.anim.dom.AnimatedLiveAttributeValue; +import org.apache.batik.anim.dom.AnimationTarget; +import org.apache.batik.anim.dom.AnimationTargetListener; +import org.apache.batik.anim.dom.SVGOMElement; import org.apache.batik.anim.timing.TimedElement; import org.apache.batik.anim.values.AnimatableValue; import org.apache.batik.css.engine.CSSEngineEvent; import org.apache.batik.dom.AbstractNode; -import org.apache.batik.dom.anim.AnimatableElement; -import org.apache.batik.dom.anim.AnimationTarget; -import org.apache.batik.dom.anim.AnimationTargetListener; -import org.apache.batik.dom.svg.AnimatedLiveAttributeValue; import org.apache.batik.dom.svg.SVGAnimationContext; -import org.apache.batik.dom.svg.SVGOMElement; import org.apache.batik.dom.util.XLinkSupport; import org.apache.batik.util.SVGTypes; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimationEngine.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimationEngine.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimationEngine.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGAnimationEngine.java Tue Dec 23 15:10:45 2014 @@ -30,7 +30,10 @@ import java.util.Set; import org.apache.batik.anim.AnimationEngine; import org.apache.batik.anim.AnimationException; -import org.apache.batik.dom.anim.AnimationTarget; +import org.apache.batik.anim.dom.AnimationTarget; +import org.apache.batik.anim.dom.SVGOMDocument; +import org.apache.batik.anim.dom.SVGOMElement; +import org.apache.batik.anim.dom.SVGStylableElement; import org.apache.batik.anim.timing.TimedDocumentRoot; import org.apache.batik.anim.timing.TimedElement; import org.apache.batik.anim.values.AnimatableAngleValue; @@ -59,9 +62,6 @@ import org.apache.batik.css.engine.value import org.apache.batik.css.engine.value.StringValue; import org.apache.batik.css.engine.value.Value; import org.apache.batik.css.engine.value.ValueManager; -import org.apache.batik.dom.svg.SVGOMDocument; -import org.apache.batik.dom.svg.SVGOMElement; -import org.apache.batik.dom.svg.SVGStylableElement; import org.apache.batik.parser.DefaultPreserveAspectRatioHandler; import org.apache.batik.parser.FloatArrayProducer; import org.apache.batik.parser.DefaultLengthHandler; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGCircleElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGCircleElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGCircleElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGCircleElementBridge.java Tue Dec 23 15:10:45 2014 @@ -21,10 +21,10 @@ package org.apache.batik.bridge; import java.awt.geom.Ellipse2D; import java.awt.geom.Rectangle2D; -import org.apache.batik.dom.svg.AbstractSVGAnimatedLength; -import org.apache.batik.dom.svg.AnimatedLiveAttributeValue; +import org.apache.batik.anim.dom.AbstractSVGAnimatedLength; +import org.apache.batik.anim.dom.AnimatedLiveAttributeValue; +import org.apache.batik.anim.dom.SVGOMCircleElement; import org.apache.batik.dom.svg.LiveAttributeException; -import org.apache.batik.dom.svg.SVGOMCircleElement; import org.apache.batik.gvt.ShapeNode; import org.apache.batik.gvt.ShapePainter; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGClipPathElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGClipPathElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGClipPathElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGClipPathElementBridge.java Tue Dec 23 15:10:45 2014 @@ -24,7 +24,7 @@ import java.awt.geom.AffineTransform; import java.awt.geom.Area; import java.awt.geom.GeneralPath; -import org.apache.batik.dom.svg.SVGOMUseElement; +import org.apache.batik.anim.dom.SVGOMUseElement; import org.apache.batik.ext.awt.image.renderable.ClipRable; import org.apache.batik.ext.awt.image.renderable.ClipRable8Bit; import org.apache.batik.ext.awt.image.renderable.Filter; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGDescriptiveElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGDescriptiveElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGDescriptiveElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGDescriptiveElementBridge.java Tue Dec 23 15:10:45 2014 @@ -25,10 +25,10 @@ import java.awt.geom.Rectangle2D; import org.w3c.dom.Element; import org.w3c.dom.events.MutationEvent; +import org.apache.batik.anim.dom.AnimatedLiveAttributeValue; +import org.apache.batik.anim.dom.SVGOMElement; import org.apache.batik.css.engine.CSSEngineEvent; -import org.apache.batik.dom.svg.AnimatedLiveAttributeValue; import org.apache.batik.dom.svg.SVGContext; -import org.apache.batik.dom.svg.SVGOMElement; /** * Base class for 'descriptive' elements, mostly title and desc. Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGDocumentBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGDocumentBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGDocumentBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGDocumentBridge.java Tue Dec 23 15:10:45 2014 @@ -21,10 +21,10 @@ package org.apache.batik.bridge; import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; +import org.apache.batik.anim.dom.AnimatedLiveAttributeValue; +import org.apache.batik.anim.dom.SVGOMDocument; import org.apache.batik.css.engine.CSSEngineEvent; -import org.apache.batik.dom.svg.AnimatedLiveAttributeValue; import org.apache.batik.dom.svg.SVGContext; -import org.apache.batik.dom.svg.SVGOMDocument; import org.apache.batik.gvt.GraphicsNode; import org.apache.batik.gvt.RootGraphicsNode; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGEllipseElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGEllipseElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGEllipseElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGEllipseElementBridge.java Tue Dec 23 15:10:45 2014 @@ -21,10 +21,10 @@ package org.apache.batik.bridge; import java.awt.geom.Ellipse2D; import java.awt.geom.Rectangle2D; -import org.apache.batik.dom.svg.AbstractSVGAnimatedLength; -import org.apache.batik.dom.svg.AnimatedLiveAttributeValue; +import org.apache.batik.anim.dom.AbstractSVGAnimatedLength; +import org.apache.batik.anim.dom.AnimatedLiveAttributeValue; +import org.apache.batik.anim.dom.SVGOMEllipseElement; import org.apache.batik.dom.svg.LiveAttributeException; -import org.apache.batik.dom.svg.SVGOMEllipseElement; import org.apache.batik.gvt.ShapeNode; import org.apache.batik.gvt.ShapePainter; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGFilterElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGFilterElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGFilterElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGFilterElementBridge.java Tue Dec 23 15:10:45 2014 @@ -25,7 +25,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; -import org.apache.batik.dom.svg.SVGOMDocument; +import org.apache.batik.anim.dom.SVGOMDocument; import org.apache.batik.dom.util.XLinkSupport; import org.apache.batik.ext.awt.image.PadMode; import org.apache.batik.ext.awt.image.renderable.Filter; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGFontUtilities.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGFontUtilities.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGFontUtilities.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGFontUtilities.java Tue Dec 23 15:10:45 2014 @@ -25,12 +25,12 @@ import java.util.List; import java.util.Map; import java.util.StringTokenizer; -import org.apache.batik.dom.svg.SVGOMDocument; import org.apache.batik.gvt.font.GVTFontFamily; import org.apache.batik.gvt.font.GVTFontFace; import org.apache.batik.gvt.font.UnresolvedFontFamily; import org.apache.batik.util.SVGConstants; +import org.apache.batik.anim.dom.SVGOMDocument; import org.apache.batik.css.engine.CSSEngine; import org.apache.batik.css.engine.FontFaceRule; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGImageElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGImageElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGImageElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGImageElementBridge.java Tue Dec 23 15:10:45 2014 @@ -31,17 +31,17 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import org.apache.batik.anim.dom.AbstractSVGAnimatedLength; +import org.apache.batik.anim.dom.AnimatedLiveAttributeValue; +import org.apache.batik.anim.dom.SVGOMAnimatedPreserveAspectRatio; +import org.apache.batik.anim.dom.SVGOMDocument; +import org.apache.batik.anim.dom.SVGOMElement; import org.apache.batik.css.engine.CSSEngine; import org.apache.batik.css.engine.SVGCSSEngine; import org.apache.batik.dom.AbstractNode; import org.apache.batik.dom.events.DOMMouseEvent; import org.apache.batik.dom.events.NodeEventTarget; -import org.apache.batik.dom.svg.AbstractSVGAnimatedLength; -import org.apache.batik.dom.svg.AnimatedLiveAttributeValue; import org.apache.batik.dom.svg.LiveAttributeException; -import org.apache.batik.dom.svg.SVGOMAnimatedPreserveAspectRatio; -import org.apache.batik.dom.svg.SVGOMDocument; -import org.apache.batik.dom.svg.SVGOMElement; import org.apache.batik.dom.util.DOMUtilities; import org.apache.batik.ext.awt.image.renderable.ClipRable8Bit; import org.apache.batik.ext.awt.image.renderable.Filter; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGLineElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGLineElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGLineElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGLineElementBridge.java Tue Dec 23 15:10:45 2014 @@ -20,10 +20,10 @@ package org.apache.batik.bridge; import java.awt.geom.Line2D; -import org.apache.batik.dom.svg.AbstractSVGAnimatedLength; -import org.apache.batik.dom.svg.AnimatedLiveAttributeValue; +import org.apache.batik.anim.dom.AbstractSVGAnimatedLength; +import org.apache.batik.anim.dom.AnimatedLiveAttributeValue; +import org.apache.batik.anim.dom.SVGOMLineElement; import org.apache.batik.dom.svg.LiveAttributeException; -import org.apache.batik.dom.svg.SVGOMLineElement; import org.apache.batik.gvt.ShapeNode; import org.apache.batik.gvt.ShapePainter; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGPathElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGPathElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGPathElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGPathElementBridge.java Tue Dec 23 15:10:45 2014 @@ -22,12 +22,12 @@ import java.awt.Shape; import java.awt.geom.GeneralPath; import java.awt.geom.Point2D; +import org.apache.batik.anim.dom.AnimatedLiveAttributeValue; +import org.apache.batik.anim.dom.SVGOMAnimatedPathData; +import org.apache.batik.anim.dom.SVGOMPathElement; import org.apache.batik.css.engine.SVGCSSEngine; -import org.apache.batik.dom.svg.AnimatedLiveAttributeValue; import org.apache.batik.dom.svg.LiveAttributeException; import org.apache.batik.dom.svg.SVGAnimatedPathDataSupport; -import org.apache.batik.dom.svg.SVGOMAnimatedPathData; -import org.apache.batik.dom.svg.SVGOMPathElement; import org.apache.batik.dom.svg.SVGPathContext; import org.apache.batik.ext.awt.geom.PathLength; import org.apache.batik.gvt.ShapeNode; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGPatternElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGPatternElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGPatternElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGPatternElementBridge.java Tue Dec 23 15:10:45 2014 @@ -27,7 +27,7 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.List; -import org.apache.batik.dom.svg.SVGOMDocument; +import org.apache.batik.anim.dom.SVGOMDocument; import org.apache.batik.dom.util.XLinkSupport; import org.apache.batik.ext.awt.image.ConcreteComponentTransferFunction; import org.apache.batik.ext.awt.image.renderable.ComponentTransferRable8Bit; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGPolygonElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGPolygonElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGPolygonElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGPolygonElementBridge.java Tue Dec 23 15:10:45 2014 @@ -21,11 +21,11 @@ package org.apache.batik.bridge; import java.awt.Shape; import java.awt.geom.GeneralPath; +import org.apache.batik.anim.dom.AnimatedLiveAttributeValue; +import org.apache.batik.anim.dom.SVGOMAnimatedPoints; +import org.apache.batik.anim.dom.SVGOMPolygonElement; import org.apache.batik.css.engine.SVGCSSEngine; -import org.apache.batik.dom.svg.AnimatedLiveAttributeValue; import org.apache.batik.dom.svg.LiveAttributeException; -import org.apache.batik.dom.svg.SVGOMAnimatedPoints; -import org.apache.batik.dom.svg.SVGOMPolygonElement; import org.apache.batik.gvt.ShapeNode; import org.apache.batik.parser.AWTPolygonProducer; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGPolylineElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGPolylineElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGPolylineElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGPolylineElementBridge.java Tue Dec 23 15:10:45 2014 @@ -21,11 +21,11 @@ package org.apache.batik.bridge; import java.awt.Shape; import java.awt.geom.GeneralPath; +import org.apache.batik.anim.dom.AnimatedLiveAttributeValue; +import org.apache.batik.anim.dom.SVGOMAnimatedPoints; +import org.apache.batik.anim.dom.SVGOMPolylineElement; import org.apache.batik.css.engine.SVGCSSEngine; -import org.apache.batik.dom.svg.AnimatedLiveAttributeValue; import org.apache.batik.dom.svg.LiveAttributeException; -import org.apache.batik.dom.svg.SVGOMAnimatedPoints; -import org.apache.batik.dom.svg.SVGOMPolylineElement; import org.apache.batik.gvt.ShapeNode; import org.apache.batik.parser.AWTPolylineProducer; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGRectElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGRectElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGRectElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGRectElementBridge.java Tue Dec 23 15:10:45 2014 @@ -22,10 +22,10 @@ import java.awt.Shape; import java.awt.geom.Rectangle2D; import java.awt.geom.RoundRectangle2D; -import org.apache.batik.dom.svg.AbstractSVGAnimatedLength; -import org.apache.batik.dom.svg.AnimatedLiveAttributeValue; +import org.apache.batik.anim.dom.AbstractSVGAnimatedLength; +import org.apache.batik.anim.dom.AnimatedLiveAttributeValue; +import org.apache.batik.anim.dom.SVGOMRectElement; import org.apache.batik.dom.svg.LiveAttributeException; -import org.apache.batik.dom.svg.SVGOMRectElement; import org.apache.batik.gvt.ShapeNode; import org.apache.batik.gvt.ShapePainter; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGSVGElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGSVGElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGSVGElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGSVGElementBridge.java Tue Dec 23 15:10:45 2014 @@ -29,13 +29,13 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import org.apache.batik.dom.svg.AbstractSVGAnimatedLength; -import org.apache.batik.dom.svg.AnimatedLiveAttributeValue; +import org.apache.batik.anim.dom.AbstractSVGAnimatedLength; +import org.apache.batik.anim.dom.AnimatedLiveAttributeValue; +import org.apache.batik.anim.dom.SVGOMAnimatedRect; +import org.apache.batik.anim.dom.SVGOMElement; +import org.apache.batik.anim.dom.SVGOMSVGElement; import org.apache.batik.dom.svg.LiveAttributeException; import org.apache.batik.dom.svg.SVGContext; -import org.apache.batik.dom.svg.SVGOMAnimatedRect; -import org.apache.batik.dom.svg.SVGOMElement; -import org.apache.batik.dom.svg.SVGOMSVGElement; import org.apache.batik.dom.svg.SVGSVGContext; import org.apache.batik.ext.awt.image.renderable.ClipRable8Bit; import org.apache.batik.ext.awt.image.renderable.Filter; @@ -43,7 +43,6 @@ import org.apache.batik.gvt.CanvasGraphi import org.apache.batik.gvt.CompositeGraphicsNode; import org.apache.batik.gvt.GraphicsNode; import org.apache.batik.gvt.ShapeNode; -import org.apache.batik.gvt.TextNode; import org.w3c.dom.Element; import org.w3c.dom.Node; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGSetElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGSetElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGSetElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGSetElementBridge.java Tue Dec 23 15:10:45 2014 @@ -19,8 +19,8 @@ package org.apache.batik.bridge; import org.apache.batik.anim.AbstractAnimation; -import org.apache.batik.dom.anim.AnimationTarget; import org.apache.batik.anim.SetAnimation; +import org.apache.batik.anim.dom.AnimationTarget; import org.apache.batik.anim.values.AnimatableValue; /** Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGTextElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGTextElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGTextElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGTextElementBridge.java Tue Dec 23 15:10:45 2014 @@ -40,6 +40,13 @@ import java.util.Map; import java.util.Set; import java.util.WeakHashMap; +import org.apache.batik.anim.dom.AbstractSVGAnimatedLength; +import org.apache.batik.anim.dom.AnimatedLiveAttributeValue; +import org.apache.batik.anim.dom.SVGOMAnimatedEnumeration; +import org.apache.batik.anim.dom.SVGOMAnimatedLengthList; +import org.apache.batik.anim.dom.SVGOMAnimatedNumberList; +import org.apache.batik.anim.dom.SVGOMElement; +import org.apache.batik.anim.dom.SVGOMTextPositioningElement; import org.apache.batik.css.engine.CSSEngineEvent; import org.apache.batik.css.engine.CSSStylableElement; import org.apache.batik.css.engine.SVGCSSEngine; @@ -47,32 +54,20 @@ import org.apache.batik.css.engine.Style import org.apache.batik.css.engine.value.ListValue; import org.apache.batik.css.engine.value.Value; import org.apache.batik.dom.events.NodeEventTarget; -import org.apache.batik.dom.svg.AbstractSVGAnimatedLength; -import org.apache.batik.dom.svg.AnimatedLiveAttributeValue; import org.apache.batik.dom.svg.LiveAttributeException; import org.apache.batik.dom.svg.SVGContext; -import org.apache.batik.dom.svg.SVGOMAnimatedEnumeration; -import org.apache.batik.dom.svg.SVGOMAnimatedLengthList; -import org.apache.batik.dom.svg.SVGOMAnimatedNumberList; -import org.apache.batik.dom.svg.SVGOMElement; -import org.apache.batik.dom.svg.SVGOMTextPositioningElement; import org.apache.batik.dom.svg.SVGTextContent; import org.apache.batik.dom.util.XLinkSupport; import org.apache.batik.dom.util.XMLSupport; import org.apache.batik.gvt.GraphicsNode; -import org.apache.batik.gvt.TextNode; import org.apache.batik.gvt.font.GVTFont; import org.apache.batik.gvt.font.GVTFontFamily; import org.apache.batik.gvt.font.GVTGlyphMetrics; import org.apache.batik.gvt.font.GVTGlyphVector; import org.apache.batik.gvt.font.UnresolvedFontFamily; -import org.apache.batik.gvt.renderer.StrokingTextPainter; import org.apache.batik.gvt.text.GVTAttributedCharacterIterator; -import org.apache.batik.gvt.text.Mark; -import org.apache.batik.gvt.text.TextHit; import org.apache.batik.gvt.text.TextPaintInfo; import org.apache.batik.gvt.text.TextPath; -import org.apache.batik.gvt.text.TextSpanLayout; import org.apache.batik.util.XMLConstants; import org.w3c.dom.Element; Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGUseElementBridge.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGUseElementBridge.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGUseElementBridge.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/SVGUseElementBridge.java Tue Dec 23 15:10:45 2014 @@ -23,13 +23,13 @@ import java.awt.RenderingHints; import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; +import org.apache.batik.anim.dom.AbstractSVGAnimatedLength; +import org.apache.batik.anim.dom.AnimatedLiveAttributeValue; +import org.apache.batik.anim.dom.SVGOMAnimatedLength; +import org.apache.batik.anim.dom.SVGOMDocument; +import org.apache.batik.anim.dom.SVGOMUseElement; import org.apache.batik.dom.events.NodeEventTarget; -import org.apache.batik.dom.svg.AbstractSVGAnimatedLength; -import org.apache.batik.dom.svg.AnimatedLiveAttributeValue; import org.apache.batik.dom.svg.LiveAttributeException; -import org.apache.batik.dom.svg.SVGOMAnimatedLength; -import org.apache.batik.dom.svg.SVGOMDocument; -import org.apache.batik.dom.svg.SVGOMUseElement; import org.apache.batik.dom.svg.SVGOMUseShadowRoot; import org.apache.batik.gvt.CompositeGraphicsNode; import org.apache.batik.gvt.GraphicsNode; Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/ScriptHandler.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/ScriptHandler.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/ScriptHandler.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/ScriptHandler.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,49 @@ +/* + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package org.apache.batik.bridge; + +import org.w3c.dom.Document; + + +/** + * This interface must be implemented in order to call Java code from + * an SVG document. + * + * A ScriptHandler instance is called when a 'script' element's 'type' + * attribute value is 'application/java-archive' and when the + * manifest of the jar file referenced by the 'xlink:href' attribute + * contains a 'Script-Handler' entry. The value of this entry must be + * the classname of the ScriptHandler to call. + * + * This classes implementing this interface must have a default + * constructor. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public interface ScriptHandler { + + /** + * Runs this handler. This method is called by the SVG viewer + * when the scripts are loaded. + * @param doc The current document. + * @param win An object which represents the current viewer. + */ + void run(Document doc, Window win); +} Modified: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/ScriptingEnvironment.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/ScriptingEnvironment.java?rev=1647590&r1=1647589&r2=1647590&view=diff ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/ScriptingEnvironment.java (original) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/bridge/ScriptingEnvironment.java Tue Dec 23 15:10:45 2014 @@ -43,12 +43,12 @@ import java.util.zip.GZIPOutputStream; import org.apache.batik.dom.AbstractElement; import org.apache.batik.dom.GenericDOMImplementation; import org.apache.batik.dom.events.NodeEventTarget; -import org.apache.batik.dom.svg.SAXSVGDocumentFactory; -import org.apache.batik.dom.svg.SVGOMDocument; -import org.apache.batik.dom.svg.SVGOMScriptElement; import org.apache.batik.dom.util.DOMUtilities; import org.apache.batik.dom.util.SAXDocumentFactory; import org.apache.batik.dom.util.XLinkSupport; +import org.apache.batik.anim.dom.SAXSVGDocumentFactory; +import org.apache.batik.anim.dom.SVGOMDocument; +import org.apache.batik.anim.dom.SVGOMScriptElement; import org.apache.batik.bridge.Location; import org.apache.batik.script.Interpreter; import org.apache.batik.script.InterpreterException; @@ -378,7 +378,7 @@ public class ScriptingEnvironment extend /** * Creates a new Window object. */ - protected org.apache.batik.script.Window createWindow(Interpreter interp, + protected org.apache.batik.bridge.Window createWindow(Interpreter interp, String lang) { return new Window(interp, lang); } @@ -796,7 +796,7 @@ public class ScriptingEnvironment extend /** * Represents the window object of this environment. */ - protected class Window implements org.apache.batik.script.Window { + protected class Window implements org.apache.batik.bridge.Window { /** * A <code>TimerTask</code> to invoke a @@ -932,7 +932,7 @@ public class ScriptingEnvironment extend /** * Implements {@link - * org.apache.batik.script.Window#setInterval(String,long)}. + * org.apache.batik.bridge.Window#setInterval(String,long)}. */ public Object setInterval(final String script, long interval) { IntervalScriptTimerTask tt = new IntervalScriptTimerTask(script); @@ -942,7 +942,7 @@ public class ScriptingEnvironment extend /** * Implements {@link - * org.apache.batik.script.Window#setInterval(Runnable,long)}. + * org.apache.batik.bridge.Window#setInterval(Runnable,long)}. */ public Object setInterval(final Runnable r, long interval) { IntervalRunnableTimerTask tt = new IntervalRunnableTimerTask(r); @@ -952,7 +952,7 @@ public class ScriptingEnvironment extend /** * Implements {@link - * org.apache.batik.script.Window#clearInterval(Object)}. + * org.apache.batik.bridge.Window#clearInterval(Object)}. */ public void clearInterval(Object interval) { if (interval == null) return; @@ -961,7 +961,7 @@ public class ScriptingEnvironment extend /** * Implements {@link - * org.apache.batik.script.Window#setTimeout(String,long)}. + * org.apache.batik.bridge.Window#setTimeout(String,long)}. */ public Object setTimeout(final String script, long timeout) { TimeoutScriptTimerTask tt = new TimeoutScriptTimerTask(script); @@ -971,7 +971,7 @@ public class ScriptingEnvironment extend /** * Implements {@link - * org.apache.batik.script.Window#setTimeout(Runnable,long)}. + * org.apache.batik.bridge.Window#setTimeout(Runnable,long)}. */ public Object setTimeout(final Runnable r, long timeout) { TimeoutRunnableTimerTask tt = new TimeoutRunnableTimerTask(r); @@ -981,7 +981,7 @@ public class ScriptingEnvironment extend /** * Implements {@link - * org.apache.batik.script.Window#clearTimeout(Object)}. + * org.apache.batik.bridge.Window#clearTimeout(Object)}. */ public void clearTimeout(Object timeout) { if (timeout == null) return; @@ -990,7 +990,7 @@ public class ScriptingEnvironment extend /** * Implements {@link - * org.apache.batik.script.Window#parseXML(String,Document)}. + * org.apache.batik.bridge.Window#parseXML(String,Document)}. */ public Node parseXML(String text, Document doc) { // Try and parse it as an SVGDocument @@ -1057,9 +1057,9 @@ public class ScriptingEnvironment extend /** * Implements {@link - * org.apache.batik.script.Window#getURL(String,org.apache.batik.script.Window.URLResponseHandler)}. + * org.apache.batik.bridge.Window#getURL(String,org.apache.batik.bridge.Window.URLResponseHandler)}. */ - public void getURL(String uri, org.apache.batik.script.Window.URLResponseHandler h) { + public void getURL(String uri, org.apache.batik.bridge.Window.URLResponseHandler h) { getURL(uri, h, null); } @@ -1068,10 +1068,10 @@ public class ScriptingEnvironment extend static final String UTF_8 ="UTF-8"; /** * Implements {@link - * org.apache.batik.script.Window#getURL(String,org.apache.batik.script.Window.URLResponseHandler,String)}. + * org.apache.batik.bridge.Window#getURL(String,org.apache.batik.bridge.Window.URLResponseHandler,String)}. */ public void getURL(final String uri, - final org.apache.batik.script.Window.URLResponseHandler h, + final org.apache.batik.bridge.Window.URLResponseHandler h, final String enc) { Thread t = new Thread() { public void run() { @@ -1145,19 +1145,19 @@ public class ScriptingEnvironment extend public void postURL(String uri, String content, - org.apache.batik.script.Window.URLResponseHandler h) { + org.apache.batik.bridge.Window.URLResponseHandler h) { postURL(uri, content, h, "text/plain", null); } public void postURL(String uri, String content, - org.apache.batik.script.Window.URLResponseHandler h, + org.apache.batik.bridge.Window.URLResponseHandler h, String mimeType) { postURL(uri, content, h, mimeType, null); } public void postURL(final String uri, final String content, - final org.apache.batik.script.Window.URLResponseHandler h, + final org.apache.batik.bridge.Window.URLResponseHandler h, final String mimeType, final String fEnc) { Thread t = new Thread() {