Source Code Cross Referenced for PieSeries.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 pie chart. Draws a complete pie or ring of a doughnut. A pie series is slightly
024:         different from all the other series because it gets colored in by category instead of all one color.
025:         A pie series has the following fields:
026:
027:         xField the attribute of a record to use as the relative size of each slice of the pie, required
028:         totalAngle the total angle for the series, if not set use the value from the chart
029:         startAngle the angle of the start of the first slice, 0 is top and increasing values go clockwise, 
030:         if not set use the value from the chart
031:         colors an array of string representations of vector fills to color in the slices, if not set use
032:         the value from the chart
033:         colorFunction a function that determines the color of each slice, with the signature 
034:         function(record, index) : jsx3.vector.Fill, if not set use the value from the chart
035:         stroke string representation of a VectorStroke to outline the slices with, if not set use the value 
036:         from the chart
037:         labelPlacement where to place a label with the name of the series, relative to the series, one of
038:         {'top','right','bottom','left'}
039:         labelOffset the padding (may be negative) between the outer edge of the series and the close edge of
040:         the label
041:         * @author Joe Walker [joe at getahead dot org]
042:         * @author DRAPGEN - Dwr Reverse Ajax Proxy GENerator
043:         */
044:        public class PieSeries extends jsx3.chart.Series {
045:            /**
046:             * All reverse ajax proxies need context to work from
047:             * @param scriptProxy The place we are writing scripts to
048:             * @param context The script that got us to where we are now
049:             */
050:            public PieSeries(Context context, String extension,
051:                    ScriptProxy scriptProxy) {
052:                super (context, extension, scriptProxy);
053:            }
054:
055:            /**
056:             * The instance initializer.
057:             * @param name the GI name of the instance
058:             * @param seriesName the name of the Series, will be displayed in the Legend for most chart types
059:             */
060:            public PieSeries(String name, String seriesName) {
061:                super ((Context) null, (String) null, (ScriptProxy) null);
062:                ScriptBuffer script = new ScriptBuffer();
063:                script.appendCall("new PieSeries", name, seriesName);
064:                setInitScript(script);
065:            }
066:
067:            /**
068:             * Returns the totalAngle field, overrides per-chart setting in PieChart.
069:             * @param callback totalAngle
070:             */
071:            @SuppressWarnings("unchecked")
072:            public void getTotalAngle(
073:                    org.directwebremoting.proxy.Callback<Integer> callback) {
074:                ScriptBuffer script = new ScriptBuffer();
075:                String callbackPrefix = "";
076:
077:                if (callback != null) {
078:                    callbackPrefix = "var reply = ";
079:                }
080:
081:                script.appendCall(callbackPrefix + getContextPath()
082:                        + "getTotalAngle");
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 totalAngle field.
097:             * @param totalAngle the new value for totalAngle
098:             */
099:            public void setTotalAngle(int totalAngle) {
100:                ScriptBuffer script = new ScriptBuffer();
101:                script.appendCall(getContextPath() + "setTotalAngle",
102:                        totalAngle);
103:                getScriptProxy().addScript(script);
104:            }
105:
106:            /**
107:             * Returns the startAngle field, overrides per-chart setting in PieChart.
108:             * @param callback startAngle
109:             */
110:            @SuppressWarnings("unchecked")
111:            public void getStartAngle(
112:                    org.directwebremoting.proxy.Callback<Integer> callback) {
113:                ScriptBuffer script = new ScriptBuffer();
114:                String callbackPrefix = "";
115:
116:                if (callback != null) {
117:                    callbackPrefix = "var reply = ";
118:                }
119:
120:                script.appendCall(callbackPrefix + getContextPath()
121:                        + "getStartAngle");
122:
123:                if (callback != null) {
124:                    String key = org.directwebremoting.extend.CallbackHelper
125:                            .saveCallback(callback, Integer.class);
126:                    script
127:                            .appendCall("__System.activateCallback", key,
128:                                    "reply");
129:                }
130:
131:                getScriptProxy().addScript(script);
132:            }
133:
134:            /**
135:             * Sets the startAngle field.
136:             * @param startAngle the new value for startAngle
137:             */
138:            public void setStartAngle(int startAngle) {
139:                ScriptBuffer script = new ScriptBuffer();
140:                script.appendCall(getContextPath() + "setStartAngle",
141:                        startAngle);
142:                getScriptProxy().addScript(script);
143:            }
144:
145:            /**
146:             * Returns the field field, the attribute of the data provider to use as values for this series.
147:             * @param callback field
148:             */
149:            @SuppressWarnings("unchecked")
150:            public void getField(
151:                    org.directwebremoting.proxy.Callback<String> callback) {
152:                ScriptBuffer script = new ScriptBuffer();
153:                String callbackPrefix = "";
154:
155:                if (callback != null) {
156:                    callbackPrefix = "var reply = ";
157:                }
158:
159:                script.appendCall(callbackPrefix + getContextPath()
160:                        + "getField");
161:
162:                if (callback != null) {
163:                    String key = org.directwebremoting.extend.CallbackHelper
164:                            .saveCallback(callback, String.class);
165:                    script
166:                            .appendCall("__System.activateCallback", key,
167:                                    "reply");
168:                }
169:
170:                getScriptProxy().addScript(script);
171:            }
172:
173:            /**
174:             * Sets the field field.
175:             * @param field the new value for field
176:             */
177:            public void setField(String field) {
178:                ScriptBuffer script = new ScriptBuffer();
179:                script.appendCall(getContextPath() + "setField", field);
180:                getScriptProxy().addScript(script);
181:            }
182:
183:            /**
184:             * Returns the value of a data point in this series for the given record.
185:             * @param record the <record/> node
186:             */
187:            @SuppressWarnings("unchecked")
188:            public void getValue(jsx3.xml.Node record,
189:                    org.directwebremoting.proxy.Callback<Integer> callback) {
190:                ScriptBuffer script = new ScriptBuffer();
191:                String callbackPrefix = "";
192:
193:                if (callback != null) {
194:                    callbackPrefix = "var reply = ";
195:                }
196:
197:                script.appendCall(callbackPrefix + getContextPath()
198:                        + "getValue", record);
199:
200:                if (callback != null) {
201:                    String key = org.directwebremoting.extend.CallbackHelper
202:                            .saveCallback(callback, Integer.class);
203:                    script
204:                            .appendCall("__System.activateCallback", key,
205:                                    "reply");
206:                }
207:
208:                getScriptProxy().addScript(script);
209:            }
210:
211:            /**
212:             * Returns the colors field, overrides per-chart setting in PieChart.
213:             * @param callback colors
214:             */
215:            @SuppressWarnings("unchecked")
216:            public void getColors(
217:                    org.directwebremoting.proxy.Callback<Object[]> callback) {
218:                ScriptBuffer script = new ScriptBuffer();
219:                String callbackPrefix = "";
220:
221:                if (callback != null) {
222:                    callbackPrefix = "var reply = ";
223:                }
224:
225:                script.appendCall(callbackPrefix + getContextPath()
226:                        + "getColors");
227:
228:                if (callback != null) {
229:                    String key = org.directwebremoting.extend.CallbackHelper
230:                            .saveCallback(callback, Object[].class);
231:                    script
232:                            .appendCall("__System.activateCallback", key,
233:                                    "reply");
234:                }
235:
236:                getScriptProxy().addScript(script);
237:            }
238:
239:            /**
240:             * Sets the colors field.
241:             * @param colors the new value for colors
242:             */
243:            public void setColors(Object[] colors) {
244:                ScriptBuffer script = new ScriptBuffer();
245:                script.appendCall(getContextPath() + "setColors", colors);
246:                getScriptProxy().addScript(script);
247:            }
248:
249:            /**
250:             * Returns the labelPlacement field, where to place the optional ChartLabel child.
251:             * @param callback labelPlacement
252:             */
253:            @SuppressWarnings("unchecked")
254:            public void getLabelPlacement(
255:                    org.directwebremoting.proxy.Callback<String> callback) {
256:                ScriptBuffer script = new ScriptBuffer();
257:                String callbackPrefix = "";
258:
259:                if (callback != null) {
260:                    callbackPrefix = "var reply = ";
261:                }
262:
263:                script.appendCall(callbackPrefix + getContextPath()
264:                        + "getLabelPlacement");
265:
266:                if (callback != null) {
267:                    String key = org.directwebremoting.extend.CallbackHelper
268:                            .saveCallback(callback, String.class);
269:                    script
270:                            .appendCall("__System.activateCallback", key,
271:                                    "reply");
272:                }
273:
274:                getScriptProxy().addScript(script);
275:            }
276:
277:            /**
278:             * Sets the labelPlacement field.
279:             * @param labelPlacement the new value for labelPlacement
280:             */
281:            public void setLabelPlacement(String labelPlacement) {
282:                ScriptBuffer script = new ScriptBuffer();
283:                script.appendCall(getContextPath() + "setLabelPlacement",
284:                        labelPlacement);
285:                getScriptProxy().addScript(script);
286:            }
287:
288:            /**
289:             * Returns the labelOffset field, the pixel offset of the optional ChartLabel child.
290:             * @param callback labelOffset
291:             */
292:            @SuppressWarnings("unchecked")
293:            public void getLabelOffset(
294:                    org.directwebremoting.proxy.Callback<Integer> callback) {
295:                ScriptBuffer script = new ScriptBuffer();
296:                String callbackPrefix = "";
297:
298:                if (callback != null) {
299:                    callbackPrefix = "var reply = ";
300:                }
301:
302:                script.appendCall(callbackPrefix + getContextPath()
303:                        + "getLabelOffset");
304:
305:                if (callback != null) {
306:                    String key = org.directwebremoting.extend.CallbackHelper
307:                            .saveCallback(callback, Integer.class);
308:                    script
309:                            .appendCall("__System.activateCallback", key,
310:                                    "reply");
311:                }
312:
313:                getScriptProxy().addScript(script);
314:            }
315:
316:            /**
317:             * Sets the labelOffset field.
318:             * @param labelOffset the new value for labelOffset
319:             */
320:            public void setLabelOffset(int labelOffset) {
321:                ScriptBuffer script = new ScriptBuffer();
322:                script.appendCall(getContextPath() + "setLabelOffset",
323:                        labelOffset);
324:                getScriptProxy().addScript(script);
325:            }
326:
327:            /**
328:             * The default tooltip function for this type of series.
329:             * @param series 
330:             * @param record 
331:             * @param percent 
332:             */
333:            @SuppressWarnings("unchecked")
334:            public void tooltip(jsx3.chart.Series series, jsx3.xml.Node record,
335:                    java.lang.Object percent,
336:                    org.directwebremoting.proxy.Callback<String> callback) {
337:                ScriptBuffer script = new ScriptBuffer();
338:                String callbackPrefix = "";
339:
340:                if (callback != null) {
341:                    callbackPrefix = "var reply = ";
342:                }
343:
344:                script.appendCall(
345:                        callbackPrefix + getContextPath() + "tooltip", series,
346:                        record, percent);
347:
348:                if (callback != null) {
349:                    String key = org.directwebremoting.extend.CallbackHelper
350:                            .saveCallback(callback, String.class);
351:                    script
352:                            .appendCall("__System.activateCallback", key,
353:                                    "reply");
354:                }
355:
356:                getScriptProxy().addScript(script);
357:            }
358:
359:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.