Skip to content
Commits on Source (18)
......@@ -4,8 +4,27 @@ Change Log
The following log records some of the most important changes.
Bug fixing is an ongoing task, so it is implied in all sub-releases.
1.8 -> 1.9pre
-------------
1.9 -> 1.10pre
--------------
BATIK-906: Should never use Error to report runtime errors
BATIK-1123: Missing import of ImportInfo class
BATIK-1125: Rasterizer fails with base64 embedded png
BATIK-1140: Show line numbers on exception
BATIK-1142: Remove e.printStackTrace for BridgeException in SVGAbstractTranscoder
BATIK-1157: Wrong value for default JPEG quality in documentation
BATIK-1170: Incorrect ColorConvertOp alpha handling breaks masking
BATIK-1196: Run batik tests from junit
BATIK-1197: Make jython and rhino optional
BATIK-1198: TIFF transcoder looks for invalid class name for its WriteAdapter
BATIK-1200: ImagingOpException: Unable to transform src image
BATIK-1204: Remove hashtable
BATIK-1212: Show real error on URL failure
BATIK-1216: Compile error on Java 10
BATIK-1222: Only call DOMImplementation in deserialization
1.8 -> 1.9
----------
- Maven build support
- Java 6 or later is minimum runtime required
......
Apache Batik
Copyright 1999-2017 The Apache Software Foundation
Copyright 1999-2018 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
......
......@@ -32,7 +32,7 @@
<parent>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik</artifactId>
<version>1.9</version>
<version>1.10</version>
</parent>
<dependencies>
......
......@@ -31,7 +31,7 @@
<parent>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik</artifactId>
<version>1.9</version>
<version>1.10</version>
</parent>
<dependencies>
......
......@@ -37,7 +37,7 @@ import org.w3c.dom.Document;
* An abstract base class for managing animation in a document.
*
* @author <a href="mailto:cam%40mcc%2eid%2eau">Cameron McCormack</a>
* @version $Id: AnimationEngine.java 1733416 2016-03-03 07:07:13Z gadams $
* @version $Id: AnimationEngine.java 1804130 2017-08-04 14:41:11Z ssteiner $
*/
public abstract class AnimationEngine {
......@@ -90,22 +90,21 @@ public abstract class AnimationEngine {
*/
public void dispose() {
// Remove any target listeners that are registered.
Iterator i = targets.entrySet().iterator();
while (i.hasNext()) {
Map.Entry e = (Map.Entry) i.next();
for (Object o : targets.entrySet()) {
Map.Entry e = (Map.Entry) o;
AnimationTarget target = (AnimationTarget) e.getKey();
TargetInfo info = (TargetInfo) e.getValue();
Iterator j = info.xmlAnimations.iterator();
while (j.hasNext()) {
DoublyIndexedTable.Entry e2 =
(DoublyIndexedTable.Entry) j.next();
(DoublyIndexedTable.Entry) j.next();
String namespaceURI = (String) e2.getKey1();
String localName = (String) e2.getKey2();
Sandwich sandwich = (Sandwich) e2.getValue();
if (sandwich.listenerRegistered) {
target.removeTargetListener(namespaceURI, localName, false,
targetListener);
targetListener);
}
}
......@@ -116,7 +115,7 @@ public abstract class AnimationEngine {
Sandwich sandwich = (Sandwich) e2.getValue();
if (sandwich.listenerRegistered) {
target.removeTargetListener(null, propertyName, true,
targetListener);
targetListener);
}
}
}
......@@ -304,8 +303,7 @@ public abstract class AnimationEngine {
float waitTime = timedDocumentRoot.seekTo(time, hyperlinking);
Map.Entry[] targetEntries =
(Map.Entry[]) targets.entrySet().toArray(MAP_ENTRY_ARRAY);
for (int i = 0; i < targetEntries.length; i++) {
Map.Entry e = targetEntries[i];
for (Map.Entry e : targetEntries) {
AnimationTarget target = (AnimationTarget) e.getKey();
TargetInfo info = (TargetInfo) e.getValue();
......@@ -313,29 +311,29 @@ public abstract class AnimationEngine {
Iterator j = info.xmlAnimations.iterator();
while (j.hasNext()) {
DoublyIndexedTable.Entry e2 =
(DoublyIndexedTable.Entry) j.next();
(DoublyIndexedTable.Entry) j.next();
String namespaceURI = (String) e2.getKey1();
String localName = (String) e2.getKey2();
Sandwich sandwich = (Sandwich) e2.getValue();
if (sandwich.shouldUpdate ||
sandwich.animation != null
&& sandwich.animation.isDirty) {
&& sandwich.animation.isDirty) {
AnimatableValue av = null;
boolean usesUnderlying = false;
AbstractAnimation anim = sandwich.animation;
if (anim != null) {
av = anim.getComposedValue();
usesUnderlying =
sandwich.lowestAnimation.usesUnderlyingValue();
sandwich.lowestAnimation.usesUnderlyingValue();
anim.isDirty = false;
}
if (usesUnderlying && !sandwich.listenerRegistered) {
target.addTargetListener(namespaceURI, localName, false,
targetListener);
targetListener);
sandwich.listenerRegistered = true;
} else if (!usesUnderlying && sandwich.listenerRegistered) {
target.removeTargetListener(namespaceURI, localName,
false, targetListener);
false, targetListener);
sandwich.listenerRegistered = false;
}
target.updateAttributeValue(namespaceURI, localName, av);
......@@ -351,23 +349,23 @@ public abstract class AnimationEngine {
Sandwich sandwich = (Sandwich) e2.getValue();
if (sandwich.shouldUpdate ||
sandwich.animation != null
&& sandwich.animation.isDirty) {
&& sandwich.animation.isDirty) {
AnimatableValue av = null;
boolean usesUnderlying = false;
AbstractAnimation anim = sandwich.animation;
if (anim != null) {
av = anim.getComposedValue();
usesUnderlying =
sandwich.lowestAnimation.usesUnderlyingValue();
sandwich.lowestAnimation.usesUnderlyingValue();
anim.isDirty = false;
}
if (usesUnderlying && !sandwich.listenerRegistered) {
target.addTargetListener(null, propertyName, true,
targetListener);
targetListener);
sandwich.listenerRegistered = true;
} else if (!usesUnderlying && sandwich.listenerRegistered) {
target.removeTargetListener(null, propertyName, true,
targetListener);
targetListener);
sandwich.listenerRegistered = false;
}
if (usesUnderlying) {
......@@ -388,7 +386,7 @@ public abstract class AnimationEngine {
Sandwich sandwich = (Sandwich) e2.getValue();
if (sandwich.shouldUpdate ||
sandwich.animation != null
&& sandwich.animation.isDirty) {
&& sandwich.animation.isDirty) {
AnimatableValue av = null;
AbstractAnimation anim = sandwich.animation;
if (anim != null) {
......
......@@ -18,7 +18,6 @@
*/
package org.apache.batik.anim.dom;
import java.util.Iterator;
import java.util.LinkedList;
import org.apache.batik.anim.values.AnimatableValue;
......@@ -28,7 +27,7 @@ import org.apache.batik.anim.values.AnimatableValue;
* implements an {@link AnimatedAttributeListener} list.
*
* @author <a href="mailto:cam%40mcc%2eid%2eau">Cameron McCormack</a>
* @version $Id: AbstractSVGAnimatedValue.java 1733416 2016-03-03 07:07:13Z gadams $
* @version $Id: AbstractSVGAnimatedValue.java 1804130 2017-08-04 14:41:11Z ssteiner $
*/
public abstract class AbstractSVGAnimatedValue
implements AnimatedLiveAttributeValue {
......@@ -125,10 +124,9 @@ public abstract class AbstractSVGAnimatedValue
* Fires the listeners for the animated value.
*/
protected void fireAnimatedAttributeListeners() {
Iterator i = listeners.iterator();
while (i.hasNext()) {
for (Object listener1 : listeners) {
AnimatedAttributeListener listener =
(AnimatedAttributeListener) i.next();
(AnimatedAttributeListener) listener1;
listener.animatedAttributeChanged(element, this);
}
}
......
......@@ -44,7 +44,7 @@ import org.w3c.dom.svg.SVGDocument;
* from an URI using SAX2.
*
* @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
* @version $Id: SAXSVGDocumentFactory.java 1733416 2016-03-03 07:07:13Z gadams $
* @version $Id: SAXSVGDocumentFactory.java 1803524 2017-07-31 12:12:37Z ssteiner $
*/
public class SAXSVGDocumentFactory
extends SAXDocumentFactory
......@@ -76,7 +76,7 @@ public class SAXSVGDocumentFactory
* The dtd public IDs resource bundle class name.
*/
protected static final String DTDIDS =
"org.apache.batik.dom.svg.resources.dtdids";
"org.apache.batik.anim.dom.resources.dtdids";
/**
* Constant for HTTP content type header charset field.
......
......@@ -19,6 +19,7 @@
package org.apache.batik.anim.dom;
import java.net.URL;
import java.util.HashMap;
import org.apache.batik.css.engine.CSSContext;
import org.apache.batik.css.engine.CSSEngine;
......@@ -34,7 +35,7 @@ import org.apache.batik.dom.events.DocumentEventSupport;
import org.apache.batik.dom.events.EventSupport;
import org.apache.batik.dom.svg12.SVGOMWheelEvent;
import org.apache.batik.dom.svg12.XBLOMShadowTreeEvent;
import org.apache.batik.dom.util.HashTable;
import org.apache.batik.dom.util.DOMUtilities;
import org.apache.batik.util.ParsedURL;
import org.apache.batik.util.SVG12Constants;
......@@ -53,7 +54,7 @@ import org.w3c.dom.events.Event;
* It provides support the SVG 1.2 documents.
*
* @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
* @version $Id: SVG12DOMImplementation.java 1733416 2016-03-03 07:07:13Z gadams $
* @version $Id: SVG12DOMImplementation.java 1813521 2017-10-27 12:34:11Z ssteiner $
*/
public class SVG12DOMImplementation
extends SVGDOMImplementation {
......@@ -173,7 +174,7 @@ public class SVG12DOMImplementation
/**
* The SVG element factories.
*/
protected static HashTable svg12Factories = new HashTable(svg11Factories);
protected static HashMap<String, ElementFactory> svg12Factories = new HashMap<String, ElementFactory>(svg11Factories);
static {
svg12Factories.put(SVG12Constants.SVG_FLOW_DIV_TAG,
......@@ -413,7 +414,7 @@ public class SVG12DOMImplementation
/**
* The XBL element factories.
*/
protected static HashTable xblFactories = new HashTable();
protected static HashMap<String, ElementFactory> xblFactories = new HashMap<String, ElementFactory>();
static {
xblFactories.put(XBLConstants.XBL_XBL_TAG,
......
......@@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
*/
package org.apache.batik.anim.dom;
import org.apache.batik.dom.svg.SVGContext;
......@@ -26,7 +26,7 @@ import org.apache.batik.dom.svg.SVGContext;
* to the element.
*
* @author <a href="mailto:cam%40mcc%2eid%2eau">Cameron McCormack</a>
* @version $Id: SVGAnimationTargetContext.java 1733416 2016-03-03 07:07:13Z gadams $
* @version $Id: SVGAnimationTargetContext.java 1808001 2017-09-11 09:51:29Z ssteiner $
*/
public interface SVGAnimationTargetContext extends SVGContext {
......
......@@ -19,6 +19,7 @@
package org.apache.batik.anim.dom;
import java.net.URL;
import java.util.HashMap;
import org.apache.batik.css.dom.CSSOMSVGViewCSS;
import org.apache.batik.css.engine.CSSContext;
......@@ -35,7 +36,7 @@ import org.apache.batik.dom.events.DocumentEventSupport;
import org.apache.batik.dom.svg.SVGOMEvent;
import org.apache.batik.dom.util.CSSStyleDeclarationFactory;
import org.apache.batik.dom.util.DOMUtilities;
import org.apache.batik.dom.util.HashTable;
import org.apache.batik.i18n.LocalizableSupport;
import org.apache.batik.util.ParsedURL;
import org.apache.batik.util.SVGConstants;
......@@ -58,7 +59,7 @@ import org.w3c.dom.stylesheets.StyleSheet;
* It provides support the SVG 1.1 documents.
*
* @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
* @version $Id: SVGDOMImplementation.java 1733416 2016-03-03 07:07:13Z gadams $
* @version $Id: SVGDOMImplementation.java 1813521 2017-10-27 12:34:11Z ssteiner $
*/
public class SVGDOMImplementation
extends ExtensibleDOMImplementation
......@@ -76,7 +77,7 @@ public class SVGDOMImplementation
protected static final String RESOURCES =
"org.apache.batik.dom.svg.resources.Messages";
protected HashTable factories;
protected HashMap<String, ElementFactory> factories;
/**
* Returns the default instance of this class.
......@@ -172,7 +173,7 @@ public class SVGDOMImplementation
* Creates a stylesheet from the data of an xml-stylesheet
* processing instruction or return null.
*/
public StyleSheet createStyleSheet(Node n, HashTable attrs) {
public StyleSheet createStyleSheet(Node n, HashMap<String, String> attrs) {
throw new UnsupportedOperationException
("StyleSheetFactory.createStyleSheet is not implemented"); // XXX
}
......@@ -232,7 +233,7 @@ public class SVGDOMImplementation
/**
* The SVG element factories.
*/
protected static HashTable svg11Factories = new HashTable();
protected static HashMap<String, ElementFactory> svg11Factories = new HashMap<String, ElementFactory>();
static {
svg11Factories.put(SVGConstants.SVG_A_TAG,
......
......@@ -23,7 +23,6 @@ import java.util.Iterator;
import org.apache.batik.anim.values.AnimatableNumberListValue;
import org.apache.batik.anim.values.AnimatableValue;
import org.apache.batik.dom.svg.AbstractSVGList;
import org.apache.batik.dom.svg.AbstractSVGNumberList;
import org.apache.batik.dom.svg.ListBuilder;
import org.apache.batik.dom.svg.LiveAttributeException;
......@@ -45,7 +44,7 @@ import org.w3c.dom.svg.SVGNumberList;
* interface.
*
* @author <a href="mailto:tonny@kiyut.com">Tonny Kohar</a>
* @version $Id: SVGOMAnimatedNumberList.java 1733416 2016-03-03 07:07:13Z gadams $
* @version $Id: SVGOMAnimatedNumberList.java 1804130 2017-08-04 14:41:11Z ssteiner $
*/
public class SVGOMAnimatedNumberList
extends AbstractSVGAnimatedValue
......
......@@ -23,7 +23,6 @@ import java.util.Iterator;
import org.apache.batik.anim.values.AnimatablePathDataValue;
import org.apache.batik.anim.values.AnimatableValue;
import org.apache.batik.dom.svg.AbstractSVGList;
import org.apache.batik.dom.svg.AbstractSVGNormPathSegList;
import org.apache.batik.dom.svg.AbstractSVGPathSegList;
import org.apache.batik.dom.svg.ListBuilder;
......@@ -56,7 +55,7 @@ import org.w3c.dom.svg.SVGPathSegList;
*
* @author <a href="mailto:nicolas.socheleau@bitflash.com">Nicolas Socheleau</a>
* @author <a href="mailto:andrest@world-affair.com">Andres Toussaint</a>
* @version $Id: SVGOMAnimatedPathData.java 1733416 2016-03-03 07:07:13Z gadams $
* @version $Id: SVGOMAnimatedPathData.java 1804130 2017-08-04 14:41:11Z ssteiner $
*/
public class SVGOMAnimatedPathData
extends AbstractSVGAnimatedValue
......
......@@ -23,7 +23,6 @@ import java.util.Iterator;
import org.apache.batik.anim.values.AnimatablePointListValue;
import org.apache.batik.anim.values.AnimatableValue;
import org.apache.batik.dom.svg.AbstractSVGList;
import org.apache.batik.dom.svg.AbstractSVGPointList;
import org.apache.batik.dom.svg.ListBuilder;
import org.apache.batik.dom.svg.LiveAttributeException;
......@@ -43,7 +42,7 @@ import org.w3c.dom.svg.SVGPointList;
* This class is the implementation of the SVGAnimatedPoints interface.
*
* @author <a href="mailto:nicolas.socheleau@bitflash.com">Nicolas Socheleau</a>
* @version $Id: SVGOMAnimatedPoints.java 1733416 2016-03-03 07:07:13Z gadams $
* @version $Id: SVGOMAnimatedPoints.java 1804130 2017-08-04 14:41:11Z ssteiner $
*/
public class SVGOMAnimatedPoints
extends AbstractSVGAnimatedValue
......
......@@ -23,7 +23,6 @@ import java.io.ObjectInputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Locale;
import java.util.MissingResourceException;
......@@ -78,7 +77,7 @@ import org.w3c.dom.svg.SVGSVGElement;
* This class implements {@link SVGDocument}.
*
* @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
* @version $Id: SVGOMDocument.java 1733416 2016-03-03 07:07:13Z gadams $
* @version $Id: SVGOMDocument.java 1804130 2017-08-04 14:41:11Z ssteiner $
*/
public class SVGOMDocument
extends AbstractStylableDocument
......@@ -496,10 +495,9 @@ public class SVGOMDocument
* modified.
*/
protected void overrideStyleTextChanged(CSSStylableElement e, String text) {
Iterator i = cssNavigableDocumentListeners.keySet().iterator();
while (i.hasNext()) {
for (Object o : cssNavigableDocumentListeners.keySet()) {
CSSNavigableDocumentListener l =
(CSSNavigableDocumentListener) i.next();
(CSSNavigableDocumentListener) o;
l.overrideStyleTextChanged(e, text);
}
}
......@@ -509,10 +507,9 @@ public class SVGOMDocument
*/
protected void overrideStylePropertyRemoved(CSSStylableElement e,
String name) {
Iterator i = cssNavigableDocumentListeners.keySet().iterator();
while (i.hasNext()) {
for (Object o : cssNavigableDocumentListeners.keySet()) {
CSSNavigableDocumentListener l =
(CSSNavigableDocumentListener) i.next();
(CSSNavigableDocumentListener) o;
l.overrideStylePropertyRemoved(e, name);
}
}
......@@ -522,10 +519,9 @@ public class SVGOMDocument
*/
protected void overrideStylePropertyChanged
(CSSStylableElement e, String name, String value, String prio) {
Iterator i = cssNavigableDocumentListeners.keySet().iterator();
while (i.hasNext()) {
for (Object o : cssNavigableDocumentListeners.keySet()) {
CSSNavigableDocumentListener l =
(CSSNavigableDocumentListener) i.next();
(CSSNavigableDocumentListener) o;
l.overrideStylePropertyChanged(e, name, value, prio);
}
}
......@@ -701,10 +697,9 @@ public class SVGOMDocument
*/
public void animatedAttributeChanged(Element e,
AnimatedLiveAttributeValue alav) {
Iterator i = animatedAttributeListeners.iterator();
while (i.hasNext()) {
for (Object animatedAttributeListener : animatedAttributeListeners) {
AnimatedAttributeListener aal =
(AnimatedAttributeListener) i.next();
(AnimatedAttributeListener) animatedAttributeListener;
aal.animatedAttributeChanged(e, alav);
}
}
......@@ -716,10 +711,9 @@ public class SVGOMDocument
* @param type the type of animation whose value changed
*/
public void otherAnimationChanged(Element e, String type) {
Iterator i = animatedAttributeListeners.iterator();
while (i.hasNext()) {
for (Object animatedAttributeListener : animatedAttributeListeners) {
AnimatedAttributeListener aal =
(AnimatedAttributeListener) i.next();
(AnimatedAttributeListener) animatedAttributeListener;
aal.otherAnimationChanged(e, type);
}
}
......
......@@ -18,7 +18,6 @@
*/
package org.apache.batik.anim.dom;
import java.util.Iterator;
import java.util.LinkedList;
import org.apache.batik.anim.values.AnimatableNumberOptionalNumberValue;
......@@ -56,7 +55,7 @@ import org.w3c.dom.svg.SVGSVGElement;
* This class implements the {@link SVGElement} interface.
*
* @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
* @version $Id: SVGOMElement.java 1733416 2016-03-03 07:07:13Z gadams $
* @version $Id: SVGOMElement.java 1804130 2017-08-04 14:41:11Z ssteiner $
*/
public abstract class SVGOMElement
extends AbstractElement
......@@ -236,7 +235,7 @@ public abstract class SVGOMElement
if (isReadonly()) {
throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
"readonly.node",
new Object[] { new Integer(getNodeType()),
new Object[] {(int) getNodeType(),
getNodeName() });
}
if (prefix != null &&
......@@ -244,7 +243,7 @@ public abstract class SVGOMElement
!DOMUtilities.isValidName(prefix)) {
throw createDOMException(DOMException.INVALID_CHARACTER_ERR,
"prefix",
new Object[] { new Integer(getNodeType()),
new Object[] {(int) getNodeType(),
getNodeName(),
prefix });
}
......@@ -841,9 +840,8 @@ public abstract class SVGOMElement
void fireBaseAttributeListeners(String ns, String ln) {
if (targetListeners != null) {
LinkedList ll = (LinkedList) targetListeners.get(ns, ln);
Iterator it = ll.iterator();
while (it.hasNext()) {
AnimationTargetListener l = (AnimationTargetListener) it.next();
for (Object aLl : ll) {
AnimationTargetListener l = (AnimationTargetListener) aLl;
l.baseValueChanged(this, ns, ln, false);
}
}
......
......@@ -35,7 +35,7 @@ import org.w3c.dom.svg.SVGFEConvolveMatrixElement;
* This class implements {@link SVGFEConvolveMatrixElement}.
*
* @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
* @version $Id: SVGOMFEConvolveMatrixElement.java 1733416 2016-03-03 07:07:13Z gadams $
* @version $Id: SVGOMFEConvolveMatrixElement.java 1805420 2017-08-18 13:04:41Z ssteiner $
*/
public class SVGOMFEConvolveMatrixElement
extends SVGOMFilterPrimitiveStandardAttributes
......@@ -148,7 +148,7 @@ public class SVGOMFEConvolveMatrixElement
}
/**
* <b>DOM</b>: Implements {@link SVGFEConvolveMatrixElement#getIn1()}.
* <b>DOM</b>: Implements SVGFEConvolveMatrixElement#getIn1().
*/
public SVGAnimatedString getIn1() {
return in;
......
......@@ -71,7 +71,7 @@ import org.w3c.dom.views.DocumentView;
* This class implements {@link org.w3c.dom.svg.SVGSVGElement}.
*
* @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
* @version $Id: SVGOMSVGElement.java 1733416 2016-03-03 07:07:13Z gadams $
* @version $Id: SVGOMSVGElement.java 1806580 2017-08-29 12:06:44Z ssteiner $
*/
public class SVGOMSVGElement
extends SVGStylableElement
......@@ -453,7 +453,7 @@ public class SVGOMSVGElement
if (!ctx.unsuspendRedraw(suspend_handle_id)) {
throw createDOMException
(DOMException.NOT_FOUND_ERR, "invalid.suspend.handle",
new Object[] { new Integer(suspend_handle_id) });
new Object[] {suspend_handle_id});
}
}
......@@ -723,8 +723,8 @@ public class SVGOMSVGElement
}
/**
* <b>DOM</b>: Implements {@link
* org.w3c.dom.events.DocumentEvent#canDispatch(String,String)}.
* <b>DOM</b>: Implements
* org.w3c.dom.events.DocumentEvent#canDispatch(String,String).
*/
public boolean canDispatch(String namespaceURI, String type)
throws DOMException {
......
......@@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
*/
package org.apache.batik.anim.dom;
......@@ -31,7 +31,7 @@ import org.apache.batik.dom.svg.SVGPathContext;
* The class provides support for the SVGPath interface.
*
* @author <a href="mailto:deweese@apache.org">Thomas DeWeese</a>
* @version $Id: SVGPathSupport.java 1733416 2016-03-03 07:07:13Z gadams $
* @version $Id: SVGPathSupport.java 1808001 2017-09-11 09:51:29Z ssteiner $
*/
public class SVGPathSupport {
......
......@@ -24,17 +24,19 @@ import org.apache.batik.css.engine.StyleSheet;
import org.apache.batik.dom.AbstractDocument;
import org.apache.batik.dom.StyleSheetFactory;
import org.apache.batik.dom.StyleSheetProcessingInstruction;
import org.apache.batik.dom.util.HashTable;
import org.apache.batik.util.ParsedURL;
import org.w3c.dom.DOMException;
import org.w3c.dom.Node;
import java.util.HashMap;
/**
* This class provides an implementation of the 'xml-stylesheet' processing
* instructions.
*
* @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
* @version $Id: SVGStyleSheetProcessingInstruction.java 1733416 2016-03-03 07:07:13Z gadams $
* @version $Id: SVGStyleSheetProcessingInstruction.java 1813521 2017-10-27 12:34:11Z ssteiner $
*/
public class SVGStyleSheetProcessingInstruction
extends StyleSheetProcessingInstruction
......@@ -78,14 +80,14 @@ public class SVGStyleSheetProcessingInstruction
*/
public StyleSheet getCSSStyleSheet() {
if (styleSheet == null) {
HashTable attrs = getPseudoAttributes();
String type = (String)attrs.get("type");
HashMap<String, String> attrs = getPseudoAttributes();
String type = attrs.get("type");
if ("text/css".equals(type)) {
String title = (String)attrs.get("title");
String media = (String)attrs.get("media");
String href = (String)attrs.get("href");
String alternate = (String)attrs.get("alternate");
String title = attrs.get("title");
String media = attrs.get("media");
String href = attrs.get("href");
String alternate = attrs.get("alternate");
SVGOMDocument doc = (SVGOMDocument)getOwnerDocument();
ParsedURL durl = doc.getParsedURL();
ParsedURL burl = new ParsedURL(durl, href);
......
......@@ -18,6 +18,7 @@
*/
package org.apache.batik.anim.dom;
import java.util.HashMap;
import java.util.HashSet;
import org.apache.batik.dom.AbstractNode;
......@@ -25,7 +26,7 @@ import org.apache.batik.dom.events.AbstractEvent;
import org.apache.batik.dom.events.EventListenerList;
import org.apache.batik.dom.events.EventSupport;
import org.apache.batik.dom.events.NodeEventTarget;
import org.apache.batik.dom.util.HashTable;
import org.apache.batik.dom.xbl.NodeXBL;
import org.apache.batik.dom.xbl.ShadowTreeEvent;
import org.apache.batik.util.XMLConstants;
......@@ -42,24 +43,24 @@ import org.w3c.dom.events.MutationEvent;
* An EventSupport class that handles XBL-specific event processing.
*
* @author <a href="mailto:cam%40mcc%2eid%2eau">Cameron McCormack</a>
* @version $Id: XBLEventSupport.java 1733416 2016-03-03 07:07:13Z gadams $
* @version $Id: XBLEventSupport.java 1813521 2017-10-27 12:34:11Z ssteiner $
*/
public class XBLEventSupport extends EventSupport {
/**
* The unstoppable capturing listeners table.
*/
protected HashTable capturingImplementationListeners;
protected HashMap<String, EventListenerList> capturingImplementationListeners;
/**
* The unstoppable bubbling listeners table.
*/
protected HashTable bubblingImplementationListeners;
protected HashMap<String, EventListenerList> bubblingImplementationListeners;
/**
* Map of event types to their aliases.
*/
protected static HashTable eventTypeAliases = new HashTable();
protected static HashMap<String, String> eventTypeAliases = new HashMap<String, String>();
static {
eventTypeAliases.put("SVGLoad", "load");
eventTypeAliases.put("SVGUnoad", "unload");
......@@ -124,19 +125,19 @@ public class XBLEventSupport extends EventSupport {
String type,
EventListener listener,
boolean useCapture) {
HashTable listeners;
HashMap<String, EventListenerList> listeners;
if (useCapture) {
if (capturingImplementationListeners == null) {
capturingImplementationListeners = new HashTable();
capturingImplementationListeners = new HashMap<String, EventListenerList>();
}
listeners = capturingImplementationListeners;
} else {
if (bubblingImplementationListeners == null) {
bubblingImplementationListeners = new HashTable();
bubblingImplementationListeners = new HashMap<String, EventListenerList>();
}
listeners = bubblingImplementationListeners;
}
EventListenerList list = (EventListenerList) listeners.get(type);
EventListenerList list = listeners.get(type);
if (list == null) {
list = new EventListenerList();
listeners.put(type, list);
......@@ -151,12 +152,12 @@ public class XBLEventSupport extends EventSupport {
String type,
EventListener listener,
boolean useCapture) {
HashTable listeners = useCapture ? capturingImplementationListeners
: bubblingImplementationListeners;
HashMap<String, EventListenerList> listeners = useCapture
? capturingImplementationListeners : bubblingImplementationListeners;
if (listeners == null) {
return;
}
EventListenerList list = (EventListenerList) listeners.get(type);
EventListenerList list = listeners.get(type);
if (list == null) {
return;
}
......@@ -438,12 +439,9 @@ public class XBLEventSupport extends EventSupport {
*/
public EventListenerList getImplementationEventListeners
(String type, boolean useCapture) {
HashTable listeners = useCapture ? capturingImplementationListeners
: bubblingImplementationListeners;
if (listeners == null) {
return null;
}
return (EventListenerList) listeners.get(type);
HashMap<String, EventListenerList> listeners = useCapture
? capturingImplementationListeners : bubblingImplementationListeners;
return listeners != null ? listeners.get(type) : null;
}
/**
......