Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAltGlyphElement.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAltGlyphElement.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAltGlyphElement.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAltGlyphElement.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,141 @@ +/* + + 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.anim.dom; + +import org.apache.batik.dom.AbstractDocument; +import org.apache.batik.dom.util.XLinkSupport; +import org.apache.batik.dom.util.XMLSupport; + +import org.w3c.dom.DOMException; +import org.w3c.dom.Node; +import org.w3c.dom.svg.SVGAltGlyphElement; + +/** + * This class implements {@link SVGAltGlyphElement}. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMAltGlyphElement + extends SVGURIReferenceTextPositioningElement + implements SVGAltGlyphElement { + + /** + * The attribute initializer. + */ + protected static final AttributeInitializer attributeInitializer; + static { + attributeInitializer = new AttributeInitializer(4); + attributeInitializer.addAttribute(XMLSupport.XMLNS_NAMESPACE_URI, + null, "xmlns:xlink", + XLinkSupport.XLINK_NAMESPACE_URI); + attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI, + "xlink", "type", "simple"); + attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI, + "xlink", "show", "other"); + attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI, + "xlink", "actuate", "onLoad"); + } + +// /** +// * Table mapping XML attribute names to TraitInformation objects. +// */ +// protected static DoublyIndexedTable xmlTraitInformation; +// static { +// DoublyIndexedTable t = +// new DoublyIndexedTable(SVGURIReferenceTextPositioningElement.xmlTraitInformation); +// t.put(null, SVG_FORMAT_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_GLYPH_REF_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// xmlTraitInformation = t; +// } + + /** + * Creates a new SVGOMAltGlyphElement object. + */ + protected SVGOMAltGlyphElement() { + } + + /** + * Creates a new SVGOMAltGlyphElement object. + * @param prefix The namespace prefix. + * @param owner The owner document. + */ + public SVGOMAltGlyphElement(String prefix, AbstractDocument owner) { + super(prefix, owner); + } + + /** + * <b>DOM</b>: Implements {@link Node#getLocalName()}. + */ + public String getLocalName() { + return SVG_ALT_GLYPH_TAG; + } + + /** + * <b>DOM</b>: Implements {@link SVGAltGlyphElement#getGlyphRef()}. + */ + public String getGlyphRef() { + return getAttributeNS(null, SVG_GLYPH_REF_ATTRIBUTE); + } + + /** + * <b>DOM</b>: Implements {@link SVGAltGlyphElement#setGlyphRef(String)}. + */ + public void setGlyphRef(String glyphRef) throws DOMException { + setAttributeNS(null, SVG_GLYPH_REF_ATTRIBUTE, glyphRef); + } + + /** + * <b>DOM</b>: Implements {@link SVGAltGlyphElement#getFormat()}. + */ + public String getFormat() { + return getAttributeNS(null, SVG_FORMAT_ATTRIBUTE); + } + + /** + * <b>DOM</b>: Implements {@link SVGAltGlyphElement#setFormat(String)}. + */ + public void setFormat(String format) throws DOMException { + setAttributeNS(null, SVG_FORMAT_ATTRIBUTE, format); + } + + /** + * Returns the AttributeInitializer for this element type. + * @return null if this element has no attribute with a default value. + */ + protected AttributeInitializer getAttributeInitializer() { + return attributeInitializer; + } + + /** + * Returns a new uninitialized instance of this object's class. + */ + protected Node newNode() { + return new SVGOMAltGlyphElement(); + } + +// /** +// * Returns the table of TraitInformation objects for this element. +// */ +// protected DoublyIndexedTable getTraitInformationTable() { +// return xmlTraitInformation; +// } +}
Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAltGlyphItemElement.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAltGlyphItemElement.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAltGlyphItemElement.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAltGlyphItemElement.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,63 @@ +/* + + 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.anim.dom; + +import org.apache.batik.dom.AbstractDocument; +import org.w3c.dom.Node; +import org.w3c.dom.svg.SVGAltGlyphItemElement; + +/** + * This class implements {@link SVGAltGlyphItemElement}. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMAltGlyphItemElement + extends SVGOMElement + implements SVGAltGlyphItemElement { + + /** + * Creates a new SVGOMAltGlyphItemElement object. + */ + protected SVGOMAltGlyphItemElement() { + } + + /** + * Creates a new SVGOMAltGlyphItemElement object. + * @param prefix The namespace prefix. + * @param owner The owner document. + */ + public SVGOMAltGlyphItemElement(String prefix, AbstractDocument owner) { + super(prefix, owner); + } + + /** + * <b>DOM</b>: Implements {@link Node#getLocalName()}. + */ + public String getLocalName() { + return SVG_ALT_GLYPH_ITEM_TAG; + } + + /** + * Returns a new uninitialized instance of this object's class. + */ + protected Node newNode() { + return new SVGOMAltGlyphItemElement(); + } +} Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimateColorElement.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimateColorElement.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimateColorElement.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimateColorElement.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,121 @@ +/* + + 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.anim.dom; + +import org.apache.batik.dom.AbstractDocument; + +import org.w3c.dom.Node; +import org.w3c.dom.svg.SVGAnimateColorElement; + +/** + * This class implements {@link SVGAnimateColorElement}. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMAnimateColorElement + extends SVGOMAnimationElement + implements SVGAnimateColorElement { + +// /** +// * Table mapping XML attribute names to TraitInformation objects. +// */ +// protected static DoublyIndexedTable xmlTraitInformation; +// static { +// DoublyIndexedTable t = +// new DoublyIndexedTable(SVGOMAnimationElement.xmlTraitInformation); +// t.put(null, SVG_ACCUMULATE_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_ADDITIVE_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_ATTRIBUTE_TYPE_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_CALC_MODE_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_FILL_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_RESTART_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_ATTRIBUTE_NAME_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_BY_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_FROM_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_MAX_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_MIN_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_TO_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_VALUES_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_BEGIN_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_TIMING_SPECIFIER_LIST)); +// t.put(null, SVG_END_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_TIMING_SPECIFIER_LIST)); +// t.put(null, SVG_DUR_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_TIME)); +// t.put(null, SVG_REPEAT_DUR_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_TIME)); +// t.put(null, SVG_KEY_SPLINES_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_NUMBER_LIST)); +// t.put(null, SVG_KEY_TIMES_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_NUMBER_LIST)); +// t.put(null, SVG_REPEAT_COUNT_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_INTEGER)); +// xmlTraitInformation = t; +// } + + /** + * Creates a new SVGOMAnimateColorElement object. + */ + protected SVGOMAnimateColorElement() { + } + + /** + * Creates a new SVGOMAnimateColorElement object. + * @param prefix The namespace prefix. + * @param owner The owner document. + */ + public SVGOMAnimateColorElement(String prefix, AbstractDocument owner) { + super(prefix, owner); + } + + /** + * <b>DOM</b>: Implements {@link Node#getLocalName()}. + */ + public String getLocalName() { + return SVG_ANIMATE_COLOR_TAG; + } + + /** + * Returns a new uninitialized instance of this object's class. + */ + protected Node newNode() { + return new SVGOMAnimateColorElement(); + } + +// /** +// * Returns the table of TraitInformation objects for this element. +// */ +// protected DoublyIndexedTable getTraitInformationTable() { +// return xmlTraitInformation; +// } +} Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimateElement.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimateElement.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimateElement.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimateElement.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,121 @@ +/* + + 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.anim.dom; + +import org.apache.batik.dom.AbstractDocument; + +import org.w3c.dom.Node; +import org.w3c.dom.svg.SVGAnimateElement; + +/** + * This class implements {@link SVGAnimateElement}. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMAnimateElement + extends SVGOMAnimationElement + implements SVGAnimateElement { + +// /** +// * Table mapping XML attribute names to TraitInformation objects. +// */ +// protected static DoublyIndexedTable xmlTraitInformation; +// static { +// DoublyIndexedTable t = +// new DoublyIndexedTable(SVGOMAnimationElement.xmlTraitInformation); +// t.put(null, SVG_ACCUMULATE_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_ADDITIVE_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_ATTRIBUTE_TYPE_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_CALC_MODE_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_FILL_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_RESTART_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_ATTRIBUTE_NAME_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_BY_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_FROM_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_MAX_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_MIN_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_TO_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_VALUES_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_BEGIN_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_TIMING_SPECIFIER_LIST)); +// t.put(null, SVG_END_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_TIMING_SPECIFIER_LIST)); +// t.put(null, SVG_DUR_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_TIME)); +// t.put(null, SVG_REPEAT_DUR_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_TIME)); +// t.put(null, SVG_KEY_SPLINES_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_NUMBER_LIST)); +// t.put(null, SVG_KEY_TIMES_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_NUMBER_LIST)); +// t.put(null, SVG_REPEAT_COUNT_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_INTEGER)); +// xmlTraitInformation = t; +// } + + /** + * Creates a new SVGOMAnimateElement object. + */ + protected SVGOMAnimateElement() { + } + + /** + * Creates a new SVGOMAnimateElement object. + * @param prefix The namespace prefix. + * @param owner The owner document. + */ + public SVGOMAnimateElement(String prefix, AbstractDocument owner) { + super(prefix, owner); + } + + /** + * <b>DOM</b>: Implements {@link Node#getLocalName()}. + */ + public String getLocalName() { + return SVG_ANIMATE_TAG; + } + + /** + * Returns a new uninitialized instance of this object's class. + */ + protected Node newNode() { + return new SVGOMAnimateElement(); + } + +// /** +// * Returns the table of TraitInformation objects for this element. +// */ +// protected DoublyIndexedTable getTraitInformationTable() { +// return xmlTraitInformation; +// } +} Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimateMotionElement.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimateMotionElement.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimateMotionElement.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimateMotionElement.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,149 @@ +/* + + 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.anim.dom; + +import org.apache.batik.dom.AbstractDocument; + +import org.w3c.dom.Node; +import org.w3c.dom.svg.SVGAnimateMotionElement; + +/** + * This class implements {@link SVGAnimateMotionElement}. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMAnimateMotionElement + extends SVGOMAnimationElement + implements SVGAnimateMotionElement { + + /** + * The attribute initializer. + */ + protected static final AttributeInitializer attributeInitializer; + static { + attributeInitializer = new AttributeInitializer(1); + attributeInitializer.addAttribute(null, + null, + SVG_CALC_MODE_ATTRIBUTE, + SVG_PACED_VALUE); + } + +// /** +// * Table mapping XML attribute names to TraitInformation objects. +// */ +// protected static DoublyIndexedTable xmlTraitInformation; +// static { +// DoublyIndexedTable t = +// new DoublyIndexedTable(SVGOMAnimationElement.xmlTraitInformation); +// t.put(null, SVG_ACCUMULATE_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_ADDITIVE_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_ATTRIBUTE_TYPE_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_CALC_MODE_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_FILL_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_ORIGIN_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_RESTART_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_ATTRIBUTE_NAME_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_BY_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_FROM_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_MAX_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_MIN_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_TO_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_VALUES_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_BEGIN_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_TIMING_SPECIFIER_LIST)); +// t.put(null, SVG_END_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_TIMING_SPECIFIER_LIST)); +// t.put(null, SVG_DUR_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_TIME)); +// t.put(null, SVG_REPEAT_DUR_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_TIME)); +// t.put(null, SVG_KEY_POINTS_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_NUMBER_LIST)); +// t.put(null, SVG_KEY_SPLINES_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_NUMBER_LIST)); +// t.put(null, SVG_KEY_TIMES_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_NUMBER_LIST)); +// t.put(null, SVG_ROTATE_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_ANGLE_OR_IDENT)); +// t.put(null, SVG_REPEAT_COUNT_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_INTEGER)); +// t.put(null, SVG_D_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_PATH_DATA)); +// xmlTraitInformation = t; +// } + + /** + * Creates a new SVGOMAnimateMotionElement object. + */ + protected SVGOMAnimateMotionElement() { + } + + /** + * Creates a new SVGOMAnimateMotionElement object. + * @param prefix The namespace prefix. + * @param owner The owner document. + */ + public SVGOMAnimateMotionElement(String prefix, AbstractDocument owner) { + super(prefix, owner); + } + + /** + * <b>DOM</b>: Implements {@link Node#getLocalName()}. + */ + public String getLocalName() { + return SVG_ANIMATE_MOTION_TAG; + } + + /** + * Returns the AttributeInitializer for this element type. + * @return null if this element has no attribute with a default value. + */ + protected AttributeInitializer getAttributeInitializer() { + return attributeInitializer; + } + + /** + * Returns a new uninitialized instance of this object's class. + */ + protected Node newNode() { + return new SVGOMAnimateMotionElement(); + } + +// /** +// * Returns the table of TraitInformation objects for this element. +// */ +// protected DoublyIndexedTable getTraitInformationTable() { +// return xmlTraitInformation; +// } +} Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimateTransformElement.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimateTransformElement.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimateTransformElement.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimateTransformElement.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,142 @@ +/* + + 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.anim.dom; + +import org.apache.batik.dom.AbstractDocument; + +import org.w3c.dom.Node; +import org.w3c.dom.svg.SVGAnimateTransformElement; + +/** + * This class implements {@link SVGAnimateTransformElement}. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMAnimateTransformElement + extends SVGOMAnimationElement + implements SVGAnimateTransformElement { + + /** + * The attribute initializer. + */ + protected static final AttributeInitializer attributeInitializer; + static { + attributeInitializer = new AttributeInitializer(1); + attributeInitializer.addAttribute(null, + null, + SVG_TYPE_ATTRIBUTE, + SVG_TRANSLATE_VALUE); + } + +// /** +// * Table mapping XML attribute names to TraitInformation objects. +// */ +// protected static DoublyIndexedTable xmlTraitInformation; +// static { +// DoublyIndexedTable t = +// new DoublyIndexedTable(SVGOMAnimationElement.xmlTraitInformation); +// t.put(null, SVG_ACCUMULATE_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_ADDITIVE_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_ATTRIBUTE_TYPE_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_CALC_MODE_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_FILL_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_RESTART_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_ATTRIBUTE_NAME_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_BY_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_FROM_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_MAX_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_MIN_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_TO_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_VALUES_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_BEGIN_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_TIMING_SPECIFIER_LIST)); +// t.put(null, SVG_END_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_TIMING_SPECIFIER_LIST)); +// t.put(null, SVG_DUR_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_TIME)); +// t.put(null, SVG_REPEAT_DUR_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_TIME)); +// t.put(null, SVG_KEY_SPLINES_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_NUMBER_LIST)); +// t.put(null, SVG_KEY_TIMES_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_NUMBER_LIST)); +// t.put(null, SVG_REPEAT_COUNT_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_INTEGER)); +// xmlTraitInformation = t; +// } + + /** + * Creates a new SVGOMAnimateTransformElement object. + */ + protected SVGOMAnimateTransformElement() { + } + + /** + * Creates a new SVGOMAnimateTransformElement object. + * @param prefix The namespace prefix. + * @param owner The owner document. + */ + public SVGOMAnimateTransformElement(String prefix, + AbstractDocument owner) { + super(prefix, owner); + } + + /** + * <b>DOM</b>: Implements {@link Node#getLocalName()}. + */ + public String getLocalName() { + return SVG_ANIMATE_TRANSFORM_TAG; + } + + /** + * Returns the AttributeInitializer for this element type. + * @return null if this element has no attribute with a default value. + */ + protected AttributeInitializer getAttributeInitializer() { + return attributeInitializer; + } + + /** + * Returns a new uninitialized instance of this object's class. + */ + protected Node newNode() { + return new SVGOMAnimateTransformElement(); + } + +// /** +// * Returns the table of TraitInformation objects for this element. +// */ +// protected DoublyIndexedTable getTraitInformationTable() { +// return xmlTraitInformation; +// } +} Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedBoolean.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedBoolean.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedBoolean.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedBoolean.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,196 @@ +/* + + 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.anim.dom; + +import org.apache.batik.anim.values.AnimatableBooleanValue; +import org.apache.batik.anim.values.AnimatableValue; + +import org.w3c.dom.Attr; +import org.w3c.dom.DOMException; +import org.w3c.dom.svg.SVGAnimatedBoolean; + +/** + * This class implements the {@link SVGAnimatedBoolean} interface. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMAnimatedBoolean + extends AbstractSVGAnimatedValue + implements SVGAnimatedBoolean { + + /** + * The default value. + */ + protected boolean defaultValue; + + /** + * Whether the base value is valid. + */ + protected boolean valid; + + /** + * The current base value. + */ + protected boolean baseVal; + + /** + * The current animated value. + */ + protected boolean animVal; + + /** + * Whether the value is changing. + */ + protected boolean changing; + + /** + * Creates a new SVGOMAnimatedBoolean. + * @param elt The associated element. + * @param ns The attribute's namespace URI. + * @param ln The attribute's local name. + * @param val The default value, if the attribute is not specified. + */ + public SVGOMAnimatedBoolean(AbstractElement elt, + String ns, + String ln, + boolean val) { + super(elt, ns, ln); + defaultValue = val; + } + + /** + * <b>DOM</b>: Implements {@link SVGAnimatedBoolean#getBaseVal()}. + */ + public boolean getBaseVal() { + if (!valid) { + update(); + } + return baseVal; + } + + /** + * Updates the base value from the attribute. + */ + protected void update() { + Attr attr = element.getAttributeNodeNS(namespaceURI, localName); + if (attr == null) { + baseVal = defaultValue; + } else { + baseVal = attr.getValue().equals("true"); + } + valid = true; + } + + /** + * <b>DOM</b>: Implements {@link SVGAnimatedBoolean#setBaseVal(boolean)}. + */ + public void setBaseVal(boolean baseVal) throws DOMException { + try { + this.baseVal = baseVal; + valid = true; + changing = true; + element.setAttributeNS(namespaceURI, localName, + String.valueOf(baseVal)); + } finally { + changing = false; + } + } + + /** + * <b>DOM</b>: Implements {@link SVGAnimatedBoolean#getAnimVal()}. + */ + public boolean getAnimVal() { + if (hasAnimVal) { + return animVal; + } + if (!valid) { + update(); + } + return baseVal; + } + + /** + * Sets the animated value. + */ + public void setAnimatedValue(boolean animVal) { + hasAnimVal = true; + this.animVal = animVal; + fireAnimatedAttributeListeners(); + } + + /** + * Updates the animated value with the given {@link AnimatableValue}. + */ + protected void updateAnimatedValue(AnimatableValue val) { + if (val == null) { + hasAnimVal = false; + } else { + hasAnimVal = true; + this.animVal = ((AnimatableBooleanValue) val).getValue(); + } + fireAnimatedAttributeListeners(); + } + + /** + * Returns the base value of the attribute as an {@link AnimatableValue}. + */ + public AnimatableValue getUnderlyingValue(AnimationTarget target) { + return new AnimatableBooleanValue(target, getBaseVal()); + } + + /** + * Called when an Attr node has been added. + */ + public void attrAdded(Attr node, String newv) { + if (!changing) { + valid = false; + } + fireBaseAttributeListeners(); + if (!hasAnimVal) { + fireAnimatedAttributeListeners(); + } + } + + /** + * Called when an Attr node has been modified. + */ + public void attrModified(Attr node, String oldv, String newv) { + if (!changing) { + valid = false; + } + fireBaseAttributeListeners(); + if (!hasAnimVal) { + fireAnimatedAttributeListeners(); + } + } + + /** + * Called when an Attr node has been removed. + */ + public void attrRemoved(Attr node, String oldv) { + if (!changing) { + valid = false; + } + fireBaseAttributeListeners(); + if (!hasAnimVal) { + fireAnimatedAttributeListeners(); + } + } +} Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedEnumeration.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedEnumeration.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedEnumeration.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedEnumeration.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,243 @@ +/* + + 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.anim.dom; + +import org.apache.batik.anim.values.AnimatableStringValue; +import org.apache.batik.anim.values.AnimatableValue; +import org.apache.batik.dom.svg.LiveAttributeException; + +import org.w3c.dom.Attr; +import org.w3c.dom.DOMException; +import org.w3c.dom.svg.SVGAnimatedEnumeration; + +/** + * This class provides an implementation of the {@link + * SVGAnimatedEnumeration} interface. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMAnimatedEnumeration extends AbstractSVGAnimatedValue + implements SVGAnimatedEnumeration { + + /** + * The values in this enumeration. + */ + protected String[] values; + + /** + * The default value, if the attribute is not specified. + */ + protected short defaultValue; + + /** + * Whether the current base value is valid. + */ + protected boolean valid; + + /** + * The current base value. + */ + protected short baseVal; + + /** + * The current animated value. + */ + protected short animVal; + + /** + * Whether the value is changing. + */ + protected boolean changing; + + /** + * Creates a new SVGOMAnimatedEnumeration. + * @param elt The associated element. + * @param ns The attribute's namespace URI. + * @param ln The attribute's local name. + * @param val The values in this enumeration. + * @param def The default value to use. + */ + public SVGOMAnimatedEnumeration(AbstractElement elt, + String ns, + String ln, + String[] val, + short def) { + super(elt, ns, ln); + values = val; + defaultValue = def; + } + + /** + * <b>DOM</b>: Implements {@link SVGAnimatedEnumeration#getBaseVal()}. + */ + public short getBaseVal() { + if (!valid) { + update(); + } + return baseVal; + } + + /** + * Returns the base value as a string. + */ + public String getBaseValAsString() { + if (!valid) { + update(); + } + return values[baseVal]; + } + + /** + * Updates the base value from the attribute. + */ + protected void update() { + String val = element.getAttributeNS(namespaceURI, localName); + if (val.length() == 0) { + baseVal = defaultValue; + } else { + baseVal = getEnumerationNumber(val); + } + valid = true; + } + + /** + * Returns the enumeration number of the specified string. + */ + protected short getEnumerationNumber(String s) { + for (short i = 0; i < values.length; i++) { + if (s.equals(values[i])) { + return i; + } + } + return 0; + } + + /** + * <b>DOM</b>: Implements {@link + * SVGAnimatedEnumeration#setBaseVal(short)}. + */ + public void setBaseVal(short baseVal) throws DOMException { + if (baseVal >= 0 && baseVal < values.length) { + try { + this.baseVal = baseVal; + valid = true; + changing = true; + element.setAttributeNS(namespaceURI, localName, + values[baseVal]); + } finally { + changing = false; + } + } + } + + /** + * <b>DOM</b>: Implements {@link SVGAnimatedEnumeration#getAnimVal()}. + */ + public short getAnimVal() { + if (hasAnimVal) { + return animVal; + } + if (!valid) { + update(); + } + return baseVal; + } + + /** + * Gets the current animated value, throwing an exception if the attribute + * is malformed. + */ + public short getCheckedVal() { + if (hasAnimVal) { + return animVal; + } + if (!valid) { + update(); + } + if (baseVal == 0) { + throw new LiveAttributeException + (element, localName, + LiveAttributeException.ERR_ATTRIBUTE_MALFORMED, + getBaseValAsString()); + } + return baseVal; + } + + /** + * Returns the base value of the attribute as an {@link AnimatableValue}. + */ + public AnimatableValue getUnderlyingValue(AnimationTarget target) { + return new AnimatableStringValue(target, getBaseValAsString()); + } + + /** + * Called when an Attr node has been added. + */ + public void attrAdded(Attr node, String newv) { + if (!changing) { + valid = false; + } + fireBaseAttributeListeners(); + if (!hasAnimVal) { + fireAnimatedAttributeListeners(); + } + } + + /** + * Updates the animated value with the given {@link AnimatableValue}. + */ + protected void updateAnimatedValue(AnimatableValue val) { + if (val == null) { + hasAnimVal = false; + } else { + hasAnimVal = true; + this.animVal = + getEnumerationNumber(((AnimatableStringValue) val).getString()); + fireAnimatedAttributeListeners(); + } + fireAnimatedAttributeListeners(); + } + + /** + * Called when an Attr node has been modified. + */ + public void attrModified(Attr node, String oldv, String newv) { + if (!changing) { + valid = false; + } + fireBaseAttributeListeners(); + if (!hasAnimVal) { + fireAnimatedAttributeListeners(); + } + } + + /** + * Called when an Attr node has been removed. + */ + public void attrRemoved(Attr node, String oldv) { + if (!changing) { + valid = false; + } + fireBaseAttributeListeners(); + if (!hasAnimVal) { + fireAnimatedAttributeListeners(); + } + } +} Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedInteger.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedInteger.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedInteger.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedInteger.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,187 @@ +/* + + 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.anim.dom; + +import org.apache.batik.anim.values.AnimatableIntegerValue; +import org.apache.batik.anim.values.AnimatableValue; + +import org.w3c.dom.Attr; +import org.w3c.dom.DOMException; +import org.w3c.dom.svg.SVGAnimatedInteger; + +/** + * This class implements the {@link SVGAnimatedInteger} interface. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMAnimatedInteger + extends AbstractSVGAnimatedValue + implements SVGAnimatedInteger { + + /** + * The default value. + */ + protected int defaultValue; + + /** + * Whether the base value is valid. + */ + protected boolean valid; + + /** + * The current base value. + */ + protected int baseVal; + + /** + * The current animated value. + */ + protected int animVal; + + /** + * Whether the value is changing. + */ + protected boolean changing; + + /** + * Creates a new SVGOMAnimatedInteger. + * @param elt The associated element. + * @param ns The attribute's namespace URI. + * @param ln The attribute's local name. + * @param val The default value, if the attribute is not specified. + */ + public SVGOMAnimatedInteger(AbstractElement elt, + String ns, + String ln, + int val) { + super(elt, ns, ln); + defaultValue = val; + } + + /** + * <b>DOM</b>: Implements {@link SVGAnimatedInteger#getBaseVal()}. + */ + public int getBaseVal() { + if (!valid) { + update(); + } + return baseVal; + } + + /** + * Updates the base value from the attribute. + */ + protected void update() { + Attr attr = element.getAttributeNodeNS(namespaceURI, localName); + if (attr == null) { + baseVal = defaultValue; + } else { + baseVal = Integer.parseInt(attr.getValue()); + } + valid = true; + } + + /** + * <b>DOM</b>: Implements {@link SVGAnimatedInteger#setBaseVal(int)}. + */ + public void setBaseVal(int baseVal) throws DOMException { + try { + this.baseVal = baseVal; + valid = true; + changing = true; + element.setAttributeNS(namespaceURI, localName, + String.valueOf(baseVal)); + } finally { + changing = false; + } + } + + /** + * <b>DOM</b>: Implements {@link SVGAnimatedInteger#getAnimVal()}. + */ + public int getAnimVal() { + if (hasAnimVal) { + return animVal; + } + if (!valid) { + update(); + } + return baseVal; + } + + /** + * Returns the base value of the attribute as an {@link AnimatableValue}. + */ + public AnimatableValue getUnderlyingValue(AnimationTarget target) { + return new AnimatableIntegerValue(target, getBaseVal()); + } + + /** + * Updates the animated value with the given {@link AnimatableValue}. + */ + protected void updateAnimatedValue(AnimatableValue val) { + if (val == null) { + hasAnimVal = false; + } else { + hasAnimVal = true; + this.animVal = ((AnimatableIntegerValue) val).getValue(); + } + fireAnimatedAttributeListeners(); + } + + /** + * Called when an Attr node has been added. + */ + public void attrAdded(Attr node, String newv) { + if (!changing) { + valid = false; + } + fireBaseAttributeListeners(); + if (!hasAnimVal) { + fireAnimatedAttributeListeners(); + } + } + + /** + * Called when an Attr node has been modified. + */ + public void attrModified(Attr node, String oldv, String newv) { + if (!changing) { + valid = false; + } + fireBaseAttributeListeners(); + if (!hasAnimVal) { + fireAnimatedAttributeListeners(); + } + } + + /** + * Called when an Attr node has been removed. + */ + public void attrRemoved(Attr node, String oldv) { + if (!changing) { + valid = false; + } + fireBaseAttributeListeners(); + if (!hasAnimVal) { + fireAnimatedAttributeListeners(); + } + } +} Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedLength.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedLength.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedLength.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedLength.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,62 @@ +/* + + 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.anim.dom; + + +/** + * This class provides an implementation of the {@link + * org.w3c.dom.svg.SVGAnimatedLength} interface. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMAnimatedLength extends AbstractSVGAnimatedLength { + + /** + * The default value if the attribute is not specified. + */ + protected String defaultValue; + + /** + * Creates a new SVGOMAnimatedLength. + * @param elt The associated element. + * @param ns The attribute's namespace URI. + * @param ln The attribute's local name. + * @param def The default value if the attribute is not specified. + * @param dir The length's direction. + * @param nonneg Whether the length must be non-negative. + */ + public SVGOMAnimatedLength(AbstractElement elt, + String ns, + String ln, + String def, + short dir, + boolean nonneg) { + super(elt, ns, ln, dir, nonneg); + defaultValue = def; + } + + /** + * Returns the default value to use when the associated attribute + * was not specified. + */ + protected String getDefaultValue() { + return defaultValue; + } +} Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedLengthList.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedLengthList.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedLengthList.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedLengthList.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,536 @@ +/* + + 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.anim.dom; + +import java.util.ArrayList; +import java.util.Iterator; + +import org.w3c.dom.Attr; +import org.w3c.dom.DOMException; +import org.w3c.dom.Element; +import org.w3c.dom.svg.SVGAnimatedLengthList; +import org.w3c.dom.svg.SVGException; +import org.w3c.dom.svg.SVGLength; +import org.w3c.dom.svg.SVGLengthList; + +import org.apache.batik.anim.values.AnimatableLengthListValue; +import org.apache.batik.anim.values.AnimatableValue; +import org.apache.batik.dom.svg.ListBuilder; +import org.apache.batik.dom.svg.LiveAttributeException; +import org.apache.batik.dom.svg.SVGItem; +import org.apache.batik.parser.ParseException; + +/** + * This class is the implementation of the {@link SVGAnimatedLengthList} + * interface. + * + * @author <a href="mailto:nicolas.sochel...@bitflash.com">Nicolas Socheleau</a> + * @version $Id$ + */ +public class SVGOMAnimatedLengthList + extends AbstractSVGAnimatedValue + implements SVGAnimatedLengthList { + + /** + * The base value. + */ + protected BaseSVGLengthList baseVal; + + /** + * The animated value. + */ + protected AnimSVGLengthList animVal; + + /** + * Whether the list is changing. + */ + protected boolean changing; + + /** + * Default value for the length list. + */ + protected String defaultValue; + + /** + * Whether empty length lists are allowed. + */ + protected boolean emptyAllowed; + + /** + * The direction of the lengths in this list. + */ + protected short direction; + + /** + * Creates a new SVGOMAnimatedLengthList. + * @param elt The associated element. + * @param ns The attribute's namespace URI. + * @param ln The attribute's local name. + * @param defaultValue The default value if the attribute is not specified. + * @param emptyAllowed Whether a list with no items is allowed. + * @param direction The direction of the lengths in the list. + */ + public SVGOMAnimatedLengthList(AbstractElement elt, + String ns, + String ln, + String defaultValue, + boolean emptyAllowed, + short direction) { + super(elt, ns, ln); + this.defaultValue = defaultValue; + this.emptyAllowed = emptyAllowed; + this.direction = direction; + } + + /** + * <b>DOM</b>: Implements {@link SVGAnimatedLengthList#getBaseVal()}. + */ + public SVGLengthList getBaseVal() { + if (baseVal == null) { + baseVal = new BaseSVGLengthList(); + } + return baseVal; + } + + /** + * <b>DOM</b>: Implements {@link SVGAnimatedLengthList#getAnimVal()}. + */ + public SVGLengthList getAnimVal() { + if (animVal == null) { + animVal = new AnimSVGLengthList(); + } + return animVal; + } + + /** + * Throws an exception if the length list value is malformed. + */ + public void check() { + if (!hasAnimVal) { + if (baseVal == null) { + baseVal = new BaseSVGLengthList(); + } + baseVal.revalidate(); + if (baseVal.missing) { + throw new LiveAttributeException + (element, localName, + LiveAttributeException.ERR_ATTRIBUTE_MISSING, null); + } + if (baseVal.malformed) { + throw new LiveAttributeException + (element, localName, + LiveAttributeException.ERR_ATTRIBUTE_MALFORMED, + baseVal.getValueAsString()); + } + } + } + + /** + * Returns the base value of the attribute as an {@link AnimatableValue}. + */ + public AnimatableValue getUnderlyingValue(AnimationTarget target) { + SVGLengthList ll = getBaseVal(); + int n = ll.getNumberOfItems(); + short[] types = new short[n]; + float[] values = new float[n]; + for (int i = 0; i < n; i++) { + SVGLength l = ll.getItem(i); + types[i] = l.getUnitType(); + values[i] = l.getValueInSpecifiedUnits(); + } + return new AnimatableLengthListValue + (target, types, values, + target.getPercentageInterpretation + (getNamespaceURI(), getLocalName(), false)); + } + + /** + * Updates the animated value with the given {@link AnimatableValue}. + */ + protected void updateAnimatedValue(AnimatableValue val) { + if (val == null) { + hasAnimVal = false; + } else { + hasAnimVal = true; + AnimatableLengthListValue animLengths = + (AnimatableLengthListValue) val; + if (animVal == null) { + animVal = new AnimSVGLengthList(); + } + animVal.setAnimatedValue(animLengths.getLengthTypes(), + animLengths.getLengthValues()); + } + fireAnimatedAttributeListeners(); + } + + /** + * Called when an Attr node has been added. + */ + public void attrAdded(Attr node, String newv) { + if (!changing && baseVal != null) { + baseVal.invalidate(); + } + fireBaseAttributeListeners(); + if (!hasAnimVal) { + fireAnimatedAttributeListeners(); + } + } + + /** + * Called when an Attr node has been modified. + */ + public void attrModified(Attr node, String oldv, String newv) { + if (!changing && baseVal != null) { + baseVal.invalidate(); + } + fireBaseAttributeListeners(); + if (!hasAnimVal) { + fireAnimatedAttributeListeners(); + } + } + + /** + * Called when an Attr node has been removed. + */ + public void attrRemoved(Attr node, String oldv) { + if (!changing && baseVal != null) { + baseVal.invalidate(); + } + fireBaseAttributeListeners(); + if (!hasAnimVal) { + fireAnimatedAttributeListeners(); + } + } + + /** + * {@link SVGLengthList} implementation for the base length list value. + */ + public class BaseSVGLengthList extends AbstractSVGLengthList { + + /** + * Whether the value is missing. + */ + protected boolean missing; + + /** + * Whether the value is malformed. + */ + protected boolean malformed; + + /** + * Creates a new BaseSVGLengthList. + */ + public BaseSVGLengthList() { + super(SVGOMAnimatedLengthList.this.direction); + } + + /** + * Create a DOMException. + */ + protected DOMException createDOMException(short type, String key, + Object[] args) { + return element.createDOMException(type, key, args); + } + + /** + * Create a SVGException. + */ + protected SVGException createSVGException(short type, String key, + Object[] args) { + + return ((SVGOMElement)element).createSVGException(type, key, args); + } + + /** + * Returns the element owning the attribute with which this length + * list is associated. + */ + protected Element getElement() { + return element; + } + + /** + * Returns the value of the DOM attribute containing the length list. + */ + protected String getValueAsString() { + Attr attr = element.getAttributeNodeNS(namespaceURI, localName); + if (attr == null) { + return defaultValue; + } + return attr.getValue(); + } + + /** + * Sets the DOM attribute value containing the length list. + */ + protected void setAttributeValue(String value) { + try { + changing = true; + element.setAttributeNS(namespaceURI, localName, value); + } finally { + changing = false; + } + } + + /** + * Resets the value of the associated attribute. + */ + protected void resetAttribute() { + super.resetAttribute(); + missing = false; + malformed = false; + } + + /** + * Appends the string representation of the given {@link SVGItem} to + * the DOM attribute. This is called in response to an append to + * the list. + */ + protected void resetAttribute(SVGItem item) { + super.resetAttribute(item); + missing = false; + malformed = false; + } + + /** + * Initializes the list, if needed. + */ + protected void revalidate() { + if (valid) { + return; + } + + valid = true; + missing = false; + malformed = false; + + String s = getValueAsString(); + boolean isEmpty = s != null && s.length() == 0; + if (s == null || isEmpty && !emptyAllowed) { + missing = true; + return; + } + if (isEmpty) { + itemList = new ArrayList(1); + } else { + try { + ListBuilder builder = new ListBuilder(this); + + doParse(s, builder); + + if (builder.getList() != null) { + clear(itemList); + } + itemList = builder.getList(); + } catch (ParseException e) { + itemList = new ArrayList(1); + valid = true; + malformed = true; + } + } + } + } + + /** + * {@link SVGLengthList} implementation for the animated length list value. + */ + protected class AnimSVGLengthList extends AbstractSVGLengthList { + + /** + * Creates a new AnimSVGLengthList. + */ + public AnimSVGLengthList() { + super(SVGOMAnimatedLengthList.this.direction); + itemList = new ArrayList(1); + } + + /** + * Create a DOMException. + */ + protected DOMException createDOMException(short type, String key, + Object[] args) { + return element.createDOMException(type, key, args); + } + + /** + * Create a SVGException. + */ + protected SVGException createSVGException(short type, String key, + Object[] args) { + + return ((SVGOMElement)element).createSVGException(type, key, args); + } + + /** + * Returns the element owning this SVGLengthList. + */ + protected Element getElement() { + return element; + } + + /** + * <b>DOM</b>: Implements {@link SVGLengthList#getNumberOfItems()}. + */ + public int getNumberOfItems() { + if (hasAnimVal) { + return super.getNumberOfItems(); + } + return getBaseVal().getNumberOfItems(); + } + + /** + * <b>DOM</b>: Implements {@link SVGLengthList#getItem(int)}. + */ + public SVGLength getItem(int index) throws DOMException { + if (hasAnimVal) { + return super.getItem(index); + } + return getBaseVal().getItem(index); + } + + /** + * Returns the value of the DOM attribute containing the point list. + */ + protected String getValueAsString() { + if (itemList.size() == 0) { + return ""; + } + StringBuffer sb = new StringBuffer( itemList.size() * 8 ); + Iterator i = itemList.iterator(); + if (i.hasNext()) { + sb.append(((SVGItem) i.next()).getValueAsString()); + } + while (i.hasNext()) { + sb.append(getItemSeparator()); + sb.append(((SVGItem) i.next()).getValueAsString()); + } + return sb.toString(); + } + + /** + * Sets the DOM attribute value containing the point list. + */ + protected void setAttributeValue(String value) { + } + + /** + * <b>DOM</b>: Implements {@link SVGLengthList#clear()}. + */ + public void clear() throws DOMException { + throw element.createDOMException + (DOMException.NO_MODIFICATION_ALLOWED_ERR, + "readonly.length.list", null); + } + + /** + * <b>DOM</b>: Implements {@link SVGLengthList#initialize(SVGLength)}. + */ + public SVGLength initialize(SVGLength newItem) + throws DOMException, SVGException { + throw element.createDOMException + (DOMException.NO_MODIFICATION_ALLOWED_ERR, + "readonly.length.list", null); + } + + /** + * <b>DOM</b>: Implements {@link + * SVGLengthList#insertItemBefore(SVGLength, int)}. + */ + public SVGLength insertItemBefore(SVGLength newItem, int index) + throws DOMException, SVGException { + throw element.createDOMException + (DOMException.NO_MODIFICATION_ALLOWED_ERR, + "readonly.length.list", null); + } + + /** + * <b>DOM</b>: Implements {@link + * SVGLengthList#replaceItem(SVGLength, int)}. + */ + public SVGLength replaceItem(SVGLength newItem, int index) + throws DOMException, SVGException { + throw element.createDOMException + (DOMException.NO_MODIFICATION_ALLOWED_ERR, + "readonly.length.list", null); + } + + /** + * <b>DOM</b>: Implements {@link SVGLengthList#removeItem(int)}. + */ + public SVGLength removeItem(int index) throws DOMException { + throw element.createDOMException + (DOMException.NO_MODIFICATION_ALLOWED_ERR, + "readonly.length.list", null); + } + + /** + * <b>DOM</b>: Implements {@link SVGLengthList#appendItem(SVGLength)}. + */ + public SVGLength appendItem(SVGLength newItem) throws DOMException { + throw element.createDOMException + (DOMException.NO_MODIFICATION_ALLOWED_ERR, + "readonly.length.list", null); + } + + /** + * Sets the animated value. + */ + protected void setAnimatedValue(short[] types, float[] values) { + int size = itemList.size(); + int i = 0; + while (i < size && i < types.length) { + SVGLengthItem l = (SVGLengthItem) itemList.get(i); + l.unitType = types[i]; + l.value = values[i]; + l.direction = this.direction; + i++; + } + while (i < types.length) { + appendItemImpl(new SVGLengthItem(types[i], values[i], + this.direction)); + i++; + } + while (size > types.length) { + removeItemImpl(--size); + } + } + + /** + * Resets the value of the associated attribute. Does nothing, since + * there is no attribute for an animated value. + */ + protected void resetAttribute() { + } + + /** + * Resets the value of the associated attribute. Does nothing, since + * there is no attribute for an animated value. + */ + protected void resetAttribute(SVGItem item) { + } + + /** + * Initializes the list, if needed. Does nothing, since there is no + * attribute to read the list from. + */ + protected void revalidate() { + valid = true; + } + } +} Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedMarkerOrientValue.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedMarkerOrientValue.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedMarkerOrientValue.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMAnimatedMarkerOrientValue.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,445 @@ +/* + + 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.anim.dom; + +import org.apache.batik.anim.values.AnimatableValue; +import org.apache.batik.dom.svg.SVGOMAngle; +import org.apache.batik.util.SVGConstants; + +import org.w3c.dom.Attr; +import org.w3c.dom.DOMException; +import org.w3c.dom.svg.SVGAnimatedAngle; +import org.w3c.dom.svg.SVGAnimatedEnumeration; +import org.w3c.dom.svg.SVGAngle; +import org.w3c.dom.svg.SVGMarkerElement; + +/** + * A class that handles an {@link SVGAnimatedAngle} and an + * {@link SVGAnimatedEnumeration} for the 'marker' element's + * 'orient' attribute. + * + * @author <a href="mailto:cam%40mcc%2eid%2eau">Cameron McCormack</a> + * @version $Id$ + */ +public class SVGOMAnimatedMarkerOrientValue extends AbstractSVGAnimatedValue { + + /** + * Whether the base value is valid. + */ + protected boolean valid; + + /** + * The SVGAnimatedAngle. + */ + protected AnimatedAngle animatedAngle = new AnimatedAngle(); + + /** + * The SVGAnimatedEnumeration. + */ + protected AnimatedEnumeration animatedEnumeration = + new AnimatedEnumeration(); + + /** + * The current base angle value. + */ + protected BaseSVGAngle baseAngleVal; + + /** + * The current base enumeration value. + */ + protected short baseEnumerationVal; + + /** + * The current animated angle value. + */ + protected AnimSVGAngle animAngleVal; + + /** + * The current animated enumeration value. + */ + protected short animEnumerationVal; + + /** + * Whether the value is changing. + */ + protected boolean changing; + + /** + * Creates a new SVGOMAnimatedMarkerOrientValue. + * @param elt The associated element. + * @param ns The attribute's namespace URI. + * @param ln The attribute's local name. + */ + public SVGOMAnimatedMarkerOrientValue(AbstractElement elt, + String ns, + String ln) { + super(elt, ns, ln); + } + + /** + * Updates the animated value with the given {@link AnimatableValue}. + */ + protected void updateAnimatedValue(AnimatableValue val) { + // XXX TODO + throw new UnsupportedOperationException + ("Animation of marker orient value is not implemented"); + } + + /** + * Returns the base value of the attribute as an {@link AnimatableValue}. + */ + public AnimatableValue getUnderlyingValue(AnimationTarget target) { + // XXX TODO + throw new UnsupportedOperationException + ("Animation of marker orient value is not implemented"); + } + + /** + * Called when an Attr node has been added. + */ + public void attrAdded(Attr node, String newv) { + if (!changing) { + valid = false; + } + fireBaseAttributeListeners(); + if (!hasAnimVal) { + fireAnimatedAttributeListeners(); + } + } + + /** + * Called when an Attr node has been modified. + */ + public void attrModified(Attr node, String oldv, String newv) { + if (!changing) { + valid = false; + } + fireBaseAttributeListeners(); + if (!hasAnimVal) { + fireAnimatedAttributeListeners(); + } + } + + /** + * Called when an Attr node has been removed. + */ + public void attrRemoved(Attr node, String oldv) { + if (!changing) { + valid = false; + } + fireBaseAttributeListeners(); + if (!hasAnimVal) { + fireAnimatedAttributeListeners(); + } + } + + /** + * Sets the animated value to the given angle. + */ + public void setAnimatedValueToAngle(short unitType, float value) { + hasAnimVal = true; + animAngleVal.setAnimatedValue(unitType, value); + animEnumerationVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE; + fireAnimatedAttributeListeners(); + } + + /** + * Sets the animated value to the "auto" value. + */ + public void setAnimatedValueToAuto() { + hasAnimVal = true; + animAngleVal.setAnimatedValue(SVGAngle.SVG_ANGLETYPE_UNSPECIFIED, 0); + animEnumerationVal = SVGMarkerElement.SVG_MARKER_ORIENT_AUTO; + fireAnimatedAttributeListeners(); + } + + /** + * Resets the animated value. + */ + public void resetAnimatedValue() { + hasAnimVal = false; + fireAnimatedAttributeListeners(); + } + + /** + * Returns the {@link SVGAnimatedAngle} component of the orient value. + */ + public SVGAnimatedAngle getAnimatedAngle() { + return animatedAngle; + } + + /** + * Returns the {@link SVGAnimatedEnumeration} component of the orient value. + */ + public SVGAnimatedEnumeration getAnimatedEnumeration() { + return animatedEnumeration; + } + + /** + * This class represents the SVGAngle returned by + * {@link AnimatedAngle#getBaseVal()}. + */ + protected class BaseSVGAngle extends SVGOMAngle { + + /** + * Invalidates this angle. + */ + public void invalidate() { + valid = false; + } + + /** + * Resets the value of the associated attribute. + */ + protected void reset() { + try { + changing = true; + valid = true; + String value; + if (baseEnumerationVal == + SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE) { + value = getValueAsString(); + } else if (baseEnumerationVal == + SVGMarkerElement.SVG_MARKER_ORIENT_AUTO) { + value = SVGConstants.SVG_AUTO_VALUE; + } else { + return; + } + element.setAttributeNS(namespaceURI, localName, value); + } finally { + changing = false; + } + } + + /** + * Initializes the angle, if needed. + */ + protected void revalidate() { + if (!valid) { + Attr attr = element.getAttributeNodeNS(namespaceURI, localName); + if (attr == null) { + setUnitType(SVGAngle.SVG_ANGLETYPE_UNSPECIFIED); + value = 0; + } else { + parse(attr.getValue()); + } + valid = true; + } + } + + /** + * Parse a String value as an SVGAngle. If orient="auto", the + * method will parse the value "0" instead. + */ + protected void parse(String s) { + if (s.equals(SVGConstants.SVG_AUTO_VALUE)) { + setUnitType(SVGAngle.SVG_ANGLETYPE_UNSPECIFIED); + value = 0; + baseEnumerationVal = SVGMarkerElement.SVG_MARKER_ORIENT_AUTO; + } else { + super.parse(s); + if (getUnitType() == SVGAngle.SVG_ANGLETYPE_UNKNOWN) { + baseEnumerationVal = SVGMarkerElement.SVG_MARKER_ORIENT_UNKNOWN; + } else { + baseEnumerationVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE; + } + } + } + } + + /** + * This class represents the SVGAngle returned by {@link AnimatedAngle#getAnimVal()}. + */ + protected class AnimSVGAngle extends SVGOMAngle { + + /** + * <b>DOM</b>: Implements {@link SVGAngle#getUnitType()}. + */ + public short getUnitType() { + if (hasAnimVal) { + return super.getUnitType(); + } + return animatedAngle.getBaseVal().getUnitType(); + } + + /** + * <b>DOM</b>: Implements {@link SVGAngle#getValue()}. + */ + public float getValue() { + if (hasAnimVal) { + return super.getValue(); + } + return animatedAngle.getBaseVal().getValue(); + } + + /** + * <b>DOM</b>: Implements {@link SVGAngle#getValueInSpecifiedUnits()}. + */ + public float getValueInSpecifiedUnits() { + if (hasAnimVal) { + return super.getValueInSpecifiedUnits(); + } + return animatedAngle.getBaseVal().getValueInSpecifiedUnits(); + } + + /** + * <b>DOM</b>: Implements {@link SVGAngle#getValueAsString()}. + */ + public String getValueAsString() { + if (hasAnimVal) { + return super.getValueAsString(); + } + return animatedAngle.getBaseVal().getValueAsString(); + } + + /** + * <b>DOM</b>: Implements {@link SVGAngle#setValue(float)}. + */ + public void setValue(float value) throws DOMException { + throw element.createDOMException + (DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.angle", + null); + } + + /** + * <b>DOM</b>: Implements {@link + * SVGAngle#setValueInSpecifiedUnits(float)}. + */ + public void setValueInSpecifiedUnits(float value) throws DOMException { + throw element.createDOMException + (DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.angle", + null); + } + + /** + * <b>DOM</b>: Implements {@link SVGAngle#setValueAsString(String)}. + */ + public void setValueAsString(String value) throws DOMException { + throw element.createDOMException + (DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.angle", + null); + } + + /** + * <b>DOM</b>: Implements {@link + * SVGAngle#newValueSpecifiedUnits(short,float)}. + */ + public void newValueSpecifiedUnits(short unit, float value) { + throw element.createDOMException + (DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.angle", + null); + } + + /** + * <b>DOM</b>: Implements {@link + * SVGAngle#convertToSpecifiedUnits(short)}. + */ + public void convertToSpecifiedUnits(short unit) { + throw element.createDOMException + (DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.angle", + null); + } + + /** + * Sets the animated value. + */ + protected void setAnimatedValue(int type, float val) { + super.newValueSpecifiedUnits((short) type, val); + } + } + + /** + * The {@link SVGAnimatedAngle} component of the marker orient value. + */ + protected class AnimatedAngle implements SVGAnimatedAngle { + + /** + * <b>DOM</b>: Implements {@link SVGAnimatedAngle#getBaseVal()}. + */ + public SVGAngle getBaseVal() { + if (baseAngleVal == null) { + baseAngleVal = new BaseSVGAngle(); + } + return baseAngleVal; + } + + /** + * <b>DOM</b>: Implements {@link SVGAnimatedAngle#getAnimVal()}. + */ + public SVGAngle getAnimVal() { + if (animAngleVal == null) { + animAngleVal = new AnimSVGAngle(); + } + return animAngleVal; + } + } + + /** + * The {@link SVGAnimatedEnumeration} component of the marker orient value. + */ + protected class AnimatedEnumeration implements SVGAnimatedEnumeration { + + /** + * <b>DOM</b>: Implements {@link SVGAnimatedEnumeration#getBaseVal()}. + */ + public short getBaseVal() { + if (baseAngleVal == null) { + baseAngleVal = new BaseSVGAngle(); + } + baseAngleVal.revalidate(); + return baseEnumerationVal; + } + + /** + * <b>DOM</b>: Implements {@link + * SVGAnimatedEnumeration#setBaseVal(short)}. + */ + public void setBaseVal(short baseVal) throws DOMException { + if (baseVal == SVGMarkerElement.SVG_MARKER_ORIENT_AUTO) { + baseEnumerationVal = baseVal; + if (baseAngleVal == null) { + baseAngleVal = new BaseSVGAngle(); + } + baseAngleVal.setUnitType(SVGAngle.SVG_ANGLETYPE_UNSPECIFIED); + baseAngleVal.setValue(0); + baseAngleVal.reset(); + } else if (baseVal == SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE) { + baseEnumerationVal = baseVal; + if (baseAngleVal == null) { + baseAngleVal = new BaseSVGAngle(); + } + baseAngleVal.reset(); + } + } + + /** + * <b>DOM</b>: Implements {@link SVGAnimatedEnumeration#getAnimVal()}. + */ + public short getAnimVal() { + if (hasAnimVal) { + return animEnumerationVal; + } + if (baseAngleVal == null) { + baseAngleVal = new BaseSVGAngle(); + } + baseAngleVal.revalidate(); + return baseEnumerationVal; + } + } +}