Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMFontFaceUriElement.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMFontFaceUriElement.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMFontFaceUriElement.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMFontFaceUriElement.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.SVGFontFaceUriElement; + +/** + * This class implements {@link SVGFontFaceUriElement}. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMFontFaceUriElement + extends SVGOMElement + implements SVGFontFaceUriElement { + + /** + * Creates a new SVGOMFontFaceUriElement object. + */ + protected SVGOMFontFaceUriElement() { + } + + /** + * Creates a new SVGOMFontFaceUriElement object. + * @param prefix The namespace prefix. + * @param owner The owner document. + */ + public SVGOMFontFaceUriElement(String prefix, AbstractDocument owner) { + super(prefix, owner); + } + + /** + * <b>DOM</b>: Implements {@link Node#getLocalName()}. + */ + public String getLocalName() { + return SVG_FONT_FACE_URI_TAG; + } + + /** + * Returns a new uninitialized instance of this object's class. + */ + protected Node newNode() { + return new SVGOMFontFaceUriElement(); + } +}
Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMForeignObjectElement.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMForeignObjectElement.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMForeignObjectElement.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMForeignObjectElement.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,175 @@ +/* + + 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.util.DoublyIndexedTable; +import org.apache.batik.util.SVGTypes; + +import org.w3c.dom.Node; +import org.w3c.dom.svg.SVGAnimatedLength; +import org.w3c.dom.svg.SVGForeignObjectElement; + +/** + * This class implements {@link SVGForeignObjectElement}. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMForeignObjectElement + extends SVGGraphicsElement + implements SVGForeignObjectElement { + + /** + * Table mapping XML attribute names to TraitInformation objects. + */ + protected static DoublyIndexedTable xmlTraitInformation; + static { + DoublyIndexedTable t = + new DoublyIndexedTable(SVGGraphicsElement.xmlTraitInformation); + t.put(null, SVG_X_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_WIDTH)); + t.put(null, SVG_Y_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_HEIGHT)); + t.put(null, SVG_WIDTH_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_WIDTH)); + t.put(null, SVG_HEIGHT_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_HEIGHT)); + xmlTraitInformation = t; + } + + /** + * The 'x' attribute value. + */ + protected SVGOMAnimatedLength x; + + /** + * The 'y' attribute value. + */ + protected SVGOMAnimatedLength y; + + /** + * The 'width' attribute value. + */ + protected SVGOMAnimatedLength width; + + /** + * The 'height' attribute value. + */ + protected SVGOMAnimatedLength height; + + /** + * The 'preserveAspectRatio' attribute value. + */ + protected SVGOMAnimatedPreserveAspectRatio preserveAspectRatio; + + /** + * Creates a new SVGOMForeignObjectElement object. + */ + protected SVGOMForeignObjectElement() { + } + + /** + * Creates a new SVGOMForeignObjectElement object. + * @param prefix The namespace prefix. + * @param owner The owner document. + */ + public SVGOMForeignObjectElement(String prefix, AbstractDocument owner) { + super(prefix, owner); + initializeLiveAttributes(); + } + + /** + * Initializes all live attributes for this element. + */ + protected void initializeAllLiveAttributes() { + super.initializeAllLiveAttributes(); + initializeLiveAttributes(); + } + + /** + * Initializes the live attribute values of this element. + */ + private void initializeLiveAttributes() { + x = createLiveAnimatedLength + (null, SVG_X_ATTRIBUTE, SVG_FOREIGN_OBJECT_X_DEFAULT_VALUE, + SVGOMAnimatedLength.HORIZONTAL_LENGTH, false); + y = createLiveAnimatedLength + (null, SVG_Y_ATTRIBUTE, SVG_FOREIGN_OBJECT_Y_DEFAULT_VALUE, + SVGOMAnimatedLength.VERTICAL_LENGTH, false); + width = + createLiveAnimatedLength + (null, SVG_WIDTH_ATTRIBUTE, null, + SVGOMAnimatedLength.HORIZONTAL_LENGTH, true); + height = + createLiveAnimatedLength + (null, SVG_HEIGHT_ATTRIBUTE, null, + SVGOMAnimatedLength.VERTICAL_LENGTH, true); + preserveAspectRatio = createLiveAnimatedPreserveAspectRatio(); + } + + /** + * <b>DOM</b>: Implements {@link Node#getLocalName()}. + */ + public String getLocalName() { + return SVG_FOREIGN_OBJECT_TAG; + } + + /** + * <b>DOM</b>: Implements {@link SVGForeignObjectElement#getX()}. + */ + public SVGAnimatedLength getX() { + return x; + } + + /** + * <b>DOM</b>: Implements {@link SVGForeignObjectElement#getY()}. + */ + public SVGAnimatedLength getY() { + return y; + } + + /** + * <b>DOM</b>: Implements {@link SVGForeignObjectElement#getWidth()}. + */ + public SVGAnimatedLength getWidth() { + return width; + } + + /** + * <b>DOM</b>: Implements {@link SVGForeignObjectElement#getHeight()}. + */ + public SVGAnimatedLength getHeight() { + return height; + } + + /** + * Returns a new uninitialized instance of this object's class. + */ + protected Node newNode() { + return new SVGOMForeignObjectElement(); + } + + /** + * 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/SVGOMGElement.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMGElement.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMGElement.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMGElement.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; + +import org.apache.batik.dom.AbstractDocument; +import org.w3c.dom.Node; +import org.w3c.dom.svg.SVGGElement; + +/** + * This class implements {@link SVGGElement}. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMGElement + extends SVGGraphicsElement + implements SVGGElement { + /** + * Creates a new SVGOMGElement object. + */ + protected SVGOMGElement() { + } + + /** + * Creates a new SVGOMGElement object. + * @param prefix The namespace prefix. + * @param owner The owner document. + */ + public SVGOMGElement(String prefix, AbstractDocument owner) { + super(prefix, owner); + } + + /** + * <b>DOM</b>: Implements {@link Node#getLocalName()}. + */ + public String getLocalName() { + return SVG_G_TAG; + } + + /** + * Returns a new uninitialized instance of this object's class. + */ + protected Node newNode() { + return new SVGOMGElement(); + } +} Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMGlyphElement.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMGlyphElement.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMGlyphElement.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMGlyphElement.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,99 @@ +/* + + 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.SVGGlyphElement; + +/** + * This class implements {@link SVGGlyphElement}. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMGlyphElement + extends SVGStylableElement + implements SVGGlyphElement { + +// /** +// * Table mapping XML attribute names to TraitInformation objects. +// */ +// protected static DoublyIndexedTable xmlTraitInformation; +// static { +// DoublyIndexedTable t = new DoublyIndexedTable(SVGStylableElement.xmlTraitInformation); +// t.put(null, SVG_UNICODE_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_GLYPH_NAME_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_D_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_PATH_DATA)); +// t.put(null, SVG_ORIENTATION_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_ARABIC_FORM_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_IDENT)); +// t.put(null, SVG_LANG_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_LANG_LIST)); +// t.put(null, SVG_HORIZ_ADV_X_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_NUMBER)); +// t.put(null, SVG_VERT_ORIGIN_X_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_NUMBER)); +// t.put(null, SVG_VERT_ORIGIN_Y_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_NUMBER)); +// t.put(null, SVG_VERT_ADV_Y_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_NUMBER)); +// xmlTraitInformation = t; +// } + + /** + * Creates a new SVGOMGlyphElement object. + */ + protected SVGOMGlyphElement() { + } + + /** + * Creates a new SVGOMGlyphElement object. + * @param prefix The namespace prefix. + * @param owner The owner document. + */ + public SVGOMGlyphElement(String prefix, AbstractDocument owner) { + super(prefix, owner); + } + + /** + * <b>DOM</b>: Implements {@link Node#getLocalName()}. + */ + public String getLocalName() { + return SVG_GLYPH_TAG; + } + + /** + * Returns a new uninitialized instance of this object's class. + */ + protected Node newNode() { + return new SVGOMGlyphElement(); + } + +// /** +// * 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/SVGOMGlyphRefElement.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMGlyphRefElement.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMGlyphRefElement.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMGlyphRefElement.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,237 @@ +/* + + 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.SVGAnimatedString; +import org.w3c.dom.svg.SVGGlyphRefElement; + +/** + * This class implements {@link SVGGlyphRefElement}. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMGlyphRefElement + extends SVGStylableElement + implements SVGGlyphRefElement { + +// /** +// * Table mapping XML attribute names to TraitInformation objects. +// */ +// protected static DoublyIndexedTable xmlTraitInformation; +// static { +// DoublyIndexedTable t = new DoublyIndexedTable(SVGStylableElement.xmlTraitInformation); +// t.put(XLINK_NAMESPACE_URI, XLINK_HREF_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_URI)); +// t.put(null, SVG_GLYPH_REF_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_FORMAT_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_X_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_NUMBER)); +// t.put(null, SVG_Y_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_NUMBER)); +// t.put(null, SVG_DX_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_NUMBER)); +// t.put(null, SVG_DY_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_NUMBER)); +// xmlTraitInformation = t; +// } + + /** + * 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"); + } + + /** + * The 'xlink:href' attribute value. Note that this attribute not + * actually animatable, according to SVG 1.1. + */ + protected SVGOMAnimatedString href; + + /** + * Creates a new SVGOMGlyphRefElement object. + */ + protected SVGOMGlyphRefElement() { + } + + /** + * Creates a new SVGOMGlyphRefElement object. + * @param prefix The namespace prefix. + * @param owner The owner document. + */ + public SVGOMGlyphRefElement(String prefix, AbstractDocument owner) { + super(prefix, owner); + initializeLiveAttributes(); + } + + /** + * Initializes all live attributes for this element. + */ + protected void initializeAllLiveAttributes() { + super.initializeAllLiveAttributes(); + initializeLiveAttributes(); + } + + /** + * Initializes the live attribute values of this element. + */ + private void initializeLiveAttributes() { + href = + createLiveAnimatedString(XLINK_NAMESPACE_URI, XLINK_HREF_ATTRIBUTE); + } + + /** + * <b>DOM</b>: Implements {@link Node#getLocalName()}. + */ + public String getLocalName() { + return SVG_GLYPH_REF_TAG; + } + + /** + * <b>DOM</b>: Implements {@link org.w3c.dom.svg.SVGURIReference#getHref()}. + */ + public SVGAnimatedString getHref() { + return href; + } + + /** + * <b>DOM</b>: Implements {@link SVGGlyphRefElement#getGlyphRef()}. + */ + public String getGlyphRef() { + return getAttributeNS(null, SVG_GLYPH_REF_ATTRIBUTE); + } + + /** + * <b>DOM</b>: Implements {@link SVGGlyphRefElement#setGlyphRef(String)}. + */ + public void setGlyphRef(String glyphRef) throws DOMException { + setAttributeNS(null, SVG_GLYPH_REF_ATTRIBUTE, glyphRef); + } + + /** + * <b>DOM</b>: Implements {@link SVGGlyphRefElement#getFormat()}. + */ + public String getFormat() { + return getAttributeNS(null, SVG_FORMAT_ATTRIBUTE); + } + + /** + * <b>DOM</b>: Implements {@link SVGGlyphRefElement#setFormat(String)}. + */ + public void setFormat(String format) throws DOMException { + setAttributeNS(null, SVG_FORMAT_ATTRIBUTE, format); + } + + /** + * <b>DOM</b>: Implements {@link SVGGlyphRefElement#getX()}. + */ + public float getX() { + return Float.parseFloat(getAttributeNS(null, SVG_X_ATTRIBUTE)); + } + + /** + * <b>DOM</b>: Implements {@link SVGGlyphRefElement#setX(float)}. + */ + public void setX(float x) throws DOMException { + setAttributeNS(null, SVG_X_ATTRIBUTE, String.valueOf(x)); + } + + /** + * <b>DOM</b>: Implements {@link SVGGlyphRefElement#getY()}. + */ + public float getY() { + return Float.parseFloat(getAttributeNS(null, SVG_Y_ATTRIBUTE)); + } + + /** + * <b>DOM</b>: Implements {@link SVGGlyphRefElement#setY(float)}. + */ + public void setY(float y) throws DOMException { + setAttributeNS(null, SVG_Y_ATTRIBUTE, String.valueOf(y)); + } + + /** + * <b>DOM</b>: Implements {@link SVGGlyphRefElement#getDx()}. + */ + public float getDx() { + return Float.parseFloat(getAttributeNS(null, SVG_DX_ATTRIBUTE)); + } + + /** + * <b>DOM</b>: Implements {@link SVGGlyphRefElement#setDx(float)}. + */ + public void setDx(float dx) throws DOMException { + setAttributeNS(null, SVG_DX_ATTRIBUTE, String.valueOf(dx)); + } + + /** + * <b>DOM</b>: Implements {@link SVGGlyphRefElement#getDy()}. + */ + public float getDy() { + return Float.parseFloat(getAttributeNS(null, SVG_DY_ATTRIBUTE)); + } + + /** + * <b>DOM</b>: Implements {@link SVGGlyphRefElement#setDy(float)}. + */ + public void setDy(float dy) throws DOMException { + setAttributeNS(null, SVG_DY_ATTRIBUTE, String.valueOf(dy)); + } + + /** + * 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 SVGOMGlyphRefElement(); + } + +// /** +// * 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/SVGOMGradientElement.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMGradientElement.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMGradientElement.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMGradientElement.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,226 @@ +/* + + 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.apache.batik.util.DoublyIndexedTable; +import org.apache.batik.util.SVGTypes; + +import org.w3c.dom.Node; +import org.w3c.dom.svg.SVGAnimatedBoolean; +import org.w3c.dom.svg.SVGAnimatedEnumeration; +import org.w3c.dom.svg.SVGAnimatedString; +import org.w3c.dom.svg.SVGAnimatedTransformList; +import org.w3c.dom.svg.SVGGradientElement; + +/** + * This class implements {@link org.w3c.dom.svg.SVGGradientElement}. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public abstract class SVGOMGradientElement + extends SVGStylableElement + implements SVGGradientElement { + + /** + * Table mapping XML attribute names to TraitInformation objects. + */ + protected static DoublyIndexedTable xmlTraitInformation; + static { + DoublyIndexedTable t = + new DoublyIndexedTable(SVGStylableElement.xmlTraitInformation); + t.put(null, SVG_GRADIENT_UNITS_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_IDENT)); + t.put(null, SVG_SPREAD_METHOD_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_IDENT)); + t.put(null, SVG_GRADIENT_TRANSFORM_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_TRANSFORM_LIST)); + t.put(null, SVG_EXTERNAL_RESOURCES_REQUIRED_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_BOOLEAN)); + t.put(XLINK_NAMESPACE_URI, XLINK_HREF_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_URI)); + xmlTraitInformation = t; + } + + /** + * 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"); + } + + /** + * The units values. + */ + protected static final String[] UNITS_VALUES = { + "", + SVG_USER_SPACE_ON_USE_VALUE, + SVG_OBJECT_BOUNDING_BOX_VALUE + }; + + /** + * The 'spreadMethod' attribute values. + */ + protected static final String[] SPREAD_METHOD_VALUES = { + "", + SVG_PAD_VALUE, + SVG_REFLECT_VALUE, + SVG_REPEAT_VALUE + }; + + /** + * The 'gradientUnits' attribute value. + */ + protected SVGOMAnimatedEnumeration gradientUnits; + + /** + * The 'spreadMethod' attribute value. + */ + protected SVGOMAnimatedEnumeration spreadMethod; + + /** + * The 'xlink:href' attribute value. + */ + protected SVGOMAnimatedString href; + + /** + * The 'externalResourcesRequired' attribute value. + */ + protected SVGOMAnimatedBoolean externalResourcesRequired; + + /** + * Creates a new SVGOMGradientElement object. + */ + protected SVGOMGradientElement() { + } + + /** + * Creates a new SVGOMGradientElement object. + * @param prefix The namespace prefix. + * @param owner The owner document. + */ + protected SVGOMGradientElement(String prefix, AbstractDocument owner) { + super(prefix, owner); + initializeLiveAttributes(); + } + + /** + * Initializes all live attributes for this element. + */ + protected void initializeAllLiveAttributes() { + super.initializeAllLiveAttributes(); + initializeLiveAttributes(); + } + + /** + * Initializes the live attribute values of this element. + */ + private void initializeLiveAttributes() { + gradientUnits = + createLiveAnimatedEnumeration + (null, SVG_GRADIENT_UNITS_ATTRIBUTE, UNITS_VALUES, (short) 2); + spreadMethod = + createLiveAnimatedEnumeration + (null, SVG_SPREAD_METHOD_ATTRIBUTE, SPREAD_METHOD_VALUES, + (short) 1); + href = + createLiveAnimatedString(XLINK_NAMESPACE_URI, XLINK_HREF_ATTRIBUTE); + externalResourcesRequired = + createLiveAnimatedBoolean + (null, SVG_EXTERNAL_RESOURCES_REQUIRED_ATTRIBUTE, false); + } + + /** + * To implement {@link + * org.w3c.dom.svg.SVGGradientElement#getGradientTransform()}. + */ + public SVGAnimatedTransformList getGradientTransform() { + throw new UnsupportedOperationException + ("SVGGradientElement.getGradientTransform is not implemented"); // XXX + } + + /** + * <b>DOM</b>: Implements {@link + * org.w3c.dom.svg.SVGGradientElement#getGradientUnits()}. + */ + public SVGAnimatedEnumeration getGradientUnits() { + return gradientUnits; + } + + /** + * <b>DOM</b>: Implements {@link + * org.w3c.dom.svg.SVGGradientElement#getSpreadMethod()}. + */ + public SVGAnimatedEnumeration getSpreadMethod() { + return spreadMethod; + } + + /** + * <b>DOM</b>: Implements {@link + * org.w3c.dom.svg.SVGURIReference#getHref()}. + */ + public SVGAnimatedString getHref() { + return href; + } + + // SVGExternalResourcesRequired support ///////////////////////////// + + /** + * <b>DOM</b>: Implements {@link + * org.w3c.dom.svg.SVGExternalResourcesRequired#getExternalResourcesRequired()}. + */ + public SVGAnimatedBoolean getExternalResourcesRequired() { + return externalResourcesRequired; + } + + /** + * 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 SVGOMAElement(); + } + + /** + * 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/SVGOMHKernElement.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMHKernElement.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMHKernElement.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMHKernElement.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,91 @@ +/* + + 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.SVGHKernElement; + +/** + * This class implements {@link SVGHKernElement}. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMHKernElement + extends SVGOMElement + implements SVGHKernElement { + +// /** +// * Table mapping XML attribute names to TraitInformation objects. +// */ +// protected static DoublyIndexedTable xmlTraitInformation; +// static { +// DoublyIndexedTable t = +// new DoublyIndexedTable(SVGOMElement.xmlTraitInformation); +// t.put(null, SVG_U1_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_G1_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_U2_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_G2_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_CDATA)); +// t.put(null, SVG_K_ATTRIBUTE, +// new TraitInformation(false, SVGTypes.TYPE_NUMBER)); +// xmlTraitInformation = t; +// } + + /** + * Creates a new SVGOMHKernElement object. + */ + protected SVGOMHKernElement() { + } + + /** + * Creates a new SVGOMHKernElement object. + * @param prefix The namespace prefix. + * @param owner The owner document. + */ + public SVGOMHKernElement(String prefix, AbstractDocument owner) { + super(prefix, owner); + } + + /** + * <b>DOM</b>: Implements {@link Node#getLocalName()}. + */ + public String getLocalName() { + return SVG_HKERN_TAG; + } + + /** + * Returns a new uninitialized instance of this object's class. + */ + protected Node newNode() { + return new SVGOMHKernElement(); + } + +// /** +// * 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/SVGOMHandlerElement.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMHandlerElement.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMHandlerElement.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMHandlerElement.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.apache.batik.util.SVG12Constants; + +import org.w3c.dom.Node; + +/** + * This class implements SVGHandlerElement. + * + * @author <a href="mailto:cam%40mcc%2eid%2eau">Cameron McCormack</a> + * @version $Id$ + */ +public class SVGOMHandlerElement extends SVGOMElement { + + /** + * Creates a new SVGOMHandlerElement object. + */ + protected SVGOMHandlerElement() { + } + + /** + * Creates a new SVGOMHandlerElement object. + * @param prefix The namespace prefix. + * @param owner The owner document. + */ + public SVGOMHandlerElement(String prefix, AbstractDocument owner) { + super(prefix, owner); + + } + + /** + * <b>DOM</b>: Implements {@link Node#getLocalName()}. + */ + public String getLocalName() { + return SVG12Constants.SVG_HANDLER_TAG; + } + + /** + * Returns a new uninitialized instance of this object's class. + */ + protected Node newNode() { + return new SVGOMHandlerElement(); + } +} Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMImageElement.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMImageElement.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMImageElement.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMImageElement.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,213 @@ +/* + + 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.apache.batik.util.DoublyIndexedTable; +import org.apache.batik.util.SVGTypes; + +import org.w3c.dom.Node; +import org.w3c.dom.svg.SVGAnimatedLength; +import org.w3c.dom.svg.SVGAnimatedPreserveAspectRatio; +import org.w3c.dom.svg.SVGImageElement; + +/** + * This class implements {@link SVGImageElement}. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMImageElement + extends SVGURIReferenceGraphicsElement + implements SVGImageElement { + + /** + * Table mapping XML attribute names to TraitInformation objects. + */ + protected static DoublyIndexedTable xmlTraitInformation; + static { + DoublyIndexedTable t = + new DoublyIndexedTable(SVGURIReferenceGraphicsElement.xmlTraitInformation); + t.put(null, SVG_X_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_WIDTH)); + t.put(null, SVG_Y_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_HEIGHT)); + t.put(null, SVG_WIDTH_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_WIDTH)); + t.put(null, SVG_HEIGHT_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_HEIGHT)); + xmlTraitInformation = t; + } + + /** + * The attribute initializer. + */ + protected static final AttributeInitializer attributeInitializer; + static { + attributeInitializer = new AttributeInitializer(5); + attributeInitializer.addAttribute(null, null, + SVG_PRESERVE_ASPECT_RATIO_ATTRIBUTE, + "xMidYMid meet"); + 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", "embed"); + attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI, + "xlink", "actuate", "onLoad"); + } + + /** + * The 'x' attribute value. + */ + protected SVGOMAnimatedLength x; + + /** + * The 'y' attribute value. + */ + protected SVGOMAnimatedLength y; + + /** + * The 'width' attribute value. + */ + protected SVGOMAnimatedLength width; + + /** + * The 'height' attribute value. + */ + protected SVGOMAnimatedLength height; + + /** + * The 'preserveAspectRatio' attribute value. + */ + protected SVGOMAnimatedPreserveAspectRatio preserveAspectRatio; + + /** + * Creates a new SVGOMImageElement object. + */ + protected SVGOMImageElement() { + } + + /** + * Creates a new SVGOMImageElement object. + * @param prefix The namespace prefix. + * @param owner The owner document. + */ + public SVGOMImageElement(String prefix, AbstractDocument owner) { + super(prefix, owner); + initializeLiveAttributes(); + } + + /** + * Initializes all live attributes for this element. + */ + protected void initializeAllLiveAttributes() { + super.initializeAllLiveAttributes(); + initializeLiveAttributes(); + } + + /** + * Initializes the live attribute values of this element. + */ + private void initializeLiveAttributes() { + x = createLiveAnimatedLength + (null, SVG_X_ATTRIBUTE, SVG_IMAGE_X_DEFAULT_VALUE, + SVGOMAnimatedLength.HORIZONTAL_LENGTH, false); + y = createLiveAnimatedLength + (null, SVG_Y_ATTRIBUTE, SVG_IMAGE_Y_DEFAULT_VALUE, + SVGOMAnimatedLength.VERTICAL_LENGTH, false); + width = + createLiveAnimatedLength + (null, SVG_WIDTH_ATTRIBUTE, null, + SVGOMAnimatedLength.HORIZONTAL_LENGTH, true); + height = + createLiveAnimatedLength + (null, SVG_HEIGHT_ATTRIBUTE, null, + SVGOMAnimatedLength.VERTICAL_LENGTH, true); + preserveAspectRatio = createLiveAnimatedPreserveAspectRatio(); + } + + /** + * <b>DOM</b>: Implements {@link Node#getLocalName()}. + */ + public String getLocalName() { + return SVG_IMAGE_TAG; + } + + /** + * <b>DOM</b>: Implements {@link SVGImageElement#getX()}. + */ + public SVGAnimatedLength getX() { + return x; + } + + /** + * <b>DOM</b>: Implements {@link SVGImageElement#getY()}. + */ + public SVGAnimatedLength getY() { + return y; + } + + /** + * <b>DOM</b>: Implements {@link SVGImageElement#getWidth()}. + */ + public SVGAnimatedLength getWidth() { + return width; + } + + /** + * <b>DOM</b>: Implements {@link SVGImageElement#getHeight()}. + */ + public SVGAnimatedLength getHeight() { + return height; + } + + /** + * <b>DOM</b>: Implements {@link SVGImageElement#getPreserveAspectRatio()}. + */ + public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio() { + return preserveAspectRatio; + } + + /** + * 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 SVGOMImageElement(); + } + + /** + * 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/SVGOMLength.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMLength.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMLength.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMLength.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,58 @@ +/* + + 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; + + +/** + * Default implementation of SVGLength. + * + * This implementation is not linked to any + * attribute in the Document. It is used + * by the root element to return a default SVGLength. + * + * @see org.w3c.dom.svg.SVGSVGElement#createSVGLength() + * + * @author nicolas.sochel...@bitflash.com + * @version $Id$ + */ +public class SVGOMLength extends AbstractSVGLength { + + /** + * Element associated to this length. + */ + protected AbstractElement element; + + /** + * Default constructor. + * + * The direction of this length is undefined + * and this length is not associated to any + * attribute. + */ + public SVGOMLength(AbstractElement elt){ + super(OTHER_LENGTH); + element = elt; + } + + /** + */ + protected SVGOMElement getAssociatedElement(){ + return (SVGOMElement)element; + } +} Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMLineElement.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMLineElement.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMLineElement.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMLineElement.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,167 @@ +/* + + 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.util.DoublyIndexedTable; +import org.apache.batik.util.SVGTypes; + +import org.w3c.dom.Node; +import org.w3c.dom.svg.SVGAnimatedLength; +import org.w3c.dom.svg.SVGLineElement; + +/** + * This class implements {@link SVGLineElement}. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMLineElement + extends SVGGraphicsElement + implements SVGLineElement { + + /** + * Table mapping XML attribute names to TraitInformation objects. + */ + protected static DoublyIndexedTable xmlTraitInformation; + static { + DoublyIndexedTable t = + new DoublyIndexedTable(SVGGraphicsElement.xmlTraitInformation); + t.put(null, SVG_X1_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_WIDTH)); + t.put(null, SVG_Y1_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_HEIGHT)); + t.put(null, SVG_X2_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_WIDTH)); + t.put(null, SVG_Y2_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_HEIGHT)); + xmlTraitInformation = t; + } + + /** + * The 'x1' attribute value. + */ + protected SVGOMAnimatedLength x1; + + /** + * The 'y1' attribute value. + */ + protected SVGOMAnimatedLength y1; + + /** + * The 'x2' attribute value. + */ + protected SVGOMAnimatedLength x2; + + /** + * The 'y2' attribute value. + */ + protected SVGOMAnimatedLength y2; + + /** + * Creates a new SVGOMLineElement object. + */ + protected SVGOMLineElement() { + } + + /** + * Creates a new SVGOMLineElement object. + * @param prefix The namespace prefix. + * @param owner The owner document. + */ + public SVGOMLineElement(String prefix, AbstractDocument owner) { + super(prefix, owner); + initializeLiveAttributes(); + } + + /** + * Initializes all live attributes for this element. + */ + protected void initializeAllLiveAttributes() { + super.initializeAllLiveAttributes(); + initializeLiveAttributes(); + } + + /** + * Initializes the live attribute values of this element. + */ + private void initializeLiveAttributes() { + x1 = createLiveAnimatedLength + (null, SVG_X1_ATTRIBUTE, SVG_LINE_X1_DEFAULT_VALUE, + SVGOMAnimatedLength.HORIZONTAL_LENGTH, false); + y1 = createLiveAnimatedLength + (null, SVG_Y1_ATTRIBUTE, SVG_LINE_Y1_DEFAULT_VALUE, + SVGOMAnimatedLength.VERTICAL_LENGTH, false); + x2 = createLiveAnimatedLength + (null, SVG_X2_ATTRIBUTE, SVG_LINE_X2_DEFAULT_VALUE, + SVGOMAnimatedLength.HORIZONTAL_LENGTH, false); + y2 = createLiveAnimatedLength + (null, SVG_Y2_ATTRIBUTE, SVG_LINE_Y2_DEFAULT_VALUE, + SVGOMAnimatedLength.VERTICAL_LENGTH, false); + } + + /** + * <b>DOM</b>: Implements {@link Node#getLocalName()}. + */ + public String getLocalName() { + return SVG_LINE_TAG; + } + + /** + * <b>DOM</b>: Implements {@link SVGLineElement#getX1()}. + */ + public SVGAnimatedLength getX1() { + return x1; + } + + /** + * <b>DOM</b>: Implements {@link SVGLineElement#getY1()}. + */ + public SVGAnimatedLength getY1() { + return y1; + } + + /** + * <b>DOM</b>: Implements {@link SVGLineElement#getX2()}. + */ + public SVGAnimatedLength getX2() { + return x2; + } + + /** + * <b>DOM</b>: Implements {@link SVGLineElement#getY2()}. + */ + public SVGAnimatedLength getY2() { + return y2; + } + + /** + * Returns a new uninitialized instance of this object's class. + */ + protected Node newNode() { + return new SVGOMLineElement(); + } + + /** + * 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/SVGOMLinearGradientElement.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMLinearGradientElement.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMLinearGradientElement.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMLinearGradientElement.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,167 @@ +/* + + 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.util.DoublyIndexedTable; +import org.apache.batik.util.SVGTypes; + +import org.w3c.dom.Node; +import org.w3c.dom.svg.SVGAnimatedLength; +import org.w3c.dom.svg.SVGLinearGradientElement; + +/** + * This class implements {@link org.w3c.dom.svg.SVGLinearGradientElement}. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMLinearGradientElement + extends SVGOMGradientElement + implements SVGLinearGradientElement { + + /** + * Table mapping XML attribute names to TraitInformation objects. + */ + protected static DoublyIndexedTable xmlTraitInformation; + static { + DoublyIndexedTable t = + new DoublyIndexedTable(SVGOMGradientElement.xmlTraitInformation); + t.put(null, SVG_X_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_WIDTH)); + t.put(null, SVG_Y_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_HEIGHT)); + t.put(null, SVG_WIDTH_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_WIDTH)); + t.put(null, SVG_HEIGHT_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_HEIGHT)); + xmlTraitInformation = t; + } + + /** + * The 'x1' attribute value. + */ + protected SVGOMAnimatedLength x1; + + /** + * The 'y1' attribute value. + */ + protected SVGOMAnimatedLength y1; + + /** + * The 'x2' attribute value. + */ + protected SVGOMAnimatedLength x2; + + /** + * The 'y2' attribute value. + */ + protected SVGOMAnimatedLength y2; + + /** + * Creates a new SVGOMLinearGradientElement object. + */ + protected SVGOMLinearGradientElement() { + } + + /** + * Creates a new SVGOMLinearGradientElement object. + * @param prefix The namespace prefix. + * @param owner The owner document. + */ + public SVGOMLinearGradientElement(String prefix, AbstractDocument owner) { + super(prefix, owner); + initializeLiveAttributes(); + } + + /** + * Initializes all live attributes for this element. + */ + protected void initializeAllLiveAttributes() { + super.initializeAllLiveAttributes(); + initializeLiveAttributes(); + } + + /** + * Initializes the live attribute values of this element. + */ + private void initializeLiveAttributes() { + x1 = createLiveAnimatedLength + (null, SVG_X1_ATTRIBUTE, SVG_LINEAR_GRADIENT_X1_DEFAULT_VALUE, + SVGOMAnimatedLength.HORIZONTAL_LENGTH, false); + y1 = createLiveAnimatedLength + (null, SVG_Y1_ATTRIBUTE, SVG_LINEAR_GRADIENT_Y1_DEFAULT_VALUE, + SVGOMAnimatedLength.VERTICAL_LENGTH, false); + x2 = createLiveAnimatedLength + (null, SVG_X2_ATTRIBUTE, SVG_LINEAR_GRADIENT_X2_DEFAULT_VALUE, + SVGOMAnimatedLength.HORIZONTAL_LENGTH, false); + y2 = createLiveAnimatedLength + (null, SVG_Y2_ATTRIBUTE, SVG_LINEAR_GRADIENT_Y2_DEFAULT_VALUE, + SVGOMAnimatedLength.VERTICAL_LENGTH, false); + } + + /** + * <b>DOM</b>: Implements {@link org.w3c.dom.Node#getLocalName()}. + */ + public String getLocalName() { + return SVG_LINEAR_GRADIENT_TAG; + } + + /** + * <b>DOM</b>: Implements {@link SVGLinearGradientElement#getX1()}. + */ + public SVGAnimatedLength getX1() { + return x1; + } + + /** + * <b>DOM</b>: Implements {@link SVGLinearGradientElement#getY1()}. + */ + public SVGAnimatedLength getY1() { + return y1; + } + + /** + * <b>DOM</b>: Implements {@link SVGLinearGradientElement#getX2()}. + */ + public SVGAnimatedLength getX2() { + return x2; + } + + /** + * <b>DOM</b>: Implements {@link SVGLinearGradientElement#getY2()}. + */ + public SVGAnimatedLength getY2() { + return y2; + } + + /** + * Returns a new uninitialized instance of this object's class. + */ + protected Node newNode() { + return new SVGOMLinearGradientElement(); + } + + /** + * 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/SVGOMMPathElement.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMMPathElement.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMMPathElement.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMMPathElement.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,146 @@ +/* + + 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.apache.batik.util.DoublyIndexedTable; +import org.apache.batik.util.SVGTypes; + +import org.w3c.dom.Node; +import org.w3c.dom.svg.SVGAnimatedBoolean; +import org.w3c.dom.svg.SVGMPathElement; + +/** + * This class implements {@link SVGMPathElement}. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMMPathElement + extends SVGOMURIReferenceElement + implements SVGMPathElement { + + /** + * Table mapping XML attribute names to TraitInformation objects. + */ + protected static DoublyIndexedTable xmlTraitInformation; + static { + DoublyIndexedTable t = + new DoublyIndexedTable(SVGOMURIReferenceElement.xmlTraitInformation); + t.put(null, SVG_EXTERNAL_RESOURCES_REQUIRED_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_BOOLEAN)); + xmlTraitInformation = t; + } + + /** + * 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"); + } + + /** + * The 'externalResourcesRequired' attribute value. + */ + protected SVGOMAnimatedBoolean externalResourcesRequired; + + /** + * Creates a new SVGOMMPathElement object. + */ + protected SVGOMMPathElement() { + } + + /** + * Creates a new SVGOMMPathElement object. + * @param prefix The namespace prefix. + * @param owner The owner document. + */ + public SVGOMMPathElement(String prefix, AbstractDocument owner) { + super(prefix, owner); + initializeLiveAttributes(); + } + + /** + * Initializes all live attributes for this element. + */ + protected void initializeAllLiveAttributes() { + super.initializeAllLiveAttributes(); + initializeLiveAttributes(); + } + + /** + * Initializes the live attribute values of this element. + */ + private void initializeLiveAttributes() { + externalResourcesRequired = + createLiveAnimatedBoolean + (null, SVG_EXTERNAL_RESOURCES_REQUIRED_ATTRIBUTE, false); + } + + /** + * <b>DOM</b>: Implements {@link Node#getLocalName()}. + */ + public String getLocalName() { + return SVG_MPATH_TAG; + } + + // SVGExternalResourcesRequired support ///////////////////////////// + + /** + * <b>DOM</b>: Implements {@link + * org.w3c.dom.svg.SVGExternalResourcesRequired#getExternalResourcesRequired()}. + */ + public SVGAnimatedBoolean getExternalResourcesRequired() { + return externalResourcesRequired; + } + + /** + * 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 SVGOMMPathElement(); + } + + /** + * 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/SVGOMMarkerElement.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMMarkerElement.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMMarkerElement.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMMarkerElement.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,413 @@ +/* + + 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.XMLSupport; +import org.apache.batik.util.DoublyIndexedTable; +import org.apache.batik.util.SVGTypes; + +import org.w3c.dom.Node; +import org.w3c.dom.svg.SVGAngle; +import org.w3c.dom.svg.SVGAnimatedAngle; +import org.w3c.dom.svg.SVGAnimatedBoolean; +import org.w3c.dom.svg.SVGAnimatedEnumeration; +import org.w3c.dom.svg.SVGAnimatedLength; +import org.w3c.dom.svg.SVGAnimatedPreserveAspectRatio; +import org.w3c.dom.svg.SVGAnimatedRect; +import org.w3c.dom.svg.SVGMarkerElement; + +/** + * This class implements {@link org.w3c.dom.svg.SVGMarkerElement}. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMMarkerElement + extends SVGStylableElement + implements SVGMarkerElement { + + /** + * Table mapping XML attribute names to TraitInformation objects. + */ + protected static DoublyIndexedTable xmlTraitInformation; + static { + DoublyIndexedTable t = + new DoublyIndexedTable(SVGStylableElement.xmlTraitInformation); + t.put(null, SVG_REF_X_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_WIDTH)); + t.put(null, SVG_REF_Y_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_HEIGHT)); + t.put(null, SVG_MARKER_WIDTH_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_WIDTH)); + t.put(null, SVG_MARKER_HEIGHT_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_HEIGHT)); + t.put(null, SVG_MARKER_UNITS_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_IDENT)); + t.put(null, SVG_ORIENT_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_IDENT)); + t.put(null, SVG_PRESERVE_ASPECT_RATIO_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_PRESERVE_ASPECT_RATIO_VALUE)); + t.put(null, SVG_EXTERNAL_RESOURCES_REQUIRED_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_BOOLEAN)); + xmlTraitInformation = t; + } + + /** + * The attribute initializer. + */ + protected static final AttributeInitializer attributeInitializer; + static { + attributeInitializer = new AttributeInitializer(1); + attributeInitializer.addAttribute(null, + null, + SVG_PRESERVE_ASPECT_RATIO_ATTRIBUTE, + "xMidYMid meet"); + } + + /** + * The units values. + */ + protected static final String[] UNITS_VALUES = { + "", + SVG_USER_SPACE_ON_USE_VALUE, + SVG_STROKE_WIDTH_ATTRIBUTE + }; + + /** + * The orient type values. + */ + protected static final String[] ORIENT_TYPE_VALUES = { + "", + SVG_AUTO_VALUE, + "" + }; + + /** + * The 'refX' attribute value. + */ + protected SVGOMAnimatedLength refX; + + /** + * The 'refY' attribute value. + */ + protected SVGOMAnimatedLength refY; + + /** + * The 'markerWidth' attribute value. + */ + protected SVGOMAnimatedLength markerWidth; + + /** + * The 'markerHeight' attribute value. + */ + protected SVGOMAnimatedLength markerHeight; + + /** + * The 'orient' attribute value. + */ + protected SVGOMAnimatedMarkerOrientValue orient; + + /** + * The 'markerUnits' attribute value. + */ + protected SVGOMAnimatedEnumeration markerUnits; + + /** + * The 'preserveAspectRatio' attribute value. + */ + protected SVGOMAnimatedPreserveAspectRatio preserveAspectRatio; + + /** + * The 'viewBox' attribute value. + */ + protected SVGOMAnimatedRect viewBox; + + /** + * The 'externalResourcesRequired' attribute value. + */ + protected SVGOMAnimatedBoolean externalResourcesRequired; + + /** + * Creates a new SVGOMMarkerElement object. + */ + protected SVGOMMarkerElement() { + } + + /** + * Creates a new SVGOMMarkerElement object. + * @param prefix The namespace prefix. + * @param owner The owner document. + */ + public SVGOMMarkerElement(String prefix, AbstractDocument owner) { + super(prefix, owner); + initializeLiveAttributes(); + } + + /** + * Initializes all live attributes for this element. + */ + protected void initializeAllLiveAttributes() { + super.initializeAllLiveAttributes(); + initializeLiveAttributes(); + } + + /** + * Initializes the live attribute values of this element. + */ + private void initializeLiveAttributes() { + refX = + createLiveAnimatedLength + (null, SVG_REF_X_ATTRIBUTE, SVG_MARKER_REF_X_DEFAULT_VALUE, + SVGOMAnimatedLength.HORIZONTAL_LENGTH, false); + refY = + createLiveAnimatedLength + (null, SVG_REF_Y_ATTRIBUTE, SVG_MARKER_REF_Y_DEFAULT_VALUE, + SVGOMAnimatedLength.VERTICAL_LENGTH, false); + markerWidth = + createLiveAnimatedLength + (null, SVG_MARKER_WIDTH_ATTRIBUTE, + SVG_MARKER_MARKER_WIDTH_DEFAULT_VALUE, + SVGOMAnimatedLength.HORIZONTAL_LENGTH, true); + markerHeight = + createLiveAnimatedLength + (null, SVG_MARKER_HEIGHT_ATTRIBUTE, + SVG_MARKER_MARKER_WIDTH_DEFAULT_VALUE, + SVGOMAnimatedLength.VERTICAL_LENGTH, true); + orient = + createLiveAnimatedMarkerOrientValue(null, SVG_ORIENT_ATTRIBUTE); + markerUnits = + createLiveAnimatedEnumeration + (null, SVG_MARKER_UNITS_ATTRIBUTE, UNITS_VALUES, (short) 2); + preserveAspectRatio = + createLiveAnimatedPreserveAspectRatio(); + viewBox = createLiveAnimatedRect(null, SVG_VIEW_BOX_ATTRIBUTE, null); + externalResourcesRequired = + createLiveAnimatedBoolean + (null, SVG_EXTERNAL_RESOURCES_REQUIRED_ATTRIBUTE, false); + } + + /** + * <b>DOM</b>: Implements {@link Node#getLocalName()}. + */ + public String getLocalName() { + return SVG_MARKER_TAG; + } + + /** + * <b>DOM</b>: Implements {@link SVGMarkerElement#getRefX()}. + */ + public SVGAnimatedLength getRefX() { + return refX; + } + + /** + * <b>DOM</b>: Implements {@link SVGMarkerElement#getRefY()}. + */ + public SVGAnimatedLength getRefY() { + return refY; + } + + /** + * <b>DOM</b>: Implements {@link SVGMarkerElement#getMarkerUnits()}. + */ + public SVGAnimatedEnumeration getMarkerUnits() { + return markerUnits; + } + + /** + * <b>DOM</b>: Implements {@link SVGMarkerElement#getMarkerWidth()}. + */ + public SVGAnimatedLength getMarkerWidth() { + return markerWidth; + } + + /** + * <b>DOM</b>: Implements {@link SVGMarkerElement#getMarkerHeight()}. + */ + public SVGAnimatedLength getMarkerHeight() { + return markerHeight; + } + + /** + * <b>DOM</b>: Implements {@link SVGMarkerElement#getOrientType()}. + */ + public SVGAnimatedEnumeration getOrientType() { + return orient.getAnimatedEnumeration(); + } + + /** + * <b>DOM</b>: Implements {@link SVGMarkerElement#getOrientAngle()}. + */ + public SVGAnimatedAngle getOrientAngle() { + return orient.getAnimatedAngle(); + } + + /** + * <b>DOM</b>: Implements {@link SVGMarkerElement#setOrientToAuto()}. + */ + public void setOrientToAuto() { + setAttributeNS(null, SVG_ORIENT_ATTRIBUTE, SVG_AUTO_VALUE); + } + + /** + * <b>DOM</b>: Implements {@link + * SVGMarkerElement#setOrientToAngle(SVGAngle)}. + */ + public void setOrientToAngle(SVGAngle angle) { + setAttributeNS(null, SVG_ORIENT_ATTRIBUTE, angle.getValueAsString()); + } + + // SVGFitToViewBox support //////////////////////////////////////////// + + /** + * <b>DOM</b>: Implements {@link + * org.w3c.dom.svg.SVGFitToViewBox#getViewBox()}. + */ + public SVGAnimatedRect getViewBox() { + return viewBox; + } + + /** + * <b>DOM</b>: Implements {@link + * org.w3c.dom.svg.SVGFitToViewBox#getPreserveAspectRatio()}. + */ + public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio() { + return preserveAspectRatio; + } + + // SVGExternalResourcesRequired support ///////////////////////////// + + /** + * <b>DOM</b>: Implements {@link + * org.w3c.dom.svg.SVGExternalResourcesRequired#getExternalResourcesRequired()}. + */ + public SVGAnimatedBoolean getExternalResourcesRequired() { + return externalResourcesRequired; + } + + // SVGLangSpace support ////////////////////////////////////////////////// + + /** + * <b>DOM</b>: Returns the xml:lang attribute value. + */ + public String getXMLlang() { + return XMLSupport.getXMLLang(this); + } + + /** + * <b>DOM</b>: Sets the xml:lang attribute value. + */ + public void setXMLlang(String lang) { + setAttributeNS(XML_NAMESPACE_URI, XML_LANG_QNAME, lang); + } + + /** + * <b>DOM</b>: Returns the xml:space attribute value. + */ + public String getXMLspace() { + return XMLSupport.getXMLSpace(this); + } + + /** + * <b>DOM</b>: Sets the xml:space attribute value. + */ + public void setXMLspace(String space) { + setAttributeNS(XML_NAMESPACE_URI, XML_SPACE_QNAME, space); + } + + /** + * 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 SVGOMMarkerElement(); + } + + /** + * Returns the table of TraitInformation objects for this element. + */ + protected DoublyIndexedTable getTraitInformationTable() { + return xmlTraitInformation; + } + + // AnimationTarget /////////////////////////////////////////////////////// + +// XXX TBD +// /** +// * Updates an attribute value in this target. +// */ +// public void updateAttributeValue(String ns, String ln, +// AnimatableValue val) { +// if (ns == null) { +// if (ln.equals(SVG_ORIENT_ATTRIBUTE)) { +// // XXX Needs testing. Esp with the LiveAttributeValues updating +// // the DOM attributes. +// SVGOMAnimatedMarkerOrientValue orient = +// (SVGOMAnimatedMarkerOrientValue) +// getLiveAttributeValue(null, ln); +// if (val == null) { +// orient.resetAnimatedValue(); +// } else { +// AnimatableAngleOrIdentValue aloiv = +// (AnimatableAngleOrIdentValue) val; +// if (aloiv.isIdent() +// && aloiv.getIdent().equals(SVG_AUTO_VALUE)) { +// orient.setAnimatedValueToAuto(); +// } else { +// orient.setAnimatedValueToAngle(aloiv.getUnit(), +// aloiv.getValue()); +// } +// } +// return; +// } +// } +// super.updateAttributeValue(ns, ln, val); +// } +// +// /** +// * Returns the underlying value of an animatable XML attribute. +// */ +// public AnimatableValue getUnderlyingValue(String ns, String ln) { +// if (ns == null) { +// if (ln.equals(SVG_ORIENT_ATTRIBUTE)) { +// SVGOMAnimatedMarkerOrientValue orient = +// (SVGOMAnimatedMarkerOrientValue) +// getLiveAttributeValue(null, ln); +// if (orient.getAnimatedEnumeration().getBaseVal() == +// SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE) { +// SVGAngle a = orient.getAnimatedAngle().getBaseVal(); +// return new AnimatableAngleOrIdentValue(this, a.getValue(), +// a.getUnitType()); +// } else { +// return new AnimatableAngleOrIdentValue(this, +// SVG_AUTO_VALUE); +// } +// } +// } +// return super.getUnderlyingValue(ns, ln); +// } +} Added: xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMMaskElement.java URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMMaskElement.java?rev=1647590&view=auto ============================================================================== --- xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMMaskElement.java (added) +++ xmlgraphics/batik/branches/submodules_cyclic_deps/sources/org/apache/batik/anim/dom/SVGOMMaskElement.java Tue Dec 23 15:10:45 2014 @@ -0,0 +1,214 @@ +/* + + 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.util.DoublyIndexedTable; +import org.apache.batik.util.SVGTypes; + +import org.w3c.dom.Node; +import org.w3c.dom.svg.SVGAnimatedEnumeration; +import org.w3c.dom.svg.SVGAnimatedLength; +import org.w3c.dom.svg.SVGMaskElement; + +/** + * This class implements {@link org.w3c.dom.svg.SVGMaskElement}. + * + * @author <a href="mailto:steph...@hillion.org">Stephane Hillion</a> + * @version $Id$ + */ +public class SVGOMMaskElement + extends SVGGraphicsElement + implements SVGMaskElement { + + /** + * Table mapping XML attribute names to TraitInformation objects. + */ + protected static DoublyIndexedTable xmlTraitInformation; + static { + DoublyIndexedTable t = + new DoublyIndexedTable(SVGGraphicsElement.xmlTraitInformation); + t.put(null, SVG_X_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_WIDTH)); + t.put(null, SVG_Y_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_HEIGHT)); + t.put(null, SVG_WIDTH_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_WIDTH)); + t.put(null, SVG_HEIGHT_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_LENGTH, PERCENTAGE_VIEWPORT_HEIGHT)); + t.put(null, SVG_MASK_UNITS_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_IDENT)); + t.put(null, SVG_MASK_CONTENT_UNITS_ATTRIBUTE, + new TraitInformation(true, SVGTypes.TYPE_IDENT)); + xmlTraitInformation = t; + } + + /** + * The units values. + */ + protected static final String[] UNITS_VALUES = { + "", + SVG_USER_SPACE_ON_USE_VALUE, + SVG_OBJECT_BOUNDING_BOX_VALUE + }; + + /** + * The 'x' attribute value. + */ + protected SVGOMAnimatedLength x; + + /** + * The 'y' attribute value. + */ + protected SVGOMAnimatedLength y; + + /** + * The 'width' attribute value. + */ + protected SVGOMAnimatedLength width; + + /** + * The 'height' attribute value. + */ + protected SVGOMAnimatedLength height; + + /** + * The 'maskUnits' attribute value. + */ + protected SVGOMAnimatedEnumeration maskUnits; + + /** + * The 'maskContentUnits' attribute value. + */ + protected SVGOMAnimatedEnumeration maskContentUnits; + + /** + * Creates a new SVGOMMaskElement object. + */ + protected SVGOMMaskElement() { + } + + /** + * Creates a new SVGOMMaskElement object. + * @param prefix The namespace prefix. + * @param owner The owner document. + */ + public SVGOMMaskElement(String prefix, AbstractDocument owner) { + super(prefix, owner); + initializeLiveAttributes(); + } + + /** + * Initializes all live attributes for this element. + */ + protected void initializeAllLiveAttributes() { + super.initializeAllLiveAttributes(); + initializeLiveAttributes(); + } + + /** + * Initializes the live attribute values of this element. + */ + private void initializeLiveAttributes() { + x = createLiveAnimatedLength + (null, SVG_X_ATTRIBUTE, SVG_MASK_X_DEFAULT_VALUE, + SVGOMAnimatedLength.HORIZONTAL_LENGTH, false); + y = createLiveAnimatedLength + (null, SVG_Y_ATTRIBUTE, SVG_MASK_Y_DEFAULT_VALUE, + SVGOMAnimatedLength.VERTICAL_LENGTH, false); + width = + createLiveAnimatedLength + (null, SVG_WIDTH_ATTRIBUTE, SVG_MASK_WIDTH_DEFAULT_VALUE, + SVGOMAnimatedLength.HORIZONTAL_LENGTH, true); + height = + createLiveAnimatedLength + (null, SVG_HEIGHT_ATTRIBUTE, SVG_MASK_WIDTH_DEFAULT_VALUE, + SVGOMAnimatedLength.VERTICAL_LENGTH, true); + maskUnits = + createLiveAnimatedEnumeration + (null, SVG_MASK_UNITS_ATTRIBUTE, UNITS_VALUES, (short) 2); + maskContentUnits = + createLiveAnimatedEnumeration + (null, SVG_MASK_CONTENT_UNITS_ATTRIBUTE, UNITS_VALUES, + (short) 1); + } + + /** + * <b>DOM</b>: Implements {@link org.w3c.dom.Node#getLocalName()}. + */ + public String getLocalName() { + return SVG_MASK_TAG; + } + + /** + * <b>DOM</b>: Implements {@link SVGMaskElement#getMaskUnits()}. + */ + public SVGAnimatedEnumeration getMaskUnits() { + return maskUnits; + } + + /** + * <b>DOM</b>: Implements {@link SVGMaskElement#getMaskContentUnits()}. + */ + public SVGAnimatedEnumeration getMaskContentUnits() { + return maskContentUnits; + } + + /** + * <b>DOM</b>: Implements {@link SVGMaskElement#getX()}. + */ + public SVGAnimatedLength getX() { + return x; + } + + /** + * <b>DOM</b>: Implements {@link SVGMaskElement#getY()}. + */ + public SVGAnimatedLength getY() { + return y; + } + + /** + * <b>DOM</b>: Implements {@link SVGMaskElement#getWidth()}. + */ + public SVGAnimatedLength getWidth() { + return width; + } + + /** + * <b>DOM</b>: Implements {@link SVGMaskElement#getHeight()}. + */ + public SVGAnimatedLength getHeight() { + return height; + } + + /** + * Returns a new uninitialized instance of this object's class. + */ + protected Node newNode() { + return new SVGOMMaskElement(); + } + + /** + * Returns the table of TraitInformation objects for this element. + */ + protected DoublyIndexedTable getTraitInformationTable() { + return xmlTraitInformation; + } +}