You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by ca...@apache.org on 2006/01/29 23:33:52 UTC
svn commit: r373377 - in /xmlgraphics/batik/trunk/sources/org/apache/batik:
apps/svgbrowser/Main.java transcoder/SVGAbstractTranscoder.java
Author: cam
Date: Sun Jan 29 14:33:48 2006
New Revision: 373377
URL: http://svn.apache.org/viewcvs?rev=373377&view=rev
Log:
1. Transcoders with the KEY_EXECUTE_ONLOAD hint set force the document
to be dynamic.
2. Fix to allow transcoders that execute onload to work with SVG 1.2
documents.
Modified:
xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/Main.java
xmlgraphics/batik/trunk/sources/org/apache/batik/transcoder/SVGAbstractTranscoder.java
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/Main.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/Main.java?rev=373377&r1=373376&r2=373377&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/Main.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/Main.java Sun Jan 29 14:33:48 2006
@@ -219,7 +219,7 @@
* Controls whether the application can override the
* system security policy property. This is done when there
* was no initial security policy specified when the application
- * stated, in which case Batik will use that property.
+ * started, in which case Batik will use that property.
*/
protected boolean overrideSecurityPolicy = false;
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/transcoder/SVGAbstractTranscoder.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/trunk/sources/org/apache/batik/transcoder/SVGAbstractTranscoder.java?rev=373377&r1=373376&r2=373377&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/transcoder/SVGAbstractTranscoder.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/transcoder/SVGAbstractTranscoder.java Sun Jan 29 14:33:48 2006
@@ -1,6 +1,6 @@
/*
- Copyright 2002-2004 The Apache Software Foundation
+ Copyright 2002-2004,2006 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -38,6 +38,7 @@
import org.apache.batik.bridge.UserAgent;
import org.apache.batik.bridge.UserAgentAdapter;
import org.apache.batik.bridge.ViewBox;
+import org.apache.batik.bridge.svg12.SVG12BridgeContext;
import org.apache.batik.dom.svg.SAXSVGDocumentFactory;
import org.apache.batik.dom.svg.SVGDOMImplementation;
import org.apache.batik.dom.svg.SVGOMDocument;
@@ -70,7 +71,8 @@
* </ul>
*
* @author <a href="mailto:Thierry.Kormann@sophia.inria.fr">Thierry Kormann</a>
- * @version $Id$ */
+ * @version $Id$
+ */
public abstract class SVGAbstractTranscoder extends XMLAbstractTranscoder {
/**
* Value used as a default for the default font-family hint
@@ -185,17 +187,16 @@
}
}
- ctx = createBridgeContext();
SVGOMDocument svgDoc = (SVGOMDocument)document;
SVGSVGElement root = svgDoc.getRootElement();
+ ctx = createBridgeContext(svgDoc);
// build the GVT tree
builder = new GVTBuilder();
// flag that indicates if the document is dynamic
boolean isDynamic =
- (hints.containsKey(KEY_EXECUTE_ONLOAD) &&
- ((Boolean)hints.get(KEY_EXECUTE_ONLOAD)).booleanValue() &&
- ctx.isDynamicDocument(svgDoc));
+ hints.containsKey(KEY_EXECUTE_ONLOAD) &&
+ ((Boolean)hints.get(KEY_EXECUTE_ONLOAD)).booleanValue();
GraphicsNode gvtRoot;
try {
@@ -293,7 +294,10 @@
* BridgeContext so subclasses can insert new/modified
* bridges in the context.
*/
- protected BridgeContext createBridgeContext() {
+ protected BridgeContext createBridgeContext(SVGOMDocument doc) {
+ if (doc.isSVG12()) {
+ return new SVG12BridgeContext(userAgent);
+ }
return new BridgeContext(userAgent);
}