FileDocCategorySizeDatePackage
Animate.javaAPI DocphoneME MR2 API (J2ME)6003Wed May 02 18:00:36 BST 2007com.sun.perseus.model

Animate

public class Animate extends AbstractAnimate
Animate represents an SVG Tiny <animate> element.
version
$Id: Animate.java,v 1.4 2006/06/29 10:47:29 ln156897 Exp $

Fields Summary
static final String[]
REQUIRED_TRAITS
Required Animate traits
String
traitQName
The trait's qualified name.
Constructors Summary
public Animate(DocumentNode ownerDocument)
Builds a new Animate element that belongs to the given document. This Animate will belong to the DocumentNode's time container.

param
ownerDocument the document this node belongs to.
throws
IllegalArgumentException if the input ownerDocument is null


                                              
        
        super(ownerDocument, SVGConstants.SVG_ANIMATE_TAG);
    
public Animate(DocumentNode ownerDocument, String localName)
Builds a new Animate element that belongs to the given document. This Animate will belong to the DocumentNode's time container.

param
ownerDocument the document this node belongs to.
param
localName the animation element's local name.
throws
IllegalArgumentException if the input ownerDocument is null

        super(ownerDocument, localName);
    
Methods Summary
public java.lang.String[]getRequiredTraits()

return
an array of traits that are required by this element.

        return REQUIRED_TRAITS;
    
public java.lang.StringgetTraitImpl(java.lang.String name)

        if (SVGConstants.SVG_ATTRIBUTE_NAME_ATTRIBUTE == name) {
            return traitQName;
        } else {
            return super.getTraitImpl(name);
        }
    
public ElementNodenewInstance(DocumentNode doc)
Used by DocumentNode to create a new instance from a prototype TimedElementNode.

param
doc the DocumentNode for which a new node is should be created.
return
a new TimedElementNode for the requested document.

        return new Animate(doc, getLocalName());
    
public voidsetTraitImpl(java.lang.String name, java.lang.String value)
Animate supports the to, from, by, values, keyTimes, keySplines, and attributeName traits.

param
name the trait's name.
param
value the trait's value.
throws
DOMException with error code NOT_SUPPORTED_ERR if the requested trait is not supported on this element or null.
throws
DOMException with error code TYPE_MISMATCH_ERR if the requested trait's value cannot be specified as a String
throws
DOMException with error code INVALID_ACCESS_ERR if the input value is an invalid value for the given trait or null.
throws
DOMException with error code NO_MODIFICATION_ALLOWED_ERR: if attempt is made to change readonly trait.

        if (SVGConstants.SVG_ATTRIBUTE_NAME_ATTRIBUTE == name) {
            checkWriteLoading(name);

            if (value == null) {
                throw illegalTraitValue(name, value);
            }

            // Now, if this is a QName, we need to use the namespace prefix map.
            int i = value.indexOf(':");
            if (i == -1) {
                this.traitName = value.intern();
                this.traitQName = value.intern();
            } else {
                if (i == value.length() - 1) {
                    // ':' is the last character, this is invalid.
                    throw illegalTraitValue(name, value);
                }

                String prefix = value.substring(0, i);
                String tName = value.substring(i+1);

                String ns = ownerDocument.toNamespace(prefix, this);
                if (ns == null) {
                    throw illegalTraitValue(name, value);
                }

                traitName = tName.intern();
                traitNamespace = ns.intern();
                traitQName = value;
            }
        } else {
            super.setTraitImpl(name, value);
        }
    
booleansupportsTrait(java.lang.String traitName)

param
traitName the name of the trait which the element may support.
return
true if this element supports the given trait in one of the trait accessor methods.

        if (SVGConstants.SVG_ATTRIBUTE_NAME_ATTRIBUTE == traitName) {
            return true;
        } else {
            return super.supportsTrait(traitName);
        }