You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by ca...@apache.org on 2006/12/21 01:05:42 UTC
svn commit: r489226 [3/8] - in /xmlgraphics/batik/trunk:
sources/org/apache/batik/anim/timing/
sources/org/apache/batik/apps/rasterizer/
sources/org/apache/batik/apps/slideshow/
sources/org/apache/batik/apps/svgbrowser/ sources/org/apache/batik/bridge/...
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEComponentTransferElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEComponentTransferElement.java?view=diff&rev=489226&r1=489225&r2=489226
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEComponentTransferElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEComponentTransferElement.java Wed Dec 20 16:05:36 2006
@@ -19,6 +19,7 @@
package org.apache.batik.dom.svg;
import org.apache.batik.dom.AbstractDocument;
+import org.apache.batik.dom.util.DoublyIndexedTable;
import org.apache.batik.anim.values.AnimatableValue;
import org.apache.batik.util.SVGTypes;
@@ -37,6 +38,23 @@
implements SVGFEComponentTransferElement {
/**
+ * Table mapping XML attribute names to TraitInformation objects.
+ */
+ protected static DoublyIndexedTable xmlTraitInformation;
+ static {
+ DoublyIndexedTable t =
+ new DoublyIndexedTable(SVGOMFilterPrimitiveStandardAttributes.xmlTraitInformation);
+ t.put(null, SVG_IN_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_CDATA));
+ xmlTraitInformation = t;
+ }
+
+ /**
+ * The 'in' attribute value.
+ */
+ protected SVGOMAnimatedString in;
+
+ /**
* Creates a new SVGOMFEComponentTransferElement object.
*/
protected SVGOMFEComponentTransferElement() {
@@ -50,6 +68,22 @@
public SVGOMFEComponentTransferElement(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() {
+ in = createLiveAnimatedString(null, SVG_IN_ATTRIBUTE);
}
/**
@@ -63,7 +97,7 @@
* <b>DOM</b>: Implements {@link SVGFEComponentTransferElement#getIn1()}.
*/
public SVGAnimatedString getIn1() {
- return getAnimatedStringAttribute(null, SVG_IN_ATTRIBUTE);
+ return in;
}
/**
@@ -73,30 +107,11 @@
return new SVGOMFEComponentTransferElement();
}
- // ExtendedTraitAccess ///////////////////////////////////////////////////
-
- /**
- * Returns whether the given XML attribute is animatable.
- */
- public boolean isAttributeAnimatable(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)) {
- return true;
- }
- }
- return super.isAttributeAnimatable(ns, ln);
- }
-
/**
- * Returns the type of the given attribute.
+ * Returns the table of TraitInformation objects for this element.
*/
- public int getAttributeType(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)) {
- return SVGTypes.TYPE_CDATA;
- }
- }
- return super.getAttributeType(ns, ln);
+ protected DoublyIndexedTable getTraitInformationTable() {
+ return xmlTraitInformation;
}
// AnimationTarget ///////////////////////////////////////////////////////
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFECompositeElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFECompositeElement.java?view=diff&rev=489226&r1=489225&r2=489226
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFECompositeElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFECompositeElement.java Wed Dec 20 16:05:36 2006
@@ -20,6 +20,7 @@
import org.apache.batik.anim.values.AnimatableValue;
import org.apache.batik.dom.AbstractDocument;
+import org.apache.batik.dom.util.DoublyIndexedTable;
import org.apache.batik.util.SVGTypes;
import org.w3c.dom.Node;
@@ -39,6 +40,30 @@
implements SVGFECompositeElement {
/**
+ * Table mapping XML attribute names to TraitInformation objects.
+ */
+ protected static DoublyIndexedTable xmlTraitInformation;
+ static {
+ DoublyIndexedTable t =
+ new DoublyIndexedTable(SVGOMFilterPrimitiveStandardAttributes.xmlTraitInformation);
+ t.put(null, SVG_IN_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_CDATA));
+ t.put(null, SVG_IN2_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_CDATA));
+ t.put(null, SVG_OPERATOR_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_IDENT));
+ t.put(null, SVG_K1_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ t.put(null, SVG_K2_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ t.put(null, SVG_K3_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ t.put(null, SVG_K4_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ xmlTraitInformation = t;
+ }
+
+ /**
* The 'operator' attribute values.
*/
protected static final String[] OPERATOR_VALUES = {
@@ -52,6 +77,41 @@
};
/**
+ * The 'in' attribute value.
+ */
+ protected SVGOMAnimatedString in;
+
+ /**
+ * The 'in2' attribute value.
+ */
+ protected SVGOMAnimatedString in2;
+
+ /**
+ * The 'operator' attribute value.
+ */
+ protected SVGOMAnimatedEnumeration operator;
+
+ /**
+ * The 'k1' attribute value.
+ */
+ protected SVGOMAnimatedNumber k1;
+
+ /**
+ * The 'k2' attribute value.
+ */
+ protected SVGOMAnimatedNumber k2;
+
+ /**
+ * The 'k3' attribute value.
+ */
+ protected SVGOMAnimatedNumber k3;
+
+ /**
+ * The 'k4' attribute value.
+ */
+ protected SVGOMAnimatedNumber k4;
+
+ /**
* Creates a new SVGOMFECompositeElement object.
*/
protected SVGOMFECompositeElement() {
@@ -64,6 +124,30 @@
*/
public SVGOMFECompositeElement(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() {
+ in = createLiveAnimatedString(null, SVG_IN_ATTRIBUTE);
+ in2 = createLiveAnimatedString(null, SVG_IN2_ATTRIBUTE);
+ operator =
+ createLiveAnimatedEnumeration
+ (null, SVG_OPERATOR_ATTRIBUTE, OPERATOR_VALUES, (short) 1);
+ k1 = createLiveAnimatedNumber(null, SVG_K1_ATTRIBUTE, 0f);
+ k2 = createLiveAnimatedNumber(null, SVG_K2_ATTRIBUTE, 0f);
+ k3 = createLiveAnimatedNumber(null, SVG_K3_ATTRIBUTE, 0f);
+ k4 = createLiveAnimatedNumber(null, SVG_K4_ATTRIBUTE, 0f);
}
/**
@@ -77,50 +161,49 @@
* <b>DOM</b>: Implements {@link SVGFECompositeElement#getIn1()}.
*/
public SVGAnimatedString getIn1() {
- return getAnimatedStringAttribute(null, SVG_IN_ATTRIBUTE);
+ return in;
}
/**
* <b>DOM</b>: Implements {@link SVGFECompositeElement#getIn2()}.
*/
public SVGAnimatedString getIn2() {
- return getAnimatedStringAttribute(null, SVG_IN2_ATTRIBUTE);
+ return in2;
}
/**
* <b>DOM</b>: Implements {@link SVGFECompositeElement#getOperator()}.
*/
public SVGAnimatedEnumeration getOperator() {
- return getAnimatedEnumerationAttribute
- (null, SVG_OPERATOR_ATTRIBUTE, OPERATOR_VALUES, (short)1);
+ return operator;
}
/**
* <b>DOM</b>: Implements {@link SVGFECompositeElement#getK1()}.
*/
public SVGAnimatedNumber getK1() {
- return getAnimatedNumberAttribute(null, SVG_K1_ATTRIBUTE, 0f);
+ return k1;
}
/**
* <b>DOM</b>: Implements {@link SVGFECompositeElement#getK2()}.
*/
public SVGAnimatedNumber getK2() {
- return getAnimatedNumberAttribute(null, SVG_K2_ATTRIBUTE, 0f);
+ return k2;
}
/**
* <b>DOM</b>: Implements {@link SVGFECompositeElement#getK3()}.
*/
public SVGAnimatedNumber getK3() {
- return getAnimatedNumberAttribute(null, SVG_K3_ATTRIBUTE, 0f);
+ return k3;
}
/**
* <b>DOM</b>: Implements {@link SVGFECompositeElement#getK4()}.
*/
public SVGAnimatedNumber getK4() {
- return getAnimatedNumberAttribute(null, SVG_K4_ATTRIBUTE, 0f);
+ return k4;
}
/**
@@ -130,44 +213,11 @@
return new SVGOMFECompositeElement();
}
- // ExtendedTraitAccess ///////////////////////////////////////////////////
-
/**
- * Returns whether the given XML attribute is animatable.
+ * Returns the table of TraitInformation objects for this element.
*/
- public boolean isAttributeAnimatable(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)
- || ln.equals(SVG_IN2_ATTRIBUTE)
- || ln.equals(SVG_OPERATOR_ATTRIBUTE)
- || ln.equals(SVG_K1_ATTRIBUTE)
- || ln.equals(SVG_K2_ATTRIBUTE)
- || ln.equals(SVG_K3_ATTRIBUTE)
- || ln.equals(SVG_K4_ATTRIBUTE)) {
- return true;
- }
- }
- return super.isAttributeAnimatable(ns, ln);
- }
-
- /**
- * Returns the type of the given attribute.
- */
- public int getAttributeType(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)
- || ln.equals(SVG_IN2_ATTRIBUTE)) {
- return SVGTypes.TYPE_CDATA;
- } else if (ln.equals(SVG_OPERATOR_ATTRIBUTE)) {
- return SVGTypes.TYPE_IDENT;
- } else if (ln.equals(SVG_K1_ATTRIBUTE)
- || ln.equals(SVG_K2_ATTRIBUTE)
- || ln.equals(SVG_K3_ATTRIBUTE)
- || ln.equals(SVG_K4_ATTRIBUTE)) {
- return SVGTypes.TYPE_NUMBER;
- }
- }
- return super.getAttributeType(ns, ln);
+ protected DoublyIndexedTable getTraitInformationTable() {
+ return xmlTraitInformation;
}
// AnimationTarget ///////////////////////////////////////////////////////
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEConvolveMatrixElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEConvolveMatrixElement.java?view=diff&rev=489226&r1=489225&r2=489226
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEConvolveMatrixElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEConvolveMatrixElement.java Wed Dec 20 16:05:36 2006
@@ -21,6 +21,7 @@
import org.apache.batik.anim.values.AnimatableValue;
import org.apache.batik.anim.values.AnimatableNumberOptionalNumberValue;
import org.apache.batik.dom.AbstractDocument;
+import org.apache.batik.dom.util.DoublyIndexedTable;
import org.apache.batik.util.SVGTypes;
import org.w3c.dom.Node;
@@ -43,6 +44,36 @@
implements SVGFEConvolveMatrixElement {
/**
+ * Table mapping XML attribute names to TraitInformation objects.
+ */
+ protected static DoublyIndexedTable xmlTraitInformation;
+ static {
+ DoublyIndexedTable t =
+ new DoublyIndexedTable(SVGOMFilterPrimitiveStandardAttributes.xmlTraitInformation);
+ t.put(null, SVG_IN_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_CDATA));
+ t.put(null, SVG_ORDER_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER_OPTIONAL_NUMBER));
+ t.put(null, SVG_KERNEL_UNIT_LENGTH_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER_OPTIONAL_NUMBER));
+ t.put(null, SVG_KERNEL_MATRIX_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER_LIST));
+ t.put(null, SVG_DIVISOR_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ t.put(null, SVG_BIAS_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ t.put(null, SVG_TARGET_X_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_INTEGER));
+ t.put(null, SVG_TARGET_Y_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_INTEGER));
+ t.put(null, SVG_EDGE_MODE_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_IDENT));
+ t.put(null, SVG_PRESERVE_ALPHA_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_BOOLEAN));
+ xmlTraitInformation = t;
+ }
+
+ /**
* The 'edgeMode' attribute values.
*/
protected static final String[] EDGE_MODE_VALUES = {
@@ -53,6 +84,26 @@
};
/**
+ * The 'in' attribute value.
+ */
+ protected SVGOMAnimatedString in;
+
+ /**
+ * The 'edgeMode' attribute value.
+ */
+ protected SVGOMAnimatedEnumeration edgeMode;
+
+ /**
+ * The 'bias' attribute value.
+ */
+ protected SVGOMAnimatedNumber bias;
+
+ /**
+ * The 'preserveAlpha' attribute value.
+ */
+ protected SVGOMAnimatedBoolean preserveAlpha;
+
+ /**
* Creates a new SVGOMFEConvolveMatrixElement object.
*/
protected SVGOMFEConvolveMatrixElement() {
@@ -66,6 +117,29 @@
public SVGOMFEConvolveMatrixElement(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() {
+ in = createLiveAnimatedString(null, SVG_IN_ATTRIBUTE);
+ edgeMode =
+ createLiveAnimatedEnumeration
+ (null, SVG_EDGE_MODE_ATTRIBUTE, EDGE_MODE_VALUES, (short) 1);
+ bias = createLiveAnimatedNumber(null, SVG_BIAS_ATTRIBUTE, 0f);
+ preserveAlpha =
+ createLiveAnimatedBoolean
+ (null, SVG_PRESERVE_ALPHA_ATTRIBUTE, false);
}
/**
@@ -76,18 +150,17 @@
}
/**
- * <b>DOM</b>: Implements { @link SVGFEConvolveMatrixElement#getIn1()}.
+ * <b>DOM</b>: Implements {@link SVGFEConvolveMatrixElement#getIn1()}.
*/
public SVGAnimatedString getIn1() {
- return getAnimatedStringAttribute(null, SVG_IN_ATTRIBUTE);
+ return in;
}
/**
* <b>DOM</b>: Implements {@link SVGFEConvolveMatrixElement#getEdgeMode()}.
*/
public SVGAnimatedEnumeration getEdgeMode() {
- return getAnimatedEnumerationAttribute
- (null, SVG_EDGE_MODE_ATTRIBUTE, EDGE_MODE_VALUES, (short)1);
+ return edgeMode;
}
/**
@@ -146,7 +219,7 @@
* org.w3c.dom.svg.SVGFEConvolveMatrixElement#getBias()}.
*/
public SVGAnimatedNumber getBias() {
- return getAnimatedNumberAttribute(null, SVG_BIAS_ATTRIBUTE, 0f);
+ return bias;
}
/**
@@ -172,14 +245,7 @@
* org.w3c.dom.svg.SVGFEConvolveMatrixElement#getPreserveAlpha()}.
*/
public SVGAnimatedBoolean getPreserveAlpha() {
- LiveAttributeValue lav;
- lav = getLiveAttributeValue(null, SVG_PRESERVE_ALPHA_ATTRIBUTE);
- if (lav == null) {
- lav = new SVGOMAnimatedBoolean
- (this, null, SVG_PRESERVE_ALPHA_ATTRIBUTE, false);
- putLiveAttributeValue(null, SVG_PRESERVE_ALPHA_ATTRIBUTE, lav);
- }
- return (SVGAnimatedBoolean)lav;
+ return preserveAlpha;
}
/**
@@ -189,53 +255,11 @@
return new SVGOMFEConvolveMatrixElement();
}
- // ExtendedTraitAccess ///////////////////////////////////////////////////
-
/**
- * Returns whether the given XML attribute is animatable.
+ * Returns the table of TraitInformation objects for this element.
*/
- public boolean isAttributeAnimatable(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_ORDER_ATTRIBUTE)
- || ln.equals(SVG_KERNEL_MATRIX_ATTRIBUTE)
- || ln.equals(SVG_DIVISOR_ATTRIBUTE)
- || ln.equals(SVG_BIAS_ATTRIBUTE)
- || ln.equals(SVG_TARGET_X_ATTRIBUTE)
- || ln.equals(SVG_TARGET_Y_ATTRIBUTE)
- || ln.equals(SVG_EDGE_MODE_ATTRIBUTE)
- || ln.equals(SVG_KERNEL_UNIT_LENGTH_ATTRIBUTE)
- || ln.equals(SVG_PRESERVE_ALPHA_ATTRIBUTE)) {
- return true;
- }
- }
- return super.isAttributeAnimatable(ns, ln);
- }
-
- /**
- * Returns the type of the given attribute.
- */
- public int getAttributeType(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)) {
- return SVGTypes.TYPE_CDATA;
- } else if (ln.equals(SVG_ORDER_ATTRIBUTE)
- || ln.equals(SVG_KERNEL_UNIT_LENGTH_ATTRIBUTE)) {
- return SVGTypes.TYPE_NUMBER_OPTIONAL_NUMBER;
- } else if (ln.equals(SVG_KERNEL_MATRIX_ATTRIBUTE)) {
- return SVGTypes.TYPE_NUMBER_LIST;
- } else if (ln.equals(SVG_DIVISOR_ATTRIBUTE)
- || ln.equals(SVG_BIAS_ATTRIBUTE)) {
- return SVGTypes.TYPE_NUMBER;
- } else if (ln.equals(SVG_TARGET_X_ATTRIBUTE)
- || ln.equals(SVG_TARGET_Y_ATTRIBUTE)) {
- return SVGTypes.TYPE_INTEGER;
- } else if (ln.equals(SVG_EDGE_MODE_ATTRIBUTE)) {
- return SVGTypes.TYPE_IDENT;
- } else if (ln.equals(SVG_PRESERVE_ALPHA_ATTRIBUTE)) {
- return SVGTypes.TYPE_BOOLEAN;
- }
- }
- return super.getAttributeType(ns, ln);
+ protected DoublyIndexedTable getTraitInformationTable() {
+ return xmlTraitInformation;
}
// AnimationTarget ///////////////////////////////////////////////////////
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEDiffuseLightingElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEDiffuseLightingElement.java?view=diff&rev=489226&r1=489225&r2=489226
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEDiffuseLightingElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEDiffuseLightingElement.java Wed Dec 20 16:05:36 2006
@@ -21,6 +21,7 @@
import org.apache.batik.anim.values.AnimatableNumberOptionalNumberValue;
import org.apache.batik.anim.values.AnimatableValue;
import org.apache.batik.dom.AbstractDocument;
+import org.apache.batik.dom.util.DoublyIndexedTable;
import org.apache.batik.util.SVGTypes;
import org.w3c.dom.Node;
@@ -39,6 +40,37 @@
implements SVGFEDiffuseLightingElement {
/**
+ * Table mapping XML attribute names to TraitInformation objects.
+ */
+ protected static DoublyIndexedTable xmlTraitInformation;
+ static {
+ DoublyIndexedTable t =
+ new DoublyIndexedTable(SVGOMFilterPrimitiveStandardAttributes.xmlTraitInformation);
+ t.put(null, SVG_IN_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_CDATA));
+ t.put(null, SVG_IN2_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_CDATA));
+ t.put(null, SVG_MODE_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_IDENT));
+ xmlTraitInformation = t;
+ }
+
+ /**
+ * The 'in' attribute value.
+ */
+ protected SVGOMAnimatedString in;
+
+ /**
+ * The 'surfaceScale' attribute value.
+ */
+ protected SVGOMAnimatedNumber surfaceScale;
+
+ /**
+ * The 'diffuseConstant' attribute value.
+ */
+ protected SVGOMAnimatedNumber diffuseConstant;
+
+ /**
* Creates a new SVGOMFEDiffuseLightingElement object.
*/
protected SVGOMFEDiffuseLightingElement() {
@@ -52,6 +84,26 @@
public SVGOMFEDiffuseLightingElement(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() {
+ in = createLiveAnimatedString(null, SVG_IN_ATTRIBUTE);
+ surfaceScale =
+ createLiveAnimatedNumber(null, SVG_SURFACE_SCALE_ATTRIBUTE, 1f);
+ diffuseConstant =
+ createLiveAnimatedNumber(null, SVG_DIFFUSE_CONSTANT_ATTRIBUTE, 1f);
}
/**
@@ -65,7 +117,7 @@
* <b>DOM</b>: Implements {@link SVGFEDiffuseLightingElement#getIn1()}.
*/
public SVGAnimatedString getIn1() {
- return getAnimatedStringAttribute(null, SVG_IN_ATTRIBUTE);
+ return in;
}
/**
@@ -73,9 +125,7 @@
* SVGFEDiffuseLightingElement#getSurfaceScale()}.
*/
public SVGAnimatedNumber getSurfaceScale() {
- return getAnimatedNumberAttribute(null,
- SVG_SURFACE_SCALE_ATTRIBUTE,
- 1f);
+ return surfaceScale;
}
/**
@@ -83,9 +133,7 @@
* SVGFEDiffuseLightingElement#getDiffuseConstant()}.
*/
public SVGAnimatedNumber getDiffuseConstant() {
- return getAnimatedNumberAttribute(null,
- SVG_DIFFUSE_CONSTANT_ATTRIBUTE,
- 1f);
+ return diffuseConstant;
}
/**
@@ -113,38 +161,11 @@
return new SVGOMFEDiffuseLightingElement();
}
- // ExtendedTraitAccess ///////////////////////////////////////////////////
-
/**
- * Returns whether the given XML attribute is animatable.
+ * Returns the table of TraitInformation objects for this element.
*/
- public boolean isAttributeAnimatable(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)
- || ln.equals(SVG_SURFACE_SCALE_ATTRIBUTE)
- || ln.equals(SVG_DIFFUSE_CONSTANT_ATTRIBUTE)
- || ln.equals(SVG_KERNEL_UNIT_LENGTH_ATTRIBUTE)) {
- return true;
- }
- }
- return super.isAttributeAnimatable(ns, ln);
- }
-
- /**
- * Returns the type of the given attribute.
- */
- public int getAttributeType(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)) {
- return SVGTypes.TYPE_CDATA;
- } else if (ln.equals(SVG_SURFACE_SCALE_ATTRIBUTE)
- || ln.equals(SVG_DIFFUSE_CONSTANT_ATTRIBUTE)) {
- return SVGTypes.TYPE_NUMBER;
- } else if (ln.equals(SVG_KERNEL_UNIT_LENGTH_ATTRIBUTE)) {
- return SVGTypes.TYPE_NUMBER_OPTIONAL_NUMBER;
- }
- }
- return super.getAttributeType(ns, ln);
+ protected DoublyIndexedTable getTraitInformationTable() {
+ return xmlTraitInformation;
}
// AnimationTarget ///////////////////////////////////////////////////////
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEDisplacementMapElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEDisplacementMapElement.java?view=diff&rev=489226&r1=489225&r2=489226
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEDisplacementMapElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEDisplacementMapElement.java Wed Dec 20 16:05:36 2006
@@ -20,6 +20,7 @@
import org.apache.batik.anim.values.AnimatableValue;
import org.apache.batik.dom.AbstractDocument;
+import org.apache.batik.dom.util.DoublyIndexedTable;
import org.apache.batik.util.SVGTypes;
import org.w3c.dom.Node;
@@ -39,6 +40,26 @@
implements SVGFEDisplacementMapElement {
/**
+ * Table mapping XML attribute names to TraitInformation objects.
+ */
+ protected static DoublyIndexedTable xmlTraitInformation;
+ static {
+ DoublyIndexedTable t =
+ new DoublyIndexedTable(SVGOMFilterPrimitiveStandardAttributes.xmlTraitInformation);
+ t.put(null, SVG_IN_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_CDATA));
+ t.put(null, SVG_IN2_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_CDATA));
+ t.put(null, SVG_SCALE_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ t.put(null, SVG_X_CHANNEL_SELECTOR_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_IDENT));
+ t.put(null, SVG_Y_CHANNEL_SELECTOR_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_IDENT));
+ xmlTraitInformation = t;
+ }
+
+ /**
* The 'xChannelSelector' and 'yChannelSelector' attributes values.
*/
protected static final String[] CHANNEL_SELECTOR_VALUES = {
@@ -50,6 +71,31 @@
};
/**
+ * The 'in' attribute value.
+ */
+ protected SVGOMAnimatedString in;
+
+ /**
+ * The 'in2' attribute value.
+ */
+ protected SVGOMAnimatedString in2;
+
+ /**
+ * The 'scale' attribute value.
+ */
+ protected SVGOMAnimatedNumber scale;
+
+ /**
+ * The 'xChannelSelector' attribute value.
+ */
+ protected SVGOMAnimatedEnumeration xChannelSelector;
+
+ /**
+ * The 'yChannelSelector' attribute value.
+ */
+ protected SVGOMAnimatedEnumeration yChannelSelector;
+
+ /**
* Creates a new SVGOMFEDisplacementMap object.
*/
protected SVGOMFEDisplacementMapElement() {
@@ -63,6 +109,32 @@
public SVGOMFEDisplacementMapElement(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() {
+ in = createLiveAnimatedString(null, SVG_IN_ATTRIBUTE);
+ in2 = createLiveAnimatedString(null, SVG_IN2_ATTRIBUTE);
+ scale = createLiveAnimatedNumber(null, SVG_SCALE_ATTRIBUTE, 0f);
+ xChannelSelector =
+ createLiveAnimatedEnumeration
+ (null, SVG_X_CHANNEL_SELECTOR_ATTRIBUTE,
+ CHANNEL_SELECTOR_VALUES, (short) 4);
+ yChannelSelector =
+ createLiveAnimatedEnumeration
+ (null, SVG_Y_CHANNEL_SELECTOR_ATTRIBUTE,
+ CHANNEL_SELECTOR_VALUES, (short) 4);
}
/**
@@ -77,7 +149,7 @@
* SVGFEDisplacementMapElement#getIn1()}.
*/
public SVGAnimatedString getIn1() {
- return getAnimatedStringAttribute(null, SVG_IN_ATTRIBUTE);
+ return in;
}
/**
@@ -85,7 +157,7 @@
* SVGFEDisplacementMapElement#getIn2()}.
*/
public SVGAnimatedString getIn2() {
- return getAnimatedStringAttribute(null, SVG_IN2_ATTRIBUTE);
+ return in2;
}
/**
@@ -93,7 +165,7 @@
* org.w3c.dom.svg.SVGFEDisplacementMapElement#getScale()}.
*/
public SVGAnimatedNumber getScale() {
- return getAnimatedNumberAttribute(null, SVG_SCALE_ATTRIBUTE, 0f);
+ return scale;
}
/**
@@ -101,9 +173,7 @@
* SVGFEDisplacementMapElement#getXChannelSelector()}.
*/
public SVGAnimatedEnumeration getXChannelSelector() {
- return getAnimatedEnumerationAttribute
- (null, SVG_X_CHANNEL_SELECTOR_ATTRIBUTE,
- CHANNEL_SELECTOR_VALUES, (short)4);
+ return xChannelSelector;
}
/**
@@ -111,9 +181,7 @@
* SVGFEDisplacementMapElement#getYChannelSelector()}.
*/
public SVGAnimatedEnumeration getYChannelSelector() {
- return getAnimatedEnumerationAttribute
- (null, SVG_Y_CHANNEL_SELECTOR_ATTRIBUTE,
- CHANNEL_SELECTOR_VALUES, (short)4);
+ return yChannelSelector;
}
/**
@@ -123,40 +191,11 @@
return new SVGOMFEDisplacementMapElement();
}
- // ExtendedTraitAccess ///////////////////////////////////////////////////
-
/**
- * Returns whether the given XML attribute is animatable.
+ * Returns the table of TraitInformation objects for this element.
*/
- public boolean isAttributeAnimatable(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)
- || ln.equals(SVG_IN2_ATTRIBUTE)
- || ln.equals(SVG_SCALE_ATTRIBUTE)
- || ln.equals(SVG_X_CHANNEL_SELECTOR_ATTRIBUTE)
- || ln.equals(SVG_Y_CHANNEL_SELECTOR_ATTRIBUTE)) {
- return true;
- }
- }
- return super.isAttributeAnimatable(ns, ln);
- }
-
- /**
- * Returns the type of the given attribute.
- */
- public int getAttributeType(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)
- || ln.equals(SVG_IN2_ATTRIBUTE)) {
- return SVGTypes.TYPE_CDATA;
- } else if (ln.equals(SVG_X_CHANNEL_SELECTOR_ATTRIBUTE)
- || ln.equals(SVG_Y_CHANNEL_SELECTOR_ATTRIBUTE)) {
- return SVGTypes.TYPE_IDENT;
- } else if (ln.equals(SVG_SCALE_ATTRIBUTE)) {
- return SVGTypes.TYPE_NUMBER;
- }
- }
- return super.getAttributeType(ns, ln);
+ protected DoublyIndexedTable getTraitInformationTable() {
+ return xmlTraitInformation;
}
// AnimationTarget ///////////////////////////////////////////////////////
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEDistantLightElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEDistantLightElement.java?view=diff&rev=489226&r1=489225&r2=489226
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEDistantLightElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEDistantLightElement.java Wed Dec 20 16:05:36 2006
@@ -20,6 +20,7 @@
import org.apache.batik.anim.values.AnimatableValue;
import org.apache.batik.dom.AbstractDocument;
+import org.apache.batik.dom.util.DoublyIndexedTable;
import org.apache.batik.util.SVGTypes;
import org.w3c.dom.Node;
@@ -37,6 +38,30 @@
implements SVGFEDistantLightElement {
/**
+ * Table mapping XML attribute names to TraitInformation objects.
+ */
+ protected static DoublyIndexedTable xmlTraitInformation;
+ static {
+ DoublyIndexedTable t =
+ new DoublyIndexedTable(SVGOMElement.xmlTraitInformation);
+ t.put(null, SVG_AZIMUTH_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ t.put(null, SVG_ELEVATION_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ xmlTraitInformation = t;
+ }
+
+ /**
+ * The 'azimuth' attribute value.
+ */
+ protected SVGOMAnimatedNumber azimuth;
+
+ /**
+ * The 'elevation' attribute value.
+ */
+ protected SVGOMAnimatedNumber elevation;
+
+ /**
* Creates a new SVGOMFEDistantLightElement object.
*/
protected SVGOMFEDistantLightElement() {
@@ -50,6 +75,23 @@
public SVGOMFEDistantLightElement(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() {
+ azimuth = createLiveAnimatedNumber(null, SVG_AZIMUTH_ATTRIBUTE, 0f);
+ elevation = createLiveAnimatedNumber(null, SVG_ELEVATION_ATTRIBUTE, 0f);
}
/**
@@ -63,14 +105,14 @@
* <b>DOM</b>: Implements {@link SVGFEDistantLightElement#getAzimuth()}.
*/
public SVGAnimatedNumber getAzimuth() {
- return getAnimatedNumberAttribute(null, SVG_AZIMUTH_ATTRIBUTE, 0f);
+ return azimuth;
}
/**
* <b>DOM</b>: Implements {@link SVGFEDistantLightElement#getElevation()}.
*/
public SVGAnimatedNumber getElevation() {
- return getAnimatedNumberAttribute(null, SVG_ELEVATION_ATTRIBUTE, 0f);
+ return elevation;
}
/**
@@ -80,32 +122,11 @@
return new SVGOMFEDistantLightElement();
}
- // ExtendedTraitAccess ///////////////////////////////////////////////////
-
- /**
- * Returns whether the given XML attribute is animatable.
- */
- public boolean isAttributeAnimatable(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_AZIMUTH_ATTRIBUTE)
- || ln.equals(SVG_ELEVATION_ATTRIBUTE)) {
- return true;
- }
- }
- return super.isAttributeAnimatable(ns, ln);
- }
-
/**
- * Returns the type of the given attribute.
+ * Returns the table of TraitInformation objects for this element.
*/
- public int getAttributeType(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_AZIMUTH_ATTRIBUTE)
- || ln.equals(SVG_ELEVATION_ATTRIBUTE)) {
- return SVGTypes.TYPE_NUMBER;
- }
- }
- return super.getAttributeType(ns, ln);
+ protected DoublyIndexedTable getTraitInformationTable() {
+ return xmlTraitInformation;
}
// AnimationTarget ///////////////////////////////////////////////////////
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEFloodElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEFloodElement.java?view=diff&rev=489226&r1=489225&r2=489226
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEFloodElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEFloodElement.java Wed Dec 20 16:05:36 2006
@@ -20,6 +20,7 @@
import org.apache.batik.anim.values.AnimatableValue;
import org.apache.batik.dom.AbstractDocument;
+import org.apache.batik.dom.util.DoublyIndexedTable;
import org.apache.batik.util.SVGTypes;
import org.w3c.dom.Node;
@@ -37,6 +38,23 @@
implements SVGFEFloodElement {
/**
+ * Table mapping XML attribute names to TraitInformation objects.
+ */
+ protected static DoublyIndexedTable xmlTraitInformation;
+ static {
+ DoublyIndexedTable t =
+ new DoublyIndexedTable(SVGOMFilterPrimitiveStandardAttributes.xmlTraitInformation);
+ t.put(null, SVG_IN_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_CDATA));
+ xmlTraitInformation = t;
+ }
+
+ /**
+ * The 'in' attribute value.
+ */
+ protected SVGOMAnimatedString in;
+
+ /**
* Creates a new SVGOMFEFloodElement object.
*/
protected SVGOMFEFloodElement() {
@@ -50,6 +68,22 @@
public SVGOMFEFloodElement(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() {
+ in = createLiveAnimatedString(null, SVG_IN_ATTRIBUTE);
}
/**
@@ -63,7 +97,7 @@
* <b>DOM</b>: Implements {@link SVGFEFloodElement#getIn1()}.
*/
public SVGAnimatedString getIn1() {
- return getAnimatedStringAttribute(null, SVG_IN_ATTRIBUTE);
+ return in;
}
/**
@@ -73,30 +107,11 @@
return new SVGOMFEFloodElement();
}
- // ExtendedTraitAccess ///////////////////////////////////////////////////
-
- /**
- * Returns whether the given XML attribute is animatable.
- */
- public boolean isAttributeAnimatable(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)) {
- return true;
- }
- }
- return super.isAttributeAnimatable(ns, ln);
- }
-
/**
- * Returns the type of the given attribute.
+ * Returns the table of TraitInformation objects for this element.
*/
- public int getAttributeType(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)) {
- return SVGTypes.TYPE_CDATA;
- }
- }
- return super.getAttributeType(ns, ln);
+ protected DoublyIndexedTable getTraitInformationTable() {
+ return xmlTraitInformation;
}
// AnimationTarget ///////////////////////////////////////////////////////
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEGaussianBlurElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEGaussianBlurElement.java?view=diff&rev=489226&r1=489225&r2=489226
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEGaussianBlurElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEGaussianBlurElement.java Wed Dec 20 16:05:36 2006
@@ -19,6 +19,7 @@
package org.apache.batik.dom.svg;
import org.apache.batik.dom.AbstractDocument;
+import org.apache.batik.dom.util.DoublyIndexedTable;
import org.apache.batik.anim.values.AnimatableNumberOptionalNumberValue;
import org.apache.batik.anim.values.AnimatableValue;
import org.apache.batik.util.SVGTypes;
@@ -39,6 +40,25 @@
implements SVGFEGaussianBlurElement {
/**
+ * Table mapping XML attribute names to TraitInformation objects.
+ */
+ protected static DoublyIndexedTable xmlTraitInformation;
+ static {
+ DoublyIndexedTable t =
+ new DoublyIndexedTable(SVGOMFilterPrimitiveStandardAttributes.xmlTraitInformation);
+ t.put(null, SVG_IN_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_CDATA));
+ t.put(null, SVG_STD_DEVIATION_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER_OPTIONAL_NUMBER));
+ xmlTraitInformation = t;
+ }
+
+ /**
+ * The 'in' attribute value.
+ */
+ protected SVGOMAnimatedString in;
+
+ /**
* Creates a new SVGOMFEGaussianBlurElement object.
*/
protected SVGOMFEGaussianBlurElement() {
@@ -51,6 +71,22 @@
*/
public SVGOMFEGaussianBlurElement(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() {
+ in = createLiveAnimatedString(null, SVG_IN_ATTRIBUTE);
}
/**
@@ -64,7 +100,7 @@
* <b>DOM</b>: Implements {@link SVGFEGaussianBlurElement#getIn1()}.
*/
public SVGAnimatedString getIn1() {
- return getAnimatedStringAttribute(null, SVG_IN_ATTRIBUTE);
+ return in;
}
/**
@@ -89,7 +125,7 @@
* <b>DOM</b>: Implements {@link
* SVGFEGaussianBlurElement#setStdDeviation(float,float)}.
*/
- public void setStdDeviation (float devX, float devY) {
+ public void setStdDeviation(float devX, float devY) {
setAttributeNS(null, SVG_STD_DEVIATION_ATTRIBUTE,
Float.toString(devX) + " " + Float.toString(devY));
}
@@ -101,33 +137,11 @@
return new SVGOMFEGaussianBlurElement();
}
- // ExtendedTraitAccess ///////////////////////////////////////////////////
-
- /**
- * Returns whether the given XML attribute is animatable.
- */
- public boolean isAttributeAnimatable(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)
- || ln.equals(SVG_STD_DEVIATION_ATTRIBUTE)) {
- return true;
- }
- }
- return super.isAttributeAnimatable(ns, ln);
- }
-
/**
- * Returns the type of the given attribute.
+ * Returns the table of TraitInformation objects for this element.
*/
- public int getAttributeType(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)) {
- return SVGTypes.TYPE_CDATA;
- } else if (ln.equals(SVG_STD_DEVIATION_ATTRIBUTE)) {
- return SVGTypes.TYPE_NUMBER_OPTIONAL_NUMBER;
- }
- }
- return super.getAttributeType(ns, ln);
+ protected DoublyIndexedTable getTraitInformationTable() {
+ return xmlTraitInformation;
}
// AnimationTarget ///////////////////////////////////////////////////////
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEImageElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEImageElement.java?view=diff&rev=489226&r1=489225&r2=489226
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEImageElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEImageElement.java Wed Dec 20 16:05:36 2006
@@ -20,6 +20,7 @@
import org.apache.batik.anim.values.AnimatableValue;
import org.apache.batik.dom.AbstractDocument;
+import org.apache.batik.dom.util.DoublyIndexedTable;
import org.apache.batik.dom.util.XLinkSupport;
import org.apache.batik.dom.util.XMLSupport;
import org.apache.batik.util.SVGTypes;
@@ -41,6 +42,22 @@
implements SVGFEImageElement {
/**
+ * Table mapping XML attribute names to TraitInformation objects.
+ */
+ protected static DoublyIndexedTable xmlTraitInformation;
+ static {
+ DoublyIndexedTable t =
+ new DoublyIndexedTable(SVGOMFilterPrimitiveStandardAttributes.xmlTraitInformation);
+ t.put(null, SVG_EXTERNAL_RESOURCES_REQUIRED_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_BOOLEAN));
+ t.put(null, SVG_PRESERVE_ASPECT_RATIO_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_PRESERVE_ASPECT_RATIO_VALUE));
+ t.put(XLINK_NAMESPACE_URI, XLINK_HREF_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_URI));
+ xmlTraitInformation = t;
+ }
+
+ /**
* The attribute initializer.
*/
protected static final AttributeInitializer attributeInitializer;
@@ -58,6 +75,21 @@
}
/**
+ * The 'xlink:href' attribute value.
+ */
+ protected SVGOMAnimatedString href;
+
+ /**
+ * The 'preserveAspectRatio' attribute value.
+ */
+ protected SVGOMAnimatedPreserveAspectRatio preserveAspectRatio;
+
+ /**
+ * The 'externalResourcesRequired' attribute value.
+ */
+ protected SVGOMAnimatedBoolean externalResourcesRequired;
+
+ /**
* Creates a new SVGOMFEImageElement object.
*/
protected SVGOMFEImageElement() {
@@ -71,6 +103,27 @@
public SVGOMFEImageElement(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);
+ preserveAspectRatio = createLiveAnimatedPreserveAspectRatio();
+ externalResourcesRequired =
+ createLiveAnimatedBoolean
+ (null, SVG_EXTERNAL_RESOURCES_REQUIRED_ATTRIBUTE, false);
}
/**
@@ -85,14 +138,14 @@
* org.w3c.dom.svg.SVGURIReference#getHref()}.
*/
public SVGAnimatedString getHref() {
- return SVGURIReferenceSupport.getHref(this);
+ return href;
}
/**
* <b>DOM</b>: Implements {@link SVGFEImageElement#getPreserveAspectRatio()}.
*/
public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio() {
- return SVGPreserveAspectRatioSupport.getPreserveAspectRatio(this);
+ return preserveAspectRatio;
}
// SVGLangSpace support //////////////////////////////////////////////////
@@ -132,8 +185,7 @@
* org.w3c.dom.svg.SVGExternalResourcesRequired#getExternalResourcesRequired()}.
*/
public SVGAnimatedBoolean getExternalResourcesRequired() {
- return SVGExternalResourcesRequiredSupport.
- getExternalResourcesRequired(this);
+ return externalResourcesRequired;
}
/**
@@ -151,33 +203,11 @@
return new SVGOMFEImageElement();
}
- // ExtendedTraitAccess ///////////////////////////////////////////////////
-
- /**
- * Returns whether the given XML attribute is animatable.
- */
- public boolean isAttributeAnimatable(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_EXTERNAL_RESOURCES_REQUIRED_ATTRIBUTE)
- || ln.equals(SVG_PRESERVE_ASPECT_RATIO_ATTRIBUTE)) {
- return true;
- }
- }
- return super.isAttributeAnimatable(ns, ln);
- }
-
/**
- * Returns the type of the given attribute.
+ * Returns the table of TraitInformation objects for this element.
*/
- public int getAttributeType(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_PRESERVE_ASPECT_RATIO_ATTRIBUTE)) {
- return SVGTypes.TYPE_PRESERVE_ASPECT_RATIO_VALUE;
- } else if (ln.equals(SVG_EXTERNAL_RESOURCES_REQUIRED_ATTRIBUTE)) {
- return SVGTypes.TYPE_BOOLEAN;
- }
- }
- return super.getAttributeType(ns, ln);
+ protected DoublyIndexedTable getTraitInformationTable() {
+ return xmlTraitInformation;
}
// AnimationTarget ///////////////////////////////////////////////////////
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEMergeNodeElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEMergeNodeElement.java?view=diff&rev=489226&r1=489225&r2=489226
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEMergeNodeElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEMergeNodeElement.java Wed Dec 20 16:05:36 2006
@@ -20,6 +20,7 @@
import org.apache.batik.anim.values.AnimatableValue;
import org.apache.batik.dom.AbstractDocument;
+import org.apache.batik.dom.util.DoublyIndexedTable;
import org.apache.batik.util.SVGTypes;
import org.w3c.dom.Node;
@@ -37,6 +38,23 @@
implements SVGFEMergeNodeElement {
/**
+ * Table mapping XML attribute names to TraitInformation objects.
+ */
+ protected static DoublyIndexedTable xmlTraitInformation;
+ static {
+ DoublyIndexedTable t =
+ new DoublyIndexedTable(SVGOMElement.xmlTraitInformation);
+ t.put(null, SVG_IN_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_CDATA));
+ xmlTraitInformation = t;
+ }
+
+ /**
+ * The 'in' attribute value.
+ */
+ protected SVGOMAnimatedString in;
+
+ /**
* Creates a new SVGOMFEMergeNodeElement object.
*/
protected SVGOMFEMergeNodeElement() {
@@ -49,6 +67,22 @@
*/
public SVGOMFEMergeNodeElement(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() {
+ in = createLiveAnimatedString(null, SVG_IN_ATTRIBUTE);
}
/**
@@ -63,7 +97,7 @@
* SVGFEMergeNodeElement#getIn1()}.
*/
public SVGAnimatedString getIn1() {
- return getAnimatedStringAttribute(null, SVG_IN_ATTRIBUTE);
+ return in;
}
/**
@@ -73,30 +107,11 @@
return new SVGOMFEMergeNodeElement();
}
- // ExtendedTraitAccess ///////////////////////////////////////////////////
-
- /**
- * Returns whether the given XML attribute is animatable.
- */
- public boolean isAttributeAnimatable(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)) {
- return true;
- }
- }
- return super.isAttributeAnimatable(ns, ln);
- }
-
/**
- * Returns the type of the given attribute.
+ * Returns the table of TraitInformation objects for this element.
*/
- public int getAttributeType(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)) {
- return SVGTypes.TYPE_CDATA;
- }
- }
- return super.getAttributeType(ns, ln);
+ protected DoublyIndexedTable getTraitInformationTable() {
+ return xmlTraitInformation;
}
// AnimationTarget ///////////////////////////////////////////////////////
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEMorphologyElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEMorphologyElement.java?view=diff&rev=489226&r1=489225&r2=489226
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEMorphologyElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEMorphologyElement.java Wed Dec 20 16:05:36 2006
@@ -21,6 +21,7 @@
import org.apache.batik.anim.values.AnimatableNumberOptionalNumberValue;
import org.apache.batik.anim.values.AnimatableValue;
import org.apache.batik.dom.AbstractDocument;
+import org.apache.batik.dom.util.DoublyIndexedTable;
import org.apache.batik.util.SVGTypes;
import org.w3c.dom.Node;
@@ -40,6 +41,22 @@
implements SVGFEMorphologyElement {
/**
+ * Table mapping XML attribute names to TraitInformation objects.
+ */
+ protected static DoublyIndexedTable xmlTraitInformation;
+ static {
+ DoublyIndexedTable t =
+ new DoublyIndexedTable(SVGOMFilterPrimitiveStandardAttributes.xmlTraitInformation);
+ t.put(null, SVG_IN_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_CDATA));
+ t.put(null, SVG_OPERATOR_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_IDENT));
+ t.put(null, SVG_RADIUS_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER_OPTIONAL_NUMBER));
+ xmlTraitInformation = t;
+ }
+
+ /**
* The 'operator' attribute values.
*/
protected static final String[] OPERATOR_VALUES = {
@@ -49,6 +66,16 @@
};
/**
+ * The 'in' attribute value.
+ */
+ protected SVGOMAnimatedString in;
+
+ /**
+ * The 'operator' attribute value.
+ */
+ protected SVGOMAnimatedEnumeration operator;
+
+ /**
* Creates a new SVGOMFEMorphologyElement object.
*/
protected SVGOMFEMorphologyElement() {
@@ -61,6 +88,25 @@
*/
public SVGOMFEMorphologyElement(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() {
+ in = createLiveAnimatedString(null, SVG_IN_ATTRIBUTE);
+ operator =
+ createLiveAnimatedEnumeration
+ (null, SVG_OPERATOR_ATTRIBUTE, OPERATOR_VALUES, (short) 1);
}
/**
@@ -74,15 +120,14 @@
* <b>DOM</b>: Implements {@link SVGFEMorphologyElement#getIn1()}.
*/
public SVGAnimatedString getIn1() {
- return getAnimatedStringAttribute(null, SVG_IN_ATTRIBUTE);
+ return in;
}
/**
* <b>DOM</b>: Implements {@link SVGFEMorphologyElement#getOperator()}.
*/
public SVGAnimatedEnumeration getOperator() {
- return getAnimatedEnumerationAttribute
- (null, SVG_OPERATOR_ATTRIBUTE, OPERATOR_VALUES, (short)1);
+ return operator;
}
/**
@@ -108,36 +153,11 @@
return new SVGOMFEMorphologyElement();
}
- // ExtendedTraitAccess ///////////////////////////////////////////////////
-
/**
- * Returns whether the given XML attribute is animatable.
+ * Returns the table of TraitInformation objects for this element.
*/
- public boolean isAttributeAnimatable(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)
- || ln.equals(SVG_OPERATOR_ATTRIBUTE)
- || ln.equals(SVG_RADIUS_ATTRIBUTE)) {
- return true;
- }
- }
- return super.isAttributeAnimatable(ns, ln);
- }
-
- /**
- * Returns the type of the given attribute.
- */
- public int getAttributeType(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)) {
- return SVGTypes.TYPE_CDATA;
- } else if (ln.equals(SVG_OPERATOR_ATTRIBUTE)) {
- return SVGTypes.TYPE_IDENT;
- } else if (ln.equals(SVG_RADIUS_ATTRIBUTE)) {
- return SVGTypes.TYPE_NUMBER_OPTIONAL_NUMBER;
- }
- }
- return super.getAttributeType(ns, ln);
+ protected DoublyIndexedTable getTraitInformationTable() {
+ return xmlTraitInformation;
}
// AnimationTarget ///////////////////////////////////////////////////////
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEOffsetElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEOffsetElement.java?view=diff&rev=489226&r1=489225&r2=489226
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEOffsetElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEOffsetElement.java Wed Dec 20 16:05:36 2006
@@ -20,6 +20,7 @@
import org.apache.batik.anim.values.AnimatableValue;
import org.apache.batik.dom.AbstractDocument;
+import org.apache.batik.dom.util.DoublyIndexedTable;
import org.apache.batik.util.SVGTypes;
import org.w3c.dom.Node;
@@ -38,6 +39,37 @@
implements SVGFEOffsetElement {
/**
+ * Table mapping XML attribute names to TraitInformation objects.
+ */
+ protected static DoublyIndexedTable xmlTraitInformation;
+ static {
+ DoublyIndexedTable t =
+ new DoublyIndexedTable(SVGOMFilterPrimitiveStandardAttributes.xmlTraitInformation);
+ t.put(null, SVG_IN_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_CDATA));
+ t.put(null, SVG_DX_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ t.put(null, SVG_DY_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ xmlTraitInformation = t;
+ }
+
+ /**
+ * The 'in' attribute value.
+ */
+ protected SVGOMAnimatedString in;
+
+ /**
+ * The 'dx' attribute value.
+ */
+ protected SVGOMAnimatedNumber dx;
+
+ /**
+ * The 'dy' attribute value.
+ */
+ protected SVGOMAnimatedNumber dy;
+
+ /**
* Creates a new SVGOMFEOffsetElement object.
*/
protected SVGOMFEOffsetElement() {
@@ -50,6 +82,24 @@
*/
public SVGOMFEOffsetElement(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() {
+ in = createLiveAnimatedString(null, SVG_IN_ATTRIBUTE);
+ dx = createLiveAnimatedNumber(null, SVG_DX_ATTRIBUTE, 0f);
+ dy = createLiveAnimatedNumber(null, SVG_DY_ATTRIBUTE, 0f);
}
/**
@@ -64,7 +114,7 @@
* SVGFEOffsetElement#getIn1()}.
*/
public SVGAnimatedString getIn1() {
- return getAnimatedStringAttribute(null, SVG_IN_ATTRIBUTE);
+ return in;
}
/**
@@ -72,7 +122,7 @@
* org.w3c.dom.svg.SVGFEOffsetElement#getDx()}.
*/
public SVGAnimatedNumber getDx() {
- return getAnimatedNumberAttribute(null, SVG_DX_ATTRIBUTE, 0f);
+ return dx;
}
/**
@@ -80,7 +130,7 @@
* org.w3c.dom.svg.SVGFEOffsetElement#getDy()}.
*/
public SVGAnimatedNumber getDy() {
- return getAnimatedNumberAttribute(null, SVG_DY_ATTRIBUTE, 0f);
+ return dy;
}
/**
@@ -90,52 +140,11 @@
return new SVGOMFEOffsetElement();
}
- // AnimationTarget ///////////////////////////////////////////////////////
-
- /**
- * Gets how percentage values are interpreted by the given attribute.
- */
- protected short getAttributePercentageInterpretation(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_DX_ATTRIBUTE)) {
- return PERCENTAGE_VIEWPORT_WIDTH;
- }
- if (ln.equals(SVG_DY_ATTRIBUTE)) {
- return PERCENTAGE_VIEWPORT_HEIGHT;
- }
- }
- return super.getAttributePercentageInterpretation(ns, ln);
- }
-
- // ExtendedTraitAccess ///////////////////////////////////////////////////
-
- /**
- * Returns whether the given XML attribute is animatable.
- */
- public boolean isAttributeAnimatable(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)
- || ln.equals(SVG_DX_ATTRIBUTE)
- || ln.equals(SVG_DY_ATTRIBUTE)) {
- return true;
- }
- }
- return super.isAttributeAnimatable(ns, ln);
- }
-
/**
- * Returns the type of the given attribute.
+ * Returns the table of TraitInformation objects for this element.
*/
- public int getAttributeType(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)) {
- return SVGTypes.TYPE_CDATA;
- } else if (ln.equals(SVG_DX_ATTRIBUTE)
- || ln.equals(SVG_DY_ATTRIBUTE)) {
- return SVGTypes.TYPE_NUMBER;
- }
- }
- return super.getAttributeType(ns, ln);
+ protected DoublyIndexedTable getTraitInformationTable() {
+ return xmlTraitInformation;
}
// AnimationTarget ///////////////////////////////////////////////////////
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEPointLightElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEPointLightElement.java?view=diff&rev=489226&r1=489225&r2=489226
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEPointLightElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEPointLightElement.java Wed Dec 20 16:05:36 2006
@@ -20,6 +20,7 @@
import org.apache.batik.anim.values.AnimatableValue;
import org.apache.batik.dom.AbstractDocument;
+import org.apache.batik.dom.util.DoublyIndexedTable;
import org.apache.batik.util.SVGTypes;
import org.w3c.dom.Node;
@@ -37,6 +38,37 @@
implements SVGFEPointLightElement {
/**
+ * Table mapping XML attribute names to TraitInformation objects.
+ */
+ protected static DoublyIndexedTable xmlTraitInformation;
+ static {
+ DoublyIndexedTable t =
+ new DoublyIndexedTable(SVGOMElement.xmlTraitInformation);
+ t.put(null, SVG_X_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ t.put(null, SVG_Y_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ t.put(null, SVG_Z_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ xmlTraitInformation = t;
+ }
+
+ /**
+ * The 'x' attribute value.
+ */
+ protected SVGOMAnimatedNumber x;
+
+ /**
+ * The 'y' attribute value.
+ */
+ protected SVGOMAnimatedNumber y;
+
+ /**
+ * The 'z' attribute value.
+ */
+ protected SVGOMAnimatedNumber z;
+
+ /**
* Creates a new SVGOMFEPointLightElement object.
*/
protected SVGOMFEPointLightElement() {
@@ -50,6 +82,24 @@
public SVGOMFEPointLightElement(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 = createLiveAnimatedNumber(null, SVG_X_ATTRIBUTE, 0f);
+ y = createLiveAnimatedNumber(null, SVG_Y_ATTRIBUTE, 0f);
+ z = createLiveAnimatedNumber(null, SVG_Z_ATTRIBUTE, 0f);
}
/**
@@ -63,21 +113,21 @@
* <b>DOM</b>: Implements {@link SVGFEPointLightElement#getX()}.
*/
public SVGAnimatedNumber getX() {
- return getAnimatedNumberAttribute(null, SVG_X_ATTRIBUTE, 0f);
+ return x;
}
/**
* <b>DOM</b>: Implements {@link SVGFEPointLightElement#getY()}.
*/
public SVGAnimatedNumber getY() {
- return getAnimatedNumberAttribute(null, SVG_Y_ATTRIBUTE, 0f);
+ return y;
}
/**
* <b>DOM</b>: Implements {@link SVGFEPointLightElement#getZ()}.
*/
public SVGAnimatedNumber getZ() {
- return getAnimatedNumberAttribute(null, SVG_Z_ATTRIBUTE, 0f);
+ return z;
}
/**
@@ -87,34 +137,11 @@
return new SVGOMFEPointLightElement();
}
- // ExtendedTraitAccess ///////////////////////////////////////////////////
-
/**
- * Returns whether the given XML attribute is animatable.
+ * Returns the table of TraitInformation objects for this element.
*/
- public boolean isAttributeAnimatable(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_X_ATTRIBUTE)
- || ln.equals(SVG_Y_ATTRIBUTE)
- || ln.equals(SVG_Z_ATTRIBUTE)) {
- return true;
- }
- }
- return super.isAttributeAnimatable(ns, ln);
- }
-
- /**
- * Returns the type of the given attribute.
- */
- public int getAttributeType(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_X_ATTRIBUTE)
- || ln.equals(SVG_Y_ATTRIBUTE)
- || ln.equals(SVG_Z_ATTRIBUTE)) {
- return SVGTypes.TYPE_NUMBER;
- }
- }
- return super.getAttributeType(ns, ln);
+ protected DoublyIndexedTable getTraitInformationTable() {
+ return xmlTraitInformation;
}
// AnimationTarget ///////////////////////////////////////////////////////
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFESpecularLightingElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFESpecularLightingElement.java?view=diff&rev=489226&r1=489225&r2=489226
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFESpecularLightingElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFESpecularLightingElement.java Wed Dec 20 16:05:36 2006
@@ -20,6 +20,7 @@
import org.apache.batik.anim.values.AnimatableValue;
import org.apache.batik.dom.AbstractDocument;
+import org.apache.batik.dom.util.DoublyIndexedTable;
import org.apache.batik.util.SVGTypes;
import org.w3c.dom.Node;
@@ -38,6 +39,44 @@
implements SVGFESpecularLightingElement {
/**
+ * Table mapping XML attribute names to TraitInformation objects.
+ */
+ protected static DoublyIndexedTable xmlTraitInformation;
+ static {
+ DoublyIndexedTable t =
+ new DoublyIndexedTable(SVGOMFilterPrimitiveStandardAttributes.xmlTraitInformation);
+ t.put(null, SVG_IN_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_CDATA));
+ t.put(null, SVG_SURFACE_SCALE_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ t.put(null, SVG_SPECULAR_CONSTANT_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ t.put(null, SVG_SPECULAR_EXPONENT_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ xmlTraitInformation = t;
+ }
+
+ /**
+ * The 'in' attribute value.
+ */
+ protected SVGOMAnimatedString in;
+
+ /**
+ * The 'surfaceScale' attribute value.
+ */
+ protected SVGOMAnimatedNumber surfaceScale;
+
+ /**
+ * The 'specularConstant' attribute value.
+ */
+ protected SVGOMAnimatedNumber specularConstant;
+
+ /**
+ * The 'specularExponent' attribute value.
+ */
+ protected SVGOMAnimatedNumber specularExponent;
+
+ /**
* Creates a new SVGOMFESpecularLightingElement object.
*/
protected SVGOMFESpecularLightingElement() {
@@ -51,6 +90,28 @@
public SVGOMFESpecularLightingElement(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() {
+ in = createLiveAnimatedString(null, SVG_IN_ATTRIBUTE);
+ surfaceScale =
+ createLiveAnimatedNumber(null, SVG_SURFACE_SCALE_ATTRIBUTE, 1f);
+ specularConstant =
+ createLiveAnimatedNumber(null, SVG_SPECULAR_CONSTANT_ATTRIBUTE, 1f);
+ specularExponent =
+ createLiveAnimatedNumber(null, SVG_SPECULAR_EXPONENT_ATTRIBUTE, 1f);
}
/**
@@ -64,7 +125,7 @@
* <b>DOM</b>: Implements {@link SVGFESpecularLightingElement#getIn1()}.
*/
public SVGAnimatedString getIn1() {
- return getAnimatedStringAttribute(null, SVG_IN_ATTRIBUTE);
+ return in;
}
/**
@@ -72,9 +133,7 @@
* SVGFESpecularLightingElement#getSurfaceScale()}.
*/
public SVGAnimatedNumber getSurfaceScale() {
- return getAnimatedNumberAttribute(null,
- SVG_SURFACE_SCALE_ATTRIBUTE,
- 1f);
+ return surfaceScale;
}
/**
@@ -82,9 +141,7 @@
* SVGFESpecularLightingElement#getSpecularConstant()}.
*/
public SVGAnimatedNumber getSpecularConstant() {
- return getAnimatedNumberAttribute(null,
- SVG_SPECULAR_CONSTANT_ATTRIBUTE,
- 1f);
+ return specularConstant;
}
/**
@@ -92,9 +149,7 @@
* SVGFESpecularLightingElement#getSpecularExponent()}.
*/
public SVGAnimatedNumber getSpecularExponent() {
- return getAnimatedNumberAttribute(null,
- SVG_SPECULAR_EXPONENT_ATTRIBUTE,
- 1f);
+ return specularExponent;
}
/**
@@ -104,37 +159,11 @@
return new SVGOMFESpecularLightingElement();
}
- // ExtendedTraitAccess ///////////////////////////////////////////////////
-
/**
- * Returns whether the given XML attribute is animatable.
+ * Returns the table of TraitInformation objects for this element.
*/
- public boolean isAttributeAnimatable(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)
- || ln.equals(SVG_SURFACE_SCALE_ATTRIBUTE)
- || ln.equals(SVG_SPECULAR_CONSTANT_ATTRIBUTE)
- || ln.equals(SVG_SPECULAR_EXPONENT_ATTRIBUTE)) {
- return true;
- }
- }
- return super.isAttributeAnimatable(ns, ln);
- }
-
- /**
- * Returns the type of the given attribute.
- */
- public int getAttributeType(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)) {
- return SVGTypes.TYPE_CDATA;
- } else if (ln.equals(SVG_SURFACE_SCALE_ATTRIBUTE)
- || ln.equals(SVG_SPECULAR_CONSTANT_ATTRIBUTE)
- || ln.equals(SVG_SPECULAR_EXPONENT_ATTRIBUTE)) {
- return SVGTypes.TYPE_NUMBER;
- }
- }
- return super.getAttributeType(ns, ln);
+ protected DoublyIndexedTable getTraitInformationTable() {
+ return xmlTraitInformation;
}
// AnimationTarget ///////////////////////////////////////////////////////
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFESpotLightElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFESpotLightElement.java?view=diff&rev=489226&r1=489225&r2=489226
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFESpotLightElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFESpotLightElement.java Wed Dec 20 16:05:36 2006
@@ -20,6 +20,7 @@
import org.apache.batik.anim.values.AnimatableValue;
import org.apache.batik.dom.AbstractDocument;
+import org.apache.batik.dom.util.DoublyIndexedTable;
import org.apache.batik.util.SVGTypes;
import org.w3c.dom.Node;
@@ -37,6 +38,72 @@
implements SVGFESpotLightElement {
/**
+ * Table mapping XML attribute names to TraitInformation objects.
+ */
+ protected static DoublyIndexedTable xmlTraitInformation;
+ static {
+ DoublyIndexedTable t =
+ new DoublyIndexedTable(SVGOMElement.xmlTraitInformation);
+ t.put(null, SVG_X_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ t.put(null, SVG_Y_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ t.put(null, SVG_Z_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ t.put(null, SVG_POINTS_AT_X_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ t.put(null, SVG_POINTS_AT_Y_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ t.put(null, SVG_POINTS_AT_Z_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ t.put(null, SVG_SPECULAR_EXPONENT_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ t.put(null, SVG_LIMITING_CONE_ANGLE_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_NUMBER));
+ xmlTraitInformation = t;
+ }
+
+ /**
+ * The 'x' attribute value.
+ */
+ protected SVGOMAnimatedNumber x;
+
+ /**
+ * The 'y' attribute value.
+ */
+ protected SVGOMAnimatedNumber y;
+
+ /**
+ * The 'z' attribute value.
+ */
+ protected SVGOMAnimatedNumber z;
+
+ /**
+ * The 'pointsAtX' attribute value.
+ */
+ protected SVGOMAnimatedNumber pointsAtX;
+
+ /**
+ * The 'pointsAtY' attribute value.
+ */
+ protected SVGOMAnimatedNumber pointsAtY;
+
+ /**
+ * The 'pointsAtZ' attribute value.
+ */
+ protected SVGOMAnimatedNumber pointsAtZ;
+
+ /**
+ * The 'specularExponent' attribute value.
+ */
+ protected SVGOMAnimatedNumber specularExponent;
+
+ /**
+ * The 'limitingConeAngle' attribute value.
+ */
+ protected SVGOMAnimatedNumber limitingConeAngle;
+
+ /**
* Creates a new SVGOMFESpotLightElement object.
*/
protected SVGOMFESpotLightElement() {
@@ -50,6 +117,35 @@
public SVGOMFESpotLightElement(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 = createLiveAnimatedNumber(null, SVG_X_ATTRIBUTE, 0f);
+ y = createLiveAnimatedNumber(null, SVG_Y_ATTRIBUTE, 0f);
+ z = createLiveAnimatedNumber(null, SVG_Z_ATTRIBUTE, 0f);
+ pointsAtX =
+ createLiveAnimatedNumber(null, SVG_POINTS_AT_X_ATTRIBUTE, 0f);
+ pointsAtY =
+ createLiveAnimatedNumber(null, SVG_POINTS_AT_Y_ATTRIBUTE, 0f);
+ pointsAtZ =
+ createLiveAnimatedNumber(null, SVG_POINTS_AT_Z_ATTRIBUTE, 0f);
+ specularExponent =
+ createLiveAnimatedNumber(null, SVG_SPECULAR_EXPONENT_ATTRIBUTE, 1f);
+ limitingConeAngle =
+ createLiveAnimatedNumber
+ (null, SVG_LIMITING_CONE_ANGLE_ATTRIBUTE, 0f);
}
/**
@@ -63,42 +159,42 @@
* <b>DOM</b>: Implements {@link SVGFESpotLightElement#getX()}.
*/
public SVGAnimatedNumber getX() {
- return getAnimatedNumberAttribute(null, SVG_X_ATTRIBUTE, 0f);
+ return x;
}
/**
* <b>DOM</b>: Implements {@link SVGFESpotLightElement#getY()}.
*/
public SVGAnimatedNumber getY() {
- return getAnimatedNumberAttribute(null, SVG_Y_ATTRIBUTE, 0f);
+ return y;
}
/**
* <b>DOM</b>: Implements {@link SVGFESpotLightElement#getZ()}.
*/
public SVGAnimatedNumber getZ() {
- return getAnimatedNumberAttribute(null, SVG_Z_ATTRIBUTE, 0f);
+ return z;
}
/**
* <b>DOM</b>: Implements {@link SVGFESpotLightElement#getPointsAtX()}.
*/
public SVGAnimatedNumber getPointsAtX() {
- return getAnimatedNumberAttribute(null, SVG_POINTS_AT_X_ATTRIBUTE, 0f);
+ return pointsAtX;
}
/**
* <b>DOM</b>: Implements {@link SVGFESpotLightElement#getPointsAtY()}.
*/
public SVGAnimatedNumber getPointsAtY() {
- return getAnimatedNumberAttribute(null, SVG_POINTS_AT_Y_ATTRIBUTE, 0f);
+ return pointsAtY;
}
/**
* <b>DOM</b>: Implements {@link SVGFESpotLightElement#getPointsAtZ()}.
*/
public SVGAnimatedNumber getPointsAtZ() {
- return getAnimatedNumberAttribute(null, SVG_POINTS_AT_Z_ATTRIBUTE, 0f);
+ return pointsAtZ;
}
/**
@@ -106,8 +202,7 @@
* SVGFESpotLightElement#getSpecularExponent()}.
*/
public SVGAnimatedNumber getSpecularExponent() {
- return getAnimatedNumberAttribute
- (null, SVG_SPECULAR_EXPONENT_ATTRIBUTE, 1f);
+ return specularExponent;
}
/**
@@ -115,8 +210,7 @@
* SVGFESpotLightElement#getLimitingConeAngle()}.
*/
public SVGAnimatedNumber getLimitingConeAngle() {
- return getAnimatedNumberAttribute
- (null, SVG_LIMITING_CONE_ANGLE_ATTRIBUTE, 0f);
+ return limitingConeAngle;
}
/**
@@ -126,44 +220,11 @@
return new SVGOMFESpotLightElement();
}
- // ExtendedTraitAccess ///////////////////////////////////////////////////
-
/**
- * Returns whether the given XML attribute is animatable.
+ * Returns the table of TraitInformation objects for this element.
*/
- public boolean isAttributeAnimatable(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_X_ATTRIBUTE)
- || ln.equals(SVG_Y_ATTRIBUTE)
- || ln.equals(SVG_Z_ATTRIBUTE)
- || ln.equals(SVG_POINTS_AT_X_ATTRIBUTE)
- || ln.equals(SVG_POINTS_AT_Y_ATTRIBUTE)
- || ln.equals(SVG_POINTS_AT_Z_ATTRIBUTE)
- || ln.equals(SVG_SPECULAR_EXPONENT_ATTRIBUTE)
- || ln.equals(SVG_LIMITING_CONE_ANGLE_ATTRIBUTE)) {
- return true;
- }
- }
- return super.isAttributeAnimatable(ns, ln);
- }
-
- /**
- * Returns the type of the given attribute.
- */
- public int getAttributeType(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_X_ATTRIBUTE)
- || ln.equals(SVG_Y_ATTRIBUTE)
- || ln.equals(SVG_Z_ATTRIBUTE)
- || ln.equals(SVG_POINTS_AT_X_ATTRIBUTE)
- || ln.equals(SVG_POINTS_AT_Y_ATTRIBUTE)
- || ln.equals(SVG_POINTS_AT_Z_ATTRIBUTE)
- || ln.equals(SVG_SPECULAR_EXPONENT_ATTRIBUTE)
- || ln.equals(SVG_LIMITING_CONE_ANGLE_ATTRIBUTE)) {
- return SVGTypes.TYPE_NUMBER;
- }
- }
- return super.getAttributeType(ns, ln);
+ protected DoublyIndexedTable getTraitInformationTable() {
+ return xmlTraitInformation;
}
// AnimationTarget ///////////////////////////////////////////////////////
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFETileElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFETileElement.java?view=diff&rev=489226&r1=489225&r2=489226
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFETileElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFETileElement.java Wed Dec 20 16:05:36 2006
@@ -19,6 +19,7 @@
package org.apache.batik.dom.svg;
import org.apache.batik.dom.AbstractDocument;
+import org.apache.batik.dom.util.DoublyIndexedTable;
import org.apache.batik.anim.values.AnimatableValue;
import org.apache.batik.util.SVGTypes;
@@ -37,6 +38,23 @@
implements SVGFETileElement {
/**
+ * Table mapping XML attribute names to TraitInformation objects.
+ */
+ protected static DoublyIndexedTable xmlTraitInformation;
+ static {
+ DoublyIndexedTable t =
+ new DoublyIndexedTable(SVGOMFilterPrimitiveStandardAttributes.xmlTraitInformation);
+ t.put(null, SVG_IN_ATTRIBUTE,
+ new TraitInformation(true, SVGTypes.TYPE_CDATA));
+ xmlTraitInformation = t;
+ }
+
+ /**
+ * The 'in' attribute value.
+ */
+ protected SVGOMAnimatedString in;
+
+ /**
* Creates a new SVGOMFETileElement object.
*/
protected SVGOMFETileElement() {
@@ -49,6 +67,22 @@
*/
public SVGOMFETileElement(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() {
+ in = createLiveAnimatedString(null, SVG_IN_ATTRIBUTE);
}
/**
@@ -62,7 +96,7 @@
* <b>DOM</b>: Implements {@link SVGFETileElement#getIn1()}.
*/
public SVGAnimatedString getIn1() {
- return getAnimatedStringAttribute(null, SVG_IN_ATTRIBUTE);
+ return in;
}
/**
@@ -72,30 +106,11 @@
return new SVGOMFETileElement();
}
- // ExtendedTraitAccess ///////////////////////////////////////////////////
-
- /**
- * Returns whether the given XML attribute is animatable.
- */
- public boolean isAttributeAnimatable(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)) {
- return true;
- }
- }
- return super.isAttributeAnimatable(ns, ln);
- }
-
/**
- * Returns the type of the given attribute.
+ * Returns the table of TraitInformation objects for this element.
*/
- public int getAttributeType(String ns, String ln) {
- if (ns == null) {
- if (ln.equals(SVG_IN_ATTRIBUTE)) {
- return SVGTypes.TYPE_CDATA;
- }
- }
- return super.getAttributeType(ns, ln);
+ protected DoublyIndexedTable getTraitInformationTable() {
+ return xmlTraitInformation;
}
// AnimationTarget ///////////////////////////////////////////////////////