Source Code Cross Referenced for FXStyle.java in  » Ajax » MyGWT » net » mygwt » ui » client » fx » 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 » Ajax » MyGWT » net.mygwt.ui.client.fx 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 2006-2007 Valerio Proietti
003:         *
004:         * Permission is hereby granted, free of charge, to any person obtaining a copy
005:         * of this software and associated documentation files (the "Software"), to deal
006:         * in the Software without restriction, including without limitation the rights
007:         * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008:         * copies of the Software, and to permit persons to whom the Software is
009:         * furnished to do so, subject to the following conditions:
010:         *
011:         * The above copyright notice and this permission notice shall be included in
012:         * all copies or substantial portions of the Software.
013:         *
014:         * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015:         * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016:         * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017:         * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018:         * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019:         * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
020:         * THE SOFTWARE.
021:         * 
022:         * Contributors:
023:         *     Valerio Proietti - initial API and implementation
024:         *     MyGWT - derived implementation
025:         */
026:        package net.mygwt.ui.client.fx;
027:
028:        import net.mygwt.ui.client.MyDOM;
029:        import net.mygwt.ui.client.util.Rectangle;
030:
031:        import com.google.gwt.user.client.Element;
032:
033:        /**
034:         * Effect for changing a single css style property for a given element.
035:         * 
036:         * <p>
037:         * This code is based on code from the MooTools Project by Valerio Proietti.
038:         * </p>
039:         * 
040:         * <dl>
041:         * <dt><b>Events:</b></dt>
042:         * 
043:         * <dd><b>EffectStart</b> : (source)<br>
044:         * <div>Fires after a effect is started.</div>
045:         * <ul>
046:         * <li>source : this</li>
047:         * </ul>
048:         * </dd>
049:         * 
050:         * <dd><b>EffecCancel</b> : (source)<br>
051:         * <div>Fires after an effect has been cancelled.</div>
052:         * <ul>
053:         * <li>source : this</li>
054:         * </ul>
055:         * </dd>
056:         * 
057:         * <dd><b>EffecComplete</b> : (source)<br>
058:         * <div>Fires after an effect has been completed.</div>
059:         * <ul>
060:         * <li>source : this</li>
061:         * </ul>
062:         * </dd>
063:         * </dl>
064:         * <dl>
065:         */
066:        public class FXStyle extends FX {
067:
068:            protected String style;
069:            protected Element elem;
070:
071:            /**
072:             * Creates a new instance.
073:             * 
074:             * @param element the animation element
075:             */
076:            public FXStyle(Element element) {
077:                this .elem = element;
078:            }
079:
080:            /**
081:             * Blinks the element.
082:             */
083:            public void blink() {
084:                if (running)
085:                    return;
086:                fps = 20;
087:                start(new Effect.Blink(elem));
088:            }
089:
090:            /**
091:             * Fades the element in.
092:             */
093:            public void fadeIn() {
094:                if (running)
095:                    return;
096:                Effect e = new Effect.FadeIn(elem);
097:                start(e);
098:            }
099:
100:            /**
101:             * Changes the size of the element.
102:             * 
103:             * @param width the new width
104:             * @param height the new height
105:             */
106:            public void size(int width, int height) {
107:                if (running)
108:                    return;
109:                Effect we = new Effect(elem, "width", MyDOM.getWidth(elem),
110:                        width);
111:                Effect he = new Effect(elem, "height", MyDOM.getHeight(elem),
112:                        height);
113:                start(new Effect[] { we, he });
114:            }
115:
116:            /**
117:             * Fades out the element.
118:             */
119:            public void fadeOut() {
120:                if (running)
121:                    return;
122:                Effect e = new Effect.FadeOut(elem);
123:                start(e);
124:            }
125:
126:            /**
127:             * Fades the element in or out.
128:             */
129:            public void fadeToggle() {
130:                if (running)
131:                    return;
132:                if (MyDOM.isVisibility(elem)) {
133:                    fadeOut();
134:                } else {
135:                    fadeIn();
136:                }
137:            }
138:
139:            /**
140:             * Moves a element to a new location.
141:             * 
142:             * @param x the end x coordinate
143:             * @param y the end y coordinate
144:             */
145:            public void move(int x, int y) {
146:                if (running)
147:                    return;
148:                Rectangle r = MyDOM.getBounds(elem, false);
149:                Effect xe = new Effect(elem, "x", r.x, x);
150:                Effect ye = new Effect(elem, "y", r.y, y);
151:                start(new Effect[] { xe, ye });
152:            }
153:
154:            /**
155:             * Moves and sizes the element.
156:             * 
157:             * @param x the new x coordinate
158:             * @param y the new y coordinate
159:             * @param width the new width
160:             * @param height the new height
161:             */
162:            public void zoom(int x, int y, int width, int height) {
163:                if (running)
164:                    return;
165:                Effect xe = new Effect(elem, "left", MyDOM.getX(elem), x);
166:                Effect ye = new Effect(elem, "top", MyDOM.getY(elem), y);
167:                Effect we = new Effect(elem, "width", MyDOM.getWidth(elem),
168:                        width);
169:                Effect he = new Effect(elem, "height", MyDOM.getHeight(elem),
170:                        height);
171:                start(new Effect[] { xe, ye, we, he });
172:            }
173:
174:            /**
175:             * Slides the element in.
176:             * 
177:             * @param dir the direction
178:             */
179:            public void slideIn(int dir) {
180:                if (running)
181:                    return;
182:                start(new Effect.SlideIn(dir, elem));
183:            }
184:
185:            /**
186:             * Slides the element out.
187:             * 
188:             * @param dir the direction
189:             */
190:            public void slideOut(int dir) {
191:                if (running)
192:                    return;
193:                start(new Effect.SlideOut(dir, elem));
194:            }
195:
196:            /**
197:             * Creates and starts a new effect.
198:             * 
199:             * @param style the css style being modified
200:             * @param from the start value
201:             * @param to the end value
202:             */
203:            public void start(String style, double from, double to) {
204:                Effect e = new Effect(elem, style, from, to);
205:                start(e);
206:            }
207:
208:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.