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

AnimateTransform

public final class AnimateTransform extends Animate
Animate represents an SVG Tiny <animateTransform> element.
version
$Id: AnimateTransform.java,v 1.5 2006/06/29 10:47:29 ln156897 Exp $

Fields Summary
public static final int
TYPE_TRANSLATE
translate | scale | rotate | skewX | skewY Animation on the transform's translate components
public static final int
TYPE_SCALE
Animation on the transform's scale components
public static final int
TYPE_ROTATE
Animation on the transform's rotation.
public static final int
TYPE_SKEW_X
Animation on the transform's skew x component
public static final int
TYPE_SKEW_Y
Animation on the transform's skew y component.
Constructors Summary
public AnimateTransform(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_TRANSFORM_TAG);
        type = TYPE_TRANSLATE;
    
Methods Summary
public java.lang.StringgetTraitImpl(java.lang.String name)
AnimateTransform supports the type trait. Returns the trait value as String. In SVG Tiny only certain traits can be obtained as a String value. Syntax of the returned String matches the syntax of the corresponding attribute. This element is exactly equivalent to {@link org.w3c.dom.svg.SVGElement#getTraitNS getTraitNS} with namespaceURI set to null. The method is meant to be overridden by derived classes. The implementation pattern is that derived classes will override the method and call their super class' implementation. If the ElementNode implementation is called, it means that the trait is either not supported or that it cannot be seen as a String.

param
name the requested trait name.
return
the trait value.
throws
DOMException with error code NOT_SUPPORTED_ERROR if the requested trait is not supported on this element or null.
throws
DOMException with error code TYPE_MISMATCH_ERR if requested trait's computed value cannot be converted to a String (SVG Tiny only).

        if (SVGConstants.SVG_TYPE_ATTRIBUTE == name) {
            switch (type) {
            case TYPE_TRANSLATE:
                return SVGConstants.SVG_TRANSLATE_VALUE;
            case TYPE_SCALE:
                return SVGConstants.SVG_SCALE_VALUE;
            case TYPE_ROTATE:
                return SVGConstants.SVG_ROTATE_VALUE;
            case TYPE_SKEW_X:
                return SVGConstants.SVG_SKEW_X;
            case TYPE_SKEW_Y:
            default:
                return SVGConstants.SVG_SKEW_Y;
            }
        } 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 AnimateTransform(doc);
    
public voidsetTraitImpl(java.lang.String name, java.lang.String value)
AnimateTransform supports the type trait.

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_TYPE_ATTRIBUTE == name) {
            checkWriteLoading(name);
            if (SVGConstants.SVG_TRANSLATE_VALUE.equals(value)) {
                type = TYPE_TRANSLATE;
            } else if (SVGConstants.SVG_SCALE_VALUE.equals(value)) {
                type = TYPE_SCALE;
            } else if (SVGConstants.SVG_ROTATE_VALUE.equals(value)) {
                type = TYPE_ROTATE;
            } else if (SVGConstants.SVG_SKEW_X.equals(value)) {
                type = TYPE_SKEW_X;
            } else if (SVGConstants.SVG_SKEW_Y.equals(value)) {
                type = TYPE_SKEW_Y;
            } else {
                throw illegalTraitValue(name, value);
            }
        } else {
            super.setTraitImpl(name, value);
        }
    
booleansupportsTrait(java.lang.String traitName)
Supported traits: to, attributeName

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_TYPE_ATTRIBUTE == traitName) {
            return true;
        } else {
            return super.supportsTrait(traitName);
        }