Source Code Cross Referenced for PointRenderer.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:         * Objects that implement this interface may be used in Line/Area/Point/Bubble charts to render the points that appear
024:         at each datapoint.
025:
026:         Additionally, this interface contains several static fields that are implementors of this interface.
027:         * @author Joe Walker [joe at getahead dot org]
028:         * @author DRAPGEN - Dwr Reverse Ajax Proxy GENerator
029:         */
030:        public class PointRenderer extends jsx3.lang.Object {
031:            /**
032:             * All reverse ajax proxies need context to work from
033:             * @param scriptProxy The place we are writing scripts to
034:             * @param context The script that got us to where we are now
035:             */
036:            public PointRenderer(Context context, String extension,
037:                    ScriptProxy scriptProxy) {
038:                super (context, extension, scriptProxy);
039:            }
040:
041:            /**
042:             * Renders the point in the bounds specified by {x1,y1} {x2,y2}.
043:             * @param x1 
044:             * @param y1 
045:             * @param x2 
046:             * @param y2 
047:             * @param fill 
048:             * @param stroke 
049:             */
050:            @SuppressWarnings("unchecked")
051:            public jsx3.vector.Tag render(int x1, int y1, int x2, int y2,
052:                    jsx3.vector.Fill fill, jsx3.vector.Stroke stroke) {
053:                String extension = "render(\"" + x1 + "\", \"" + y1 + "\", \""
054:                        + x2 + "\", \"" + y2 + "\", \"" + fill + "\", \""
055:                        + stroke + "\").";
056:                try {
057:                    java.lang.reflect.Constructor<jsx3.vector.Tag> ctor = jsx3.vector.Tag.class
058:                            .getConstructor(Context.class, String.class,
059:                                    ScriptProxy.class);
060:                    return ctor.newInstance(this , extension, getScriptProxy());
061:                } catch (Exception ex) {
062:                    throw new IllegalArgumentException("Unsupported type: "
063:                            + jsx3.vector.Tag.class.getName());
064:                }
065:            }
066:
067:            /**
068:             * Renders the point in the bounds specified by {x1,y1} {x2,y2}.
069:             * @param x1 
070:             * @param y1 
071:             * @param x2 
072:             * @param y2 
073:             * @param fill 
074:             * @param stroke 
075:             * @param returnType The expected return type
076:             */
077:            @SuppressWarnings("unchecked")
078:            public <T> T render(int x1, int y1, int x2, int y2,
079:                    jsx3.vector.Fill fill, jsx3.vector.Stroke stroke,
080:                    Class<T> returnType) {
081:                String extension = "render(\"" + x1 + "\", \"" + y1 + "\", \""
082:                        + x2 + "\", \"" + y2 + "\", \"" + fill + "\", \""
083:                        + stroke + "\").";
084:                try {
085:                    java.lang.reflect.Constructor<T> ctor = returnType
086:                            .getConstructor(Context.class, String.class,
087:                                    ScriptProxy.class);
088:                    return ctor.newInstance(this , extension, getScriptProxy());
089:                } catch (Exception ex) {
090:                    throw new IllegalArgumentException(
091:                            "Unsupported return type: " + returnType.getName());
092:                }
093:            }
094:
095:            /**
096:             * Converts the area of the point to display to the radius of the box that it should fill. Required
097:            if the point renderer will be used in a plot chart.
098:             * @param area 
099:             */
100:            @SuppressWarnings("unchecked")
101:            public void areaToRadius(Integer area,
102:                    org.directwebremoting.proxy.Callback<Integer> callback) {
103:                ScriptBuffer script = new ScriptBuffer();
104:                String callbackPrefix = "";
105:
106:                if (callback != null) {
107:                    callbackPrefix = "var reply = ";
108:                }
109:
110:                script.appendCall(callbackPrefix + getContextPath()
111:                        + "areaToRadius", area);
112:
113:                if (callback != null) {
114:                    String key = org.directwebremoting.extend.CallbackHelper
115:                            .saveCallback(callback, Integer.class);
116:                    script
117:                            .appendCall("__System.activateCallback", key,
118:                                    "reply");
119:                }
120:
121:                getScriptProxy().addScript(script);
122:            }
123:
124:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.