Source Code Cross Referenced for GenericChart.java in  » J2EE » Dinamica » dinamica » 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 » J2EE » Dinamica » dinamica 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        package dinamica;
02:
03:        /**
04:         * Generic Transaction used for server-side Chart Actions.
05:         * This Transaction class will read some specific elements from
06:         * config.xml in order to set the values of the chart configuration
07:         * recordset used by the ChartOutput class. This Transaction will save
08:         * you the effort of writing a class for the sole purpose of configuring
09:         * a chart, instead you will use config.xml to provide chart properties.
10:         * <br><br>
11:         * (c) 2004-2008 Martin Cordova<br>
12:         * This code is released under the LGPL license<br>
13:         * Dinamica Framework - http://www.martincordova.com
14:         * @author Martin Cordova (dinamica@martincordova.com)
15:         * */
16:        public class GenericChart extends GenericTransaction {
17:
18:            /* (non-Javadoc)
19:             * @see dinamica.GenericTransaction#service(dinamica.Recordset)
20:             */
21:            public int service(Recordset inputParams) throws Throwable {
22:
23:                //reuse superclass code
24:                super .service(inputParams);
25:
26:                //get chart config recordset
27:                Recordset rs = getChartInfoRecordset();
28:
29:                fillChartConfig(rs);
30:
31:                /* publish recordset to be consumed by output module */
32:                publish("chartinfo", rs);
33:
34:                //return OK
35:                return 0;
36:
37:            }
38:
39:            /**
40:             * Lee la configuracion basica del plugin de charts, este metodo
41:             * puede ser llamado por subclases para que lea la configuracion y luego
42:             * las subclases leen parametros adicionales que ellas mismas definieron 
43:             * al hacer un override del metodo getChartInfoRecordset().<br>
44:             * <br>PATCH 2008-03-06 mejorar la extensibilidad del framework para soportar
45:             * nuevos parametros de configuracion de charts no previstos por el framework.
46:             * @param rs Recordset retornado por el metodo getChartInfoRecordset() de la clase GenericTransaction
47:             * @throws Throwable
48:             */
49:            public void fillChartConfig(Recordset rs) throws Throwable {
50:
51:                //read chart properties from config.xml
52:                String session = getConfig().getConfigValue("//chart/session");
53:                String imageid = getConfig().getConfigValue("//chart/image-id");
54:                String plugin = getConfig().getConfigValue("//chart/plugin");
55:                Integer width = new Integer(getConfig().getConfigValue(
56:                        "//chart/width"));
57:                Integer height = new Integer(getConfig().getConfigValue(
58:                        "//chart/height"));
59:                String title = getConfig().getConfigValue("//chart/title");
60:                String titlex = getConfig().getConfigValue("//chart/title-x");
61:                String titley = getConfig().getConfigValue("//chart/title-y");
62:                String series = getConfig().getConfigValue(
63:                        "//chart/title-series");
64:                String recordset = getConfig().getConfigValue(
65:                        "//chart/recordset");
66:                String fieldx = getConfig().getConfigValue("//chart/field-x");
67:                String fieldy = getConfig().getConfigValue("//chart/field-y");
68:                String color = getConfig()
69:                        .getConfigValue("//chart/color", null);
70:
71:                //set chart properties using a recordset
72:                rs.addNew();
73:                rs.setValue("title", title);
74:                rs.setValue("title-x", titlex); //irrelevant for pie charts
75:                rs.setValue("title-y", titley); //irrelevant for pie charts
76:                rs.setValue("column-x", fieldx);
77:                rs.setValue("column-y", fieldy); //if multiseries then type multiple column names separated by ";"
78:                rs.setValue("title-series", series); //no series - otherwise set label names separated by ";"
79:                rs.setValue("width", width); //in pixels
80:                rs.setValue("height", height); //in pixels
81:                rs.setValue("data", recordset); //recordset that must be stored in session attribute
82:
83:                /* select the type of chart you want to use */
84:                rs.setValue("chart-plugin", plugin);
85:
86:                //added on april-6-2004 - persist image bytes in session attribute
87:                //to be reused by PDF generators
88:                rs.setValue("session", session);
89:                rs.setValue("image-id", imageid);
90:
91:                //added on july-19-2005 - default color for charts
92:                //with 1 series only (applies to bar, line and area only)
93:                rs.setValue("color", color);
94:
95:            }
96:
97:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.