Source Code Cross Referenced for EditableChartDataModel.java in  » Chart » charting-0.94 » de » progra » charting » model » 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 » Chart » charting 0.94 » de.progra.charting.model 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:            JOpenChart Java Charting Library and Toolkit
003:            Copyright (C) 2001  Sebastian Müller
004:            http://jopenchart.sourceforge.net
005:
006:            This library is free software; you can redistribute it and/or
007:            modify it under the terms of the GNU Lesser General Public
008:            License as published by the Free Software Foundation; either
009:            version 2.1 of the License, or (at your option) any later version.
010:
011:            This library is distributed in the hope that it will be useful,
012:            but WITHOUT ANY WARRANTY; without even the implied warranty of
013:            MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:            Lesser General Public License for more details.
015:
016:            You should have received a copy of the GNU Lesser General Public
017:            License along with this library; if not, write to the Free Software
018:            Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
019:
020:            EditableChartDataModel.java
021:            Created on 9. June 2002, 15:46
022:         */
023:
024:        package de.progra.charting.model;
025:
026:        import de.progra.charting.CoordSystem;
027:        import de.progra.charting.ChartUtilities;
028:        import java.util.ArrayList;
029:        import java.util.Arrays;
030:        import java.util.TreeSet;
031:        import java.util.Set;
032:        import java.util.HashMap;
033:
034:        /**
035:         * Implements an editable ChartModel. It uses a vector of DataSets and the columns
036:         * are numeric.
037:         * @author  mueller
038:         * @version 1.0
039:         */
040:        public class EditableChartDataModel extends DefaultChartDataModel {
041:
042:            /** Creates a new empty EditableChartDataModel. 
043:             */
044:            public EditableChartDataModel() {
045:                super ();
046:            }
047:
048:            /** Creates new EditableChartDataModel with the default axis binding.
049:             * @param data the array of values. The first index specifies the
050:             * datasets, the last one is the value index.
051:             * @param columns the array of x-axis values. The length of the
052:             * datasets and the length of the column should be equal and the columns should
053:             * be ordered.
054:             * @param rows the array of DataSet titles. It has to have the same
055:             * length as the number of DataSets.
056:             */
057:            public EditableChartDataModel(Number[][] data, double[] columns,
058:                    String[] rows) {
059:                this ();
060:
061:                columnSet.addAll(Arrays.asList(ChartUtilities
062:                        .transformArray(columns)));
063:
064:                TreeSet set = (TreeSet) valuesbyaxis.get(new Integer(
065:                        CoordSystem.FIRST_YAXIS));
066:
067:                ChartUtilities.addDataToSet(set, data);
068:                trimSet(set);
069:
070:                for (int i = 0; i < data.length; i++) {
071:                    this .data.add(new EditableDataSet(data[i], ChartUtilities
072:                            .transformArray(columns), CoordSystem.FIRST_YAXIS,
073:                            rows[i]));
074:                }
075:            }
076:
077:            /** Creates new EditableChartDataModel.
078:             * @param data the array of values. The first index specifies the
079:             * datasets, the last one is the value index.
080:             * @param columns the array of x-axis values. The length of the
081:             * datasets and the length of the column should be equal and
082:             * the columns should be ordered.
083:             * @param rows the array of DataSet titles. It has to have the same
084:             * length as the number of DataSets.
085:             */
086:            public EditableChartDataModel(int[][] data, double[] columns,
087:                    String[] rows) {
088:                this ();
089:
090:                Number[][] numdata = ChartUtilities.transformArray(data);
091:
092:                columnSet.addAll(Arrays.asList(ChartUtilities
093:                        .transformArray(columns)));
094:
095:                TreeSet set = (TreeSet) valuesbyaxis.get(new Integer(
096:                        CoordSystem.FIRST_YAXIS));
097:
098:                ChartUtilities.addDataToSet(set, numdata);
099:
100:                trimSet(set);
101:
102:                for (int i = 0; i < data.length; i++) {
103:                    this .data.add(new EditableDataSet(numdata[i],
104:                            ChartUtilities.transformArray(columns),
105:                            CoordSystem.FIRST_YAXIS, rows[i]));
106:                }
107:            }
108:
109:            /** Creates new EditableChartDataModel.
110:             * @param data the array of values. The first index specifies the
111:             * datasets, the last one is the value index.
112:             * @param columns the array of x-axis values. The length of the
113:             * datasets and the length of the column should be equal and
114:             * the columns should be ordered.
115:             * @param rows the array of DataSet titles. It has to have the same
116:             * length as the number of DataSets.
117:             */
118:            public EditableChartDataModel(double[][] data, double[] columns,
119:                    String[] rows) {
120:                this ();
121:
122:                Number[][] numdata = ChartUtilities.transformArray(data);
123:
124:                columnSet.addAll(Arrays.asList(ChartUtilities
125:                        .transformArray(columns)));
126:
127:                TreeSet set = (TreeSet) valuesbyaxis.get(new Integer(
128:                        CoordSystem.FIRST_YAXIS));
129:
130:                ChartUtilities.addDataToSet(set, numdata);
131:                trimSet(set);
132:                for (int i = 0; i < data.length; i++) {
133:                    this .data.add(new EditableDataSet(numdata[i],
134:                            ChartUtilities.transformArray(columns),
135:                            CoordSystem.FIRST_YAXIS, rows[i]));
136:                }
137:            }
138:
139:            /** Creates a new EditableChartDataModel using the
140:             * given array of EditableDataSets, effectively enabling the creation
141:             * of DataModels with differently sized DataSets.
142:             * @param ds the array of DataSets to be used.
143:             */
144:            public EditableChartDataModel(EditableDataSet[] ds) {
145:                super (ds);
146:            }
147:
148:            /** Sets the axis binding for a given DataSet.
149:             * @param set the DataSet
150:             * @param axis the Axis binding
151:             */
152:            public void setAxisBinding(int set, int axis) {
153:            }
154:
155:            /** Sets the value in a given DataSet.
156:             * @param set the DataSet in which the value should be set
157:             * @param index the index in the DataSet where the value should be stored
158:             * @param value the value object
159:             */
160:            public void setValueAt(int set, int index, Object value) {
161:            }
162:
163:            /** Inserts a value together with its column value at the right position. The
164:             * right index is determined by performing a binary search on the columns in the
165:             * DataSet. Fires a ChartDataModelChangedEvent.
166:             * @param set the DataSet in which the value should be set
167:             * @param value the value object
168:             * @param column the column value object
169:             */
170:            public void insertValue(int set, Object value, Object column) {
171:                ((EditableDataSet) data.get(set)).insertValue(value, column);
172:                columnSet.add(column);
173:                TreeSet treeset = (TreeSet) valuesbyaxis.get(new Integer(
174:                        getAxisBinding(set)));
175:                treeset.add(value);
176:                trimSet(treeset);
177:
178:                fireChartDataModelChangedEvent(this );
179:            }
180:
181:            /** Removes the value in a given DataSet.
182:             * @param set the DataSet in which the value should be set
183:             * @param index the index in the DataSet where the value should be stored
184:             */
185:            public void removeValueAt(int set, int index) {
186:            }
187:
188:            public void removeDataSet(int set) {
189:            }
190:
191:            public void addDataSet(EditableDataSet ds) {
192:            }
193:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.