Source Code Cross Referenced for LineSeries.java in  » Ajax » dwr » jsx3 » chart » 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.chart 
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.chart;
017:
018:        import org.directwebremoting.ScriptBuffer;
019:        import org.directwebremoting.proxy.ScriptProxy;
020:        import org.directwebremoting.proxy.io.Context;
021:
022:        /**
023:         * A data series for a line chart. An line series draws a set of points connected by a line.
024:         A line series has the following properties:
025:
026:         xField the attribute of a record to use as the x-coordinate of points in the series, required if
027:         the x-axis is a value axis
028:         yField the attribute of a record to use as the y-coordinate of points in the series, required
029:         form defines how the area is drawn, one of {'segment','step','reverseStep','horizontal','vertical'},
030:         defaults to 'segment'
031:         interpolateValues if true the the line will be continuous even over missing data points, if false the
032:         the line will break over missing data points
033:         pointRadius the radius of the points to render at each data point on the line, optional
034:         pointRenderer string that evals to an object that implements the renderer interface, optional
035:         pointFill string representation of a vector fill for the points
036:         pointStroke string representation of a VectorStroke for the points
037:         pointGradient string representation of a vector fill gradient for the points
038:         * @author Joe Walker [joe at getahead dot org]
039:         * @author DRAPGEN - Dwr Reverse Ajax Proxy GENerator
040:         */
041:        public class LineSeries extends jsx3.chart.Series {
042:            /**
043:             * All reverse ajax proxies need context to work from
044:             * @param scriptProxy The place we are writing scripts to
045:             * @param context The script that got us to where we are now
046:             */
047:            public LineSeries(Context context, String extension,
048:                    ScriptProxy scriptProxy) {
049:                super (context, extension, scriptProxy);
050:            }
051:
052:            /**
053:             * The instance initializer.
054:             * @param name the GI name of the instance
055:             * @param seriesName the name of the Series, will be displayed in the Legend for most chart types
056:             */
057:            public LineSeries(String name, String seriesName) {
058:                super ((Context) null, (String) null, (ScriptProxy) null);
059:                ScriptBuffer script = new ScriptBuffer();
060:                script.appendCall("new LineSeries", name, seriesName);
061:                setInitScript(script);
062:            }
063:
064:            /**
065:             * 
066:             */
067:            public static final String FORM_SEGMENT = "segment";
068:
069:            /**
070:             * 
071:             */
072:            public static final String FORM_STEP = "step";
073:
074:            /**
075:             * 
076:             */
077:            public static final String FORM_REVSTEP = "reverseStep";
078:
079:            /**
080:             * 
081:             */
082:            public static final String FORM_HORIZONTAL = "horizontal";
083:
084:            /**
085:             * 
086:             */
087:            public static final String FORM_VERTICAL = "vertical";
088:
089:            /**
090:             * Returns the xField field.
091:             * @param callback xField
092:             */
093:            @SuppressWarnings("unchecked")
094:            public void getXField(
095:                    org.directwebremoting.proxy.Callback<String> callback) {
096:                ScriptBuffer script = new ScriptBuffer();
097:                String callbackPrefix = "";
098:
099:                if (callback != null) {
100:                    callbackPrefix = "var reply = ";
101:                }
102:
103:                script.appendCall(callbackPrefix + getContextPath()
104:                        + "getXField");
105:
106:                if (callback != null) {
107:                    String key = org.directwebremoting.extend.CallbackHelper
108:                            .saveCallback(callback, String.class);
109:                    script
110:                            .appendCall("__System.activateCallback", key,
111:                                    "reply");
112:                }
113:
114:                getScriptProxy().addScript(script);
115:            }
116:
117:            /**
118:             * Sets the xField field.
119:             * @param xField the new value for xField
120:             */
121:            public void setXField(String xField) {
122:                ScriptBuffer script = new ScriptBuffer();
123:                script.appendCall(getContextPath() + "setXField", xField);
124:                getScriptProxy().addScript(script);
125:            }
126:
127:            /**
128:             * Returns the yField field.
129:             * @param callback yField
130:             */
131:            @SuppressWarnings("unchecked")
132:            public void getYField(
133:                    org.directwebremoting.proxy.Callback<String> callback) {
134:                ScriptBuffer script = new ScriptBuffer();
135:                String callbackPrefix = "";
136:
137:                if (callback != null) {
138:                    callbackPrefix = "var reply = ";
139:                }
140:
141:                script.appendCall(callbackPrefix + getContextPath()
142:                        + "getYField");
143:
144:                if (callback != null) {
145:                    String key = org.directwebremoting.extend.CallbackHelper
146:                            .saveCallback(callback, String.class);
147:                    script
148:                            .appendCall("__System.activateCallback", key,
149:                                    "reply");
150:                }
151:
152:                getScriptProxy().addScript(script);
153:            }
154:
155:            /**
156:             * Sets the yField field.
157:             * @param yField the new value for yField
158:             */
159:            public void setYField(String yField) {
160:                ScriptBuffer script = new ScriptBuffer();
161:                script.appendCall(getContextPath() + "setYField", yField);
162:                getScriptProxy().addScript(script);
163:            }
164:
165:            /**
166:             * Returns the form field.
167:             * @param callback form
168:             */
169:            @SuppressWarnings("unchecked")
170:            public void getForm(
171:                    org.directwebremoting.proxy.Callback<String> callback) {
172:                ScriptBuffer script = new ScriptBuffer();
173:                String callbackPrefix = "";
174:
175:                if (callback != null) {
176:                    callbackPrefix = "var reply = ";
177:                }
178:
179:                script
180:                        .appendCall(callbackPrefix + getContextPath()
181:                                + "getForm");
182:
183:                if (callback != null) {
184:                    String key = org.directwebremoting.extend.CallbackHelper
185:                            .saveCallback(callback, String.class);
186:                    script
187:                            .appendCall("__System.activateCallback", key,
188:                                    "reply");
189:                }
190:
191:                getScriptProxy().addScript(script);
192:            }
193:
194:            /**
195:             * Sets the form field, checks for valid value.
196:             * @param form the new value for form, one of {'segment','step','reverseStep','horizontal','vertical'}
197:             */
198:            public void setForm(String form) {
199:                ScriptBuffer script = new ScriptBuffer();
200:                script.appendCall(getContextPath() + "setForm", form);
201:                getScriptProxy().addScript(script);
202:            }
203:
204:            /**
205:             * Returns the interpolateValues field.
206:             * @param callback interpolateValues
207:             */
208:            @SuppressWarnings("unchecked")
209:            public void getInterpolateValues(
210:                    org.directwebremoting.proxy.Callback<Boolean> callback) {
211:                ScriptBuffer script = new ScriptBuffer();
212:                String callbackPrefix = "";
213:
214:                if (callback != null) {
215:                    callbackPrefix = "var reply = ";
216:                }
217:
218:                script.appendCall(callbackPrefix + getContextPath()
219:                        + "getInterpolateValues");
220:
221:                if (callback != null) {
222:                    String key = org.directwebremoting.extend.CallbackHelper
223:                            .saveCallback(callback, Boolean.class);
224:                    script
225:                            .appendCall("__System.activateCallback", key,
226:                                    "reply");
227:                }
228:
229:                getScriptProxy().addScript(script);
230:            }
231:
232:            /**
233:             * Sets the interpolateValues field.
234:             * @param interpolateValues the new value for interpolateValues
235:             */
236:            public void setInterpolateValues(boolean interpolateValues) {
237:                ScriptBuffer script = new ScriptBuffer();
238:                script.appendCall(getContextPath() + "setInterpolateValues",
239:                        interpolateValues);
240:                getScriptProxy().addScript(script);
241:            }
242:
243:            /**
244:             * Returns the pointRadius field.
245:             * @param callback pointRadius
246:             */
247:            @SuppressWarnings("unchecked")
248:            public void getPointRadius(
249:                    org.directwebremoting.proxy.Callback<Integer> callback) {
250:                ScriptBuffer script = new ScriptBuffer();
251:                String callbackPrefix = "";
252:
253:                if (callback != null) {
254:                    callbackPrefix = "var reply = ";
255:                }
256:
257:                script.appendCall(callbackPrefix + getContextPath()
258:                        + "getPointRadius");
259:
260:                if (callback != null) {
261:                    String key = org.directwebremoting.extend.CallbackHelper
262:                            .saveCallback(callback, Integer.class);
263:                    script
264:                            .appendCall("__System.activateCallback", key,
265:                                    "reply");
266:                }
267:
268:                getScriptProxy().addScript(script);
269:            }
270:
271:            /**
272:             * Sets the pointRadius field.
273:             * @param pointRadius the new value for pointRadius
274:             */
275:            public void setPointRadius(int pointRadius) {
276:                ScriptBuffer script = new ScriptBuffer();
277:                script.appendCall(getContextPath() + "setPointRadius",
278:                        pointRadius);
279:                getScriptProxy().addScript(script);
280:            }
281:
282:            /**
283:             * Returns the pointRenderer field.
284:             * @return pointRenderer
285:             */
286:            @SuppressWarnings("unchecked")
287:            public jsx3.chart.PointRenderer getPointRenderer() {
288:                String extension = "getPointRenderer().";
289:                try {
290:                    java.lang.reflect.Constructor<jsx3.chart.PointRenderer> ctor = jsx3.chart.PointRenderer.class
291:                            .getConstructor(Context.class, String.class,
292:                                    ScriptProxy.class);
293:                    return ctor.newInstance(this , extension, getScriptProxy());
294:                } catch (Exception ex) {
295:                    throw new IllegalArgumentException("Unsupported type: "
296:                            + jsx3.chart.PointRenderer.class.getName());
297:                }
298:            }
299:
300:            /**
301:             * Sets the pointRenderer field, should eval to an object that implements the renderer interface.
302:             * @param pointRenderer the new value for pointRenderer, as a string
303:             */
304:            public void setPointRenderer(String pointRenderer) {
305:                ScriptBuffer script = new ScriptBuffer();
306:                script.appendCall(getContextPath() + "setPointRenderer",
307:                        pointRenderer);
308:                getScriptProxy().addScript(script);
309:            }
310:
311:            /**
312:             * Returns the pointFill field.
313:             * @param callback pointFill
314:             */
315:            @SuppressWarnings("unchecked")
316:            public void getPointFill(
317:                    org.directwebremoting.proxy.Callback<String> callback) {
318:                ScriptBuffer script = new ScriptBuffer();
319:                String callbackPrefix = "";
320:
321:                if (callback != null) {
322:                    callbackPrefix = "var reply = ";
323:                }
324:
325:                script.appendCall(callbackPrefix + getContextPath()
326:                        + "getPointFill");
327:
328:                if (callback != null) {
329:                    String key = org.directwebremoting.extend.CallbackHelper
330:                            .saveCallback(callback, String.class);
331:                    script
332:                            .appendCall("__System.activateCallback", key,
333:                                    "reply");
334:                }
335:
336:                getScriptProxy().addScript(script);
337:            }
338:
339:            /**
340:             * Sets the pointFill field.
341:             * @param pointFill the new value for pointFill
342:             */
343:            public void setPointFill(String pointFill) {
344:                ScriptBuffer script = new ScriptBuffer();
345:                script.appendCall(getContextPath() + "setPointFill", pointFill);
346:                getScriptProxy().addScript(script);
347:            }
348:
349:            /**
350:             * Returns the pointStroke field.
351:             * @param callback pointStroke
352:             */
353:            @SuppressWarnings("unchecked")
354:            public void getPointStroke(
355:                    org.directwebremoting.proxy.Callback<String> callback) {
356:                ScriptBuffer script = new ScriptBuffer();
357:                String callbackPrefix = "";
358:
359:                if (callback != null) {
360:                    callbackPrefix = "var reply = ";
361:                }
362:
363:                script.appendCall(callbackPrefix + getContextPath()
364:                        + "getPointStroke");
365:
366:                if (callback != null) {
367:                    String key = org.directwebremoting.extend.CallbackHelper
368:                            .saveCallback(callback, String.class);
369:                    script
370:                            .appendCall("__System.activateCallback", key,
371:                                    "reply");
372:                }
373:
374:                getScriptProxy().addScript(script);
375:            }
376:
377:            /**
378:             * Sets the pointStroke field.
379:             * @param pointStroke the new value for pointStroke
380:             */
381:            public void setPointStroke(String pointStroke) {
382:                ScriptBuffer script = new ScriptBuffer();
383:                script.appendCall(getContextPath() + "setPointStroke",
384:                        pointStroke);
385:                getScriptProxy().addScript(script);
386:            }
387:
388:            /**
389:             * Returns the pointGradient field.
390:             * @param callback pointGradient
391:             */
392:            @SuppressWarnings("unchecked")
393:            public void getPointGradient(
394:                    org.directwebremoting.proxy.Callback<String> callback) {
395:                ScriptBuffer script = new ScriptBuffer();
396:                String callbackPrefix = "";
397:
398:                if (callback != null) {
399:                    callbackPrefix = "var reply = ";
400:                }
401:
402:                script.appendCall(callbackPrefix + getContextPath()
403:                        + "getPointGradient");
404:
405:                if (callback != null) {
406:                    String key = org.directwebremoting.extend.CallbackHelper
407:                            .saveCallback(callback, String.class);
408:                    script
409:                            .appendCall("__System.activateCallback", key,
410:                                    "reply");
411:                }
412:
413:                getScriptProxy().addScript(script);
414:            }
415:
416:            /**
417:             * Sets the pointGradient field.
418:             * @param pointGradient the new value for pointGradient
419:             */
420:            public void setPointGradient(String pointGradient) {
421:                ScriptBuffer script = new ScriptBuffer();
422:                script.appendCall(getContextPath() + "setPointGradient",
423:                        pointGradient);
424:                getScriptProxy().addScript(script);
425:            }
426:
427:            /**
428:             * The default tooltip function for this type of series.
429:             * @param series 
430:             * @param record 
431:             */
432:            @SuppressWarnings("unchecked")
433:            public void tooltip(jsx3.chart.Series series, jsx3.xml.Node record,
434:                    org.directwebremoting.proxy.Callback<String> callback) {
435:                ScriptBuffer script = new ScriptBuffer();
436:                String callbackPrefix = "";
437:
438:                if (callback != null) {
439:                    callbackPrefix = "var reply = ";
440:                }
441:
442:                script.appendCall(
443:                        callbackPrefix + getContextPath() + "tooltip", series,
444:                        record);
445:
446:                if (callback != null) {
447:                    String key = org.directwebremoting.extend.CallbackHelper
448:                            .saveCallback(callback, String.class);
449:                    script
450:                            .appendCall("__System.activateCallback", key,
451:                                    "reply");
452:                }
453:
454:                getScriptProxy().addScript(script);
455:            }
456:
457:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.