Source Code Cross Referenced for Stroke.java in  » Ajax » dwr » jsx3 » vector » 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 » dwr » jsx3.vector 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2005 Joe Walker
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *     http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        package jsx3.vector;
017:
018:        import org.directwebremoting.ScriptBuffer;
019:        import org.directwebremoting.proxy.ScriptProxy;
020:        import org.directwebremoting.proxy.io.Context;
021:
022:        /**
023:         * Represents a vector line style.
024:         * @author Joe Walker [joe at getahead dot org]
025:         * @author DRAPGEN - Dwr Reverse Ajax Proxy GENerator
026:         */
027:        public class Stroke extends jsx3.html.Tag {
028:            /**
029:             * All reverse ajax proxies need context to work from
030:             * @param scriptProxy The place we are writing scripts to
031:             * @param context The script that got us to where we are now
032:             */
033:            public Stroke(Context context, String extension,
034:                    ScriptProxy scriptProxy) {
035:                super (context, extension, scriptProxy);
036:            }
037:
038:            /**
039:             * The instance initializer.
040:             * @param color the color value, as a hex String or 24-bit integer value, defaults to 0x000000
041:             * @param width the width of the stroke, in pixels, defaults to 1
042:             * @param alpha the opacity value, valid values are between 0 and 1, defaults to 1
043:             */
044:            public Stroke(String color, int width, float alpha) {
045:                super ((Context) null, (String) null, (ScriptProxy) null);
046:                ScriptBuffer script = new ScriptBuffer();
047:                script.appendCall("new Stroke", color, width, alpha);
048:                setInitScript(script);
049:            }
050:
051:            /**
052:             * The instance initializer.
053:             * @param color the color value, as a hex String or 24-bit integer value, defaults to 0x000000
054:             * @param width the width of the stroke, in pixels, defaults to 1
055:             * @param alpha the opacity value, valid values are between 0 and 1, defaults to 1
056:             */
057:            public Stroke(int color, int width, float alpha) {
058:                super ((Context) null, (String) null, (ScriptProxy) null);
059:                ScriptBuffer script = new ScriptBuffer();
060:                script.appendCall("new Stroke", color, width, alpha);
061:                setInitScript(script);
062:            }
063:
064:            /**
065:             * Returns the color field.
066:             * @param callback color
067:             */
068:            @SuppressWarnings("unchecked")
069:            public void getColor(
070:                    org.directwebremoting.proxy.Callback<Integer> callback) {
071:                ScriptBuffer script = new ScriptBuffer();
072:                String callbackPrefix = "";
073:
074:                if (callback != null) {
075:                    callbackPrefix = "var reply = ";
076:                }
077:
078:                script.appendCall(callbackPrefix + getContextPath()
079:                        + "getColor");
080:
081:                if (callback != null) {
082:                    String key = org.directwebremoting.extend.CallbackHelper
083:                            .saveCallback(callback, Integer.class);
084:                    script
085:                            .appendCall("__System.activateCallback", key,
086:                                    "reply");
087:                }
088:
089:                getScriptProxy().addScript(script);
090:            }
091:
092:            /**
093:             * Returns the color field, as a CSS hex string.
094:             */
095:            @SuppressWarnings("unchecked")
096:            public void getColorHtml(
097:                    org.directwebremoting.proxy.Callback<String> callback) {
098:                ScriptBuffer script = new ScriptBuffer();
099:                String callbackPrefix = "";
100:
101:                if (callback != null) {
102:                    callbackPrefix = "var reply = ";
103:                }
104:
105:                script.appendCall(callbackPrefix + getContextPath()
106:                        + "getColorHtml");
107:
108:                if (callback != null) {
109:                    String key = org.directwebremoting.extend.CallbackHelper
110:                            .saveCallback(callback, String.class);
111:                    script
112:                            .appendCall("__System.activateCallback", key,
113:                                    "reply");
114:                }
115:
116:                getScriptProxy().addScript(script);
117:            }
118:
119:            /**
120:             * Sets the color field.
121:             * @param color the new value for color
122:             */
123:            public void setColor(String color) {
124:                ScriptBuffer script = new ScriptBuffer();
125:                script.appendCall(getContextPath() + "setColor", color);
126:                getScriptProxy().addScript(script);
127:            }
128:
129:            /**
130:             * Sets the color field.
131:             * @param color the new value for color
132:             */
133:            public void setColor(int color) {
134:                ScriptBuffer script = new ScriptBuffer();
135:                script.appendCall(getContextPath() + "setColor", color);
136:                getScriptProxy().addScript(script);
137:            }
138:
139:            /**
140:             * Returns the width field.
141:             * @param callback width
142:             */
143:            @SuppressWarnings("unchecked")
144:            public void getWidth(
145:                    org.directwebremoting.proxy.Callback<Integer> callback) {
146:                ScriptBuffer script = new ScriptBuffer();
147:                String callbackPrefix = "";
148:
149:                if (callback != null) {
150:                    callbackPrefix = "var reply = ";
151:                }
152:
153:                script.appendCall(callbackPrefix + getContextPath()
154:                        + "getWidth");
155:
156:                if (callback != null) {
157:                    String key = org.directwebremoting.extend.CallbackHelper
158:                            .saveCallback(callback, Integer.class);
159:                    script
160:                            .appendCall("__System.activateCallback", key,
161:                                    "reply");
162:                }
163:
164:                getScriptProxy().addScript(script);
165:            }
166:
167:            /**
168:             * Sets the width field.
169:             * @param width the new value for width
170:             */
171:            public void setWidth(int width) {
172:                ScriptBuffer script = new ScriptBuffer();
173:                script.appendCall(getContextPath() + "setWidth", width);
174:                getScriptProxy().addScript(script);
175:            }
176:
177:            /**
178:             * Returns the alpha field.
179:             * @param callback alpha
180:             */
181:            @SuppressWarnings("unchecked")
182:            public void getAlpha(
183:                    org.directwebremoting.proxy.Callback<Float> callback) {
184:                ScriptBuffer script = new ScriptBuffer();
185:                String callbackPrefix = "";
186:
187:                if (callback != null) {
188:                    callbackPrefix = "var reply = ";
189:                }
190:
191:                script.appendCall(callbackPrefix + getContextPath()
192:                        + "getAlpha");
193:
194:                if (callback != null) {
195:                    String key = org.directwebremoting.extend.CallbackHelper
196:                            .saveCallback(callback, Float.class);
197:                    script
198:                            .appendCall("__System.activateCallback", key,
199:                                    "reply");
200:                }
201:
202:                getScriptProxy().addScript(script);
203:            }
204:
205:            /**
206:             * Sets the alpha field.
207:             * @param alpha the new value for alpha
208:             */
209:            public void setAlpha(float alpha) {
210:                ScriptBuffer script = new ScriptBuffer();
211:                script.appendCall(getContextPath() + "setAlpha", alpha);
212:                getScriptProxy().addScript(script);
213:            }
214:
215:            /**
216:             * parses a VectorStroke from a string representation, that format is "color width alpha"
217:             * @param v the string representation
218:             * @param callback null if v is empty, v if v is already a VectorStroke, or otherwise a new VectorStroke created by parsing the string according to the format specified above
219:             */
220:            @SuppressWarnings("unchecked")
221:            public void valueOf(String v,
222:                    org.directwebremoting.proxy.Callback<String> callback) {
223:                ScriptBuffer script = new ScriptBuffer();
224:                String callbackPrefix = "";
225:
226:                if (callback != null) {
227:                    callbackPrefix = "var reply = ";
228:                }
229:
230:                script.appendCall(
231:                        callbackPrefix + getContextPath() + "valueOf", v);
232:
233:                if (callback != null) {
234:                    String key = org.directwebremoting.extend.CallbackHelper
235:                            .saveCallback(callback, String.class);
236:                    script
237:                            .appendCall("__System.activateCallback", key,
238:                                    "reply");
239:                }
240:
241:                getScriptProxy().addScript(script);
242:            }
243:
244:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.