Source Code Cross Referenced for StackedChartParameters.java in  » ERP-CRM-Financial » jmoney » net » sf » jmoney » charts » 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 » ERP CRM Financial » jmoney » net.sf.jmoney.charts 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package net.sf.jmoney.charts;
002:
003:        import java.lang.reflect.Constructor;
004:        import java.text.DateFormat;
005:        import java.text.ParseException;
006:        import java.text.SimpleDateFormat;
007:        import java.util.Date;
008:        import java.util.Vector;
009:
010:        import org.eclipse.core.runtime.Assert;
011:        import org.jfree.data.time.RegularTimePeriod;
012:
013:        /**
014:         * @author Faucheux
015:         * This class is only a container to collect all the parameters of
016:         * a LineChart.
017:         */
018:        public class StackedChartParameters {
019:
020:            public/*String*/Vector accountList;
021:            public Date fromDate, toDate;
022:            public int maxLevel = 1;
023:            public boolean isStacked = false;
024:
025:            // Frequences of the dataes
026:            public static final int DAY = 0;
027:            public static final int MONTH = 1;
028:            public static final int YEAR = 2;
029:            public int frequence = YEAR;
030:
031:            // Contructor for the Object which represents the choosen TimePeriod: Month, Year...
032:            public Constructor regularPeriodConstructor = null;
033:
034:            // Dateformat object to format the dates which appears in the graph.
035:            DateFormat dateformat = null;
036:
037:            /**
038:             * 
039:             */
040:            public StackedChartParameters() {
041:                accountList = new Vector();
042:                fromDate = new Date(0); // 01.01.1970
043:                toDate = new Date(); // today
044:            }
045:
046:            /**
047:             * @param accountList The accountList to set.
048:             */
049:            public void setAccountList(Vector accountList) {
050:                this .accountList = accountList;
051:            }
052:
053:            /**
054:             * @param fromDate The fromDate to set.
055:             */
056:            public void setFromDate(Date fromDate) {
057:                this .fromDate = fromDate;
058:            }
059:
060:            /**
061:             * @param toDate The toDate to set.
062:             */
063:            public void setToDate(Date toDate) {
064:                this .toDate = toDate;
065:            }
066:
067:            public void setDates(String fromDate, String toDate) {
068:                DateFormat df = new SimpleDateFormat();
069:                try {
070:                    setFromDate(df.parse(fromDate));
071:                    setToDate(df.parse(toDate));
072:                } catch (ParseException e) {
073:                    e.printStackTrace();
074:                }
075:                ;
076:            }
077:
078:            /**
079:             * @param frequence The frequence to set.
080:             */
081:            public void setFrequence(int frequence) {
082:                this .frequence = frequence;
083:            }
084:
085:            /**
086:             * Instanciate the regularPeriodConstructor with the value dependant of periodClass
087:             * The dateformat is intanciated too
088:             * @author Faucheux
089:             */
090:            public void instanciateConstructor() {
091:                try {
092:                    Class periodClass = null;
093:                    String stringFormat = null;
094:                    switch (frequence) {
095:                    case MONTH:
096:                        stringFormat = "MM.yy";
097:                        periodClass = Class
098:                                .forName("org.jfree.data.time.Month");
099:                        break;
100:                    case YEAR:
101:                        stringFormat = "yyyy";
102:                        periodClass = Class.forName("org.jfree.data.time.Year");
103:                        break;
104:                    default:
105:                        Assert.isTrue(false);
106:                    }
107:                    dateformat = new SimpleDateFormat(stringFormat);
108:                    regularPeriodConstructor = periodClass
109:                            .getConstructor(new Class[] { Class
110:                                    .forName("java.util.Date") });
111:                } catch (ClassNotFoundException e) {
112:                    e.printStackTrace();
113:                } catch (NoSuchMethodException e) {
114:                    e.printStackTrace();
115:                }
116:
117:            }
118:
119:            /**
120:             * Create and returns a new object (Month, Day, Year...) which type depends of the choose Period
121:             * @param date
122:             * @return
123:             */
124:            public RegularTimePeriod createPeriod(Date date) {
125:                RegularTimePeriod re = null;
126:                try {
127:                    re = (RegularTimePeriod) regularPeriodConstructor
128:                            .newInstance(new Object[] { date });
129:                } catch (Exception e) {
130:                    e.printStackTrace();
131:                }
132:                return re;
133:            }
134:
135:            /**
136:             * @param maxLevel The maxLevel to set.
137:             */
138:            public void setMaxLevel(int maxLevel) {
139:                this .maxLevel = maxLevel;
140:            }
141:
142:            public void setIsStacked(boolean isStacked) {
143:                this.isStacked = isStacked;
144:            }
145:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.