Source Code Cross Referenced for AnimateTransform.java in  » 6.0-JDK-Modules » j2me » com » sun » perseus » model » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » com.sun.perseus.model 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *
003:         *
004:         * Copyright  1990-2007 Sun Microsystems, Inc. All Rights Reserved.
005:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006:         * 
007:         * This program is free software; you can redistribute it and/or
008:         * modify it under the terms of the GNU General Public License version
009:         * 2 only, as published by the Free Software Foundation.
010:         * 
011:         * This program is distributed in the hope that it will be useful, but
012:         * WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014:         * General Public License version 2 for more details (a copy is
015:         * included at /legal/license.txt).
016:         * 
017:         * You should have received a copy of the GNU General Public License
018:         * version 2 along with this work; if not, write to the Free Software
019:         * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020:         * 02110-1301 USA
021:         * 
022:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023:         * Clara, CA 95054 or visit www.sun.com if you need additional
024:         * information or have any questions.
025:         */
026:
027:        package com.sun.perseus.model;
028:
029:        import com.sun.perseus.util.SVGConstants;
030:
031:        import org.w3c.dom.DOMException;
032:
033:        import java.util.Vector;
034:
035:        /**
036:         * <code>Animate</code> represents an SVG Tiny 
037:         * <code>&lt;animateTransform&gt;</code> element.
038:         *
039:         * @version $Id: AnimateTransform.java,v 1.5 2006/06/29 10:47:29 ln156897 Exp $
040:         */
041:        public final class AnimateTransform extends Animate {
042:
043:            /**
044:             * translate | scale | rotate | skewX | skewY
045:             * Animation on the transform's translate components
046:             */
047:            public static final int TYPE_TRANSLATE = 2;
048:
049:            /**
050:             * Animation on the transform's scale components
051:             */
052:            public static final int TYPE_SCALE = 3;
053:
054:            /**
055:             * Animation on the transform's rotation.
056:             */
057:            public static final int TYPE_ROTATE = 4;
058:
059:            /**
060:             * Animation on the transform's skew x component
061:             */
062:            public static final int TYPE_SKEW_X = 5;
063:
064:            /**
065:             * Animation on the transform's skew y component.
066:             */
067:            public static final int TYPE_SKEW_Y = 6;
068:
069:            /**
070:             * Builds a new Animate element that belongs to the given
071:             * document. This <code>Animate</code> will belong 
072:             * to the <code>DocumentNode</code>'s time container.
073:             *
074:             * @param ownerDocument the document this node belongs to.
075:             * @throws IllegalArgumentException if the input ownerDocument is null
076:             */
077:            public AnimateTransform(final DocumentNode ownerDocument) {
078:                super (ownerDocument, SVGConstants.SVG_ANIMATE_TRANSFORM_TAG);
079:                type = TYPE_TRANSLATE;
080:            }
081:
082:            /**
083:             * Used by <code>DocumentNode</code> to create a new instance from
084:             * a prototype <code>TimedElementNode</code>.
085:             *
086:             * @param doc the <code>DocumentNode</code> for which a new node is
087:             *        should be created.
088:             * @return a new <code>TimedElementNode</code> for the requested document.
089:             */
090:            public ElementNode newInstance(final DocumentNode doc) {
091:                return new AnimateTransform(doc);
092:            }
093:
094:            /**
095:             * Supported traits: to, attributeName
096:             *
097:             * @param traitName the name of the trait which the element may support.
098:             * @return true if this element supports the given trait in one of the
099:             *         trait accessor methods.
100:             */
101:            boolean supportsTrait(final String traitName) {
102:                if (SVGConstants.SVG_TYPE_ATTRIBUTE == traitName) {
103:                    return true;
104:                } else {
105:                    return super .supportsTrait(traitName);
106:                }
107:            }
108:
109:            /**
110:             * AnimateTransform supports the type trait.
111:             *
112:             * Returns the trait value as String. In SVG Tiny only certain traits can be
113:             * obtained as a String value. Syntax of the returned String matches the
114:             * syntax of the corresponding attribute. This element is exactly equivalent
115:             * to {@link org.w3c.dom.svg.SVGElement#getTraitNS getTraitNS} with
116:             * namespaceURI set to null.
117:             *
118:             * The method is meant to be overridden by derived classes. The 
119:             * implementation pattern is that derived classes will override the method 
120:             * and call their super class' implementation. If the ElementNode 
121:             * implementation is called, it means that the trait is either not supported
122:             * or that it cannot be seen as a String.
123:             *
124:             * @param name the requested trait name.
125:             * @return the trait value.
126:             *
127:             * @throws DOMException with error code NOT_SUPPORTED_ERROR if the requested
128:             * trait is not supported on this element or null.
129:             * @throws DOMException with error code TYPE_MISMATCH_ERR if requested
130:             * trait's computed value cannot be converted to a String (SVG Tiny only).
131:             */
132:            public String getTraitImpl(final String name) throws DOMException {
133:                if (SVGConstants.SVG_TYPE_ATTRIBUTE == name) {
134:                    switch (type) {
135:                    case TYPE_TRANSLATE:
136:                        return SVGConstants.SVG_TRANSLATE_VALUE;
137:                    case TYPE_SCALE:
138:                        return SVGConstants.SVG_SCALE_VALUE;
139:                    case TYPE_ROTATE:
140:                        return SVGConstants.SVG_ROTATE_VALUE;
141:                    case TYPE_SKEW_X:
142:                        return SVGConstants.SVG_SKEW_X;
143:                    case TYPE_SKEW_Y:
144:                    default:
145:                        return SVGConstants.SVG_SKEW_Y;
146:                    }
147:                } else {
148:                    return super .getTraitImpl(name);
149:                }
150:            }
151:
152:            /**
153:             * AnimateTransform supports the type trait.
154:             *
155:             * @param name the trait's name.
156:             * @param value the trait's value.
157:             *
158:             * @throws DOMException with error code NOT_SUPPORTED_ERR if the requested
159:             * trait is not supported on this element or null.
160:             * @throws DOMException with error code TYPE_MISMATCH_ERR if the requested
161:             * trait's value cannot be specified as a String
162:             * @throws DOMException with error code INVALID_ACCESS_ERR if the input
163:             * value is an invalid value for the given trait or null.
164:             * @throws DOMException with error code NO_MODIFICATION_ALLOWED_ERR: if
165:             * attempt is made to change readonly trait.
166:             */
167:            public void setTraitImpl(final String name, final String value)
168:                    throws DOMException {
169:                if (SVGConstants.SVG_TYPE_ATTRIBUTE == name) {
170:                    checkWriteLoading(name);
171:                    if (SVGConstants.SVG_TRANSLATE_VALUE.equals(value)) {
172:                        type = TYPE_TRANSLATE;
173:                    } else if (SVGConstants.SVG_SCALE_VALUE.equals(value)) {
174:                        type = TYPE_SCALE;
175:                    } else if (SVGConstants.SVG_ROTATE_VALUE.equals(value)) {
176:                        type = TYPE_ROTATE;
177:                    } else if (SVGConstants.SVG_SKEW_X.equals(value)) {
178:                        type = TYPE_SKEW_X;
179:                    } else if (SVGConstants.SVG_SKEW_Y.equals(value)) {
180:                        type = TYPE_SKEW_Y;
181:                    } else {
182:                        throw illegalTraitValue(name, value);
183:                    }
184:                } else {
185:                    super.setTraitImpl(name, value);
186:                }
187:            }
188:
189:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.