Source Code Cross Referenced for Line.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:         * Paints a vector line defined by two end points.
024:         * @author Joe Walker [joe at getahead dot org]
025:         * @author DRAPGEN - Dwr Reverse Ajax Proxy GENerator
026:         */
027:        public class Line extends jsx3.vector.Shape {
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 Line(Context context, String extension,
034:                    ScriptProxy scriptProxy) {
035:                super (context, extension, scriptProxy);
036:            }
037:
038:            /**
039:             * The instance initializer.
040:             * @param left left position (in pixels) of the object relative to its parent container
041:             * @param top top position (in pixels) of the object relative to its parent container
042:             * @param x1 the x coordinate of the starting point
043:             * @param y1 the y coordinate of the starting point
044:             * @param x2 the x coordinate of the ending point
045:             * @param y2 the y coordinate of the ending point
046:             */
047:            public Line(int left, int top, int x1, int y1, int x2, int y2) {
048:                super ((Context) null, (String) null, (ScriptProxy) null);
049:                ScriptBuffer script = new ScriptBuffer();
050:                script.appendCall("new Line", left, top, x1, y1, x2, y2);
051:                setInitScript(script);
052:            }
053:
054:            /**
055:             * Sets all the coordinates at once.
056:             * @param x1 the x coordinate of the starting point
057:             * @param y1 the y coordinate of the starting point
058:             * @param x2 the x coordinate of the ending point
059:             * @param y2 the y coordinate of the ending point
060:             */
061:            public void setPoints(int x1, int y1, int x2, int y2) {
062:                ScriptBuffer script = new ScriptBuffer();
063:                script.appendCall(getContextPath() + "setPoints", x1, y1, x2,
064:                        y2);
065:                getScriptProxy().addScript(script);
066:            }
067:
068:            /**
069:             * Returns the x1 field.
070:             * @param callback x1
071:             */
072:            @SuppressWarnings("unchecked")
073:            public void getX1(
074:                    org.directwebremoting.proxy.Callback<Integer> callback) {
075:                ScriptBuffer script = new ScriptBuffer();
076:                String callbackPrefix = "";
077:
078:                if (callback != null) {
079:                    callbackPrefix = "var reply = ";
080:                }
081:
082:                script.appendCall(callbackPrefix + getContextPath() + "getX1");
083:
084:                if (callback != null) {
085:                    String key = org.directwebremoting.extend.CallbackHelper
086:                            .saveCallback(callback, Integer.class);
087:                    script
088:                            .appendCall("__System.activateCallback", key,
089:                                    "reply");
090:                }
091:
092:                getScriptProxy().addScript(script);
093:            }
094:
095:            /**
096:             * Sets the x1 field.
097:             * @param x1 the new value for x1
098:             */
099:            public void setX1(int x1) {
100:                ScriptBuffer script = new ScriptBuffer();
101:                script.appendCall(getContextPath() + "setX1", x1);
102:                getScriptProxy().addScript(script);
103:            }
104:
105:            /**
106:             * Returns the y1 field.
107:             * @param callback y1
108:             */
109:            @SuppressWarnings("unchecked")
110:            public void getY1(
111:                    org.directwebremoting.proxy.Callback<Integer> callback) {
112:                ScriptBuffer script = new ScriptBuffer();
113:                String callbackPrefix = "";
114:
115:                if (callback != null) {
116:                    callbackPrefix = "var reply = ";
117:                }
118:
119:                script.appendCall(callbackPrefix + getContextPath() + "getY1");
120:
121:                if (callback != null) {
122:                    String key = org.directwebremoting.extend.CallbackHelper
123:                            .saveCallback(callback, Integer.class);
124:                    script
125:                            .appendCall("__System.activateCallback", key,
126:                                    "reply");
127:                }
128:
129:                getScriptProxy().addScript(script);
130:            }
131:
132:            /**
133:             * Sets the y1 field.
134:             * @param y1 the new value for y1
135:             */
136:            public void setY1(int y1) {
137:                ScriptBuffer script = new ScriptBuffer();
138:                script.appendCall(getContextPath() + "setY1", y1);
139:                getScriptProxy().addScript(script);
140:            }
141:
142:            /**
143:             * Returns the x2 field.
144:             * @param callback x2
145:             */
146:            @SuppressWarnings("unchecked")
147:            public void getX2(
148:                    org.directwebremoting.proxy.Callback<Integer> callback) {
149:                ScriptBuffer script = new ScriptBuffer();
150:                String callbackPrefix = "";
151:
152:                if (callback != null) {
153:                    callbackPrefix = "var reply = ";
154:                }
155:
156:                script.appendCall(callbackPrefix + getContextPath() + "getX2");
157:
158:                if (callback != null) {
159:                    String key = org.directwebremoting.extend.CallbackHelper
160:                            .saveCallback(callback, Integer.class);
161:                    script
162:                            .appendCall("__System.activateCallback", key,
163:                                    "reply");
164:                }
165:
166:                getScriptProxy().addScript(script);
167:            }
168:
169:            /**
170:             * Sets the x2 field.
171:             * @param x2 the new value for x2
172:             */
173:            public void setX2(int x2) {
174:                ScriptBuffer script = new ScriptBuffer();
175:                script.appendCall(getContextPath() + "setX2", x2);
176:                getScriptProxy().addScript(script);
177:            }
178:
179:            /**
180:             * Returns the y2 field.
181:             * @param callback y2
182:             */
183:            @SuppressWarnings("unchecked")
184:            public void getY2(
185:                    org.directwebremoting.proxy.Callback<Integer> callback) {
186:                ScriptBuffer script = new ScriptBuffer();
187:                String callbackPrefix = "";
188:
189:                if (callback != null) {
190:                    callbackPrefix = "var reply = ";
191:                }
192:
193:                script.appendCall(callbackPrefix + getContextPath() + "getY2");
194:
195:                if (callback != null) {
196:                    String key = org.directwebremoting.extend.CallbackHelper
197:                            .saveCallback(callback, Integer.class);
198:                    script
199:                            .appendCall("__System.activateCallback", key,
200:                                    "reply");
201:                }
202:
203:                getScriptProxy().addScript(script);
204:            }
205:
206:            /**
207:             * Sets the y2 field.
208:             * @param y2 the new value for y2
209:             */
210:            public void setY2(int y2) {
211:                ScriptBuffer script = new ScriptBuffer();
212:                script.appendCall(getContextPath() + "setY2", y2);
213:                getScriptProxy().addScript(script);
214:            }
215:
216:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.