Source Code Cross Referenced for AbstractChart.java in  » Chart » charting-0.94 » de » progra » charting » 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 
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:            AbstractChart.java
021:            Created on 22. Juni 2001, 00:05
022:         */
023:
024:        package de.progra.charting;
025:
026:        import de.progra.charting.event.ChartDataModelListener;
027:        import de.progra.charting.render.AbstractChartRenderer;
028:        import de.progra.charting.render.AbstractRenderer;
029:        import de.progra.charting.render.RowColorModel;
030:        import java.awt.Rectangle;
031:        import java.awt.Graphics2D;
032:        import de.progra.charting.model.ChartDataModel;
033:        import java.util.Map;
034:        import java.util.HashMap;
035:        import java.util.Iterator;
036:
037:        /** Implements the standard getter and setter methods for a chart.
038:         * @author mueller
039:         * @version 1.0
040:         */
041:        public abstract class AbstractChart extends AbstractRenderer implements 
042:                Chart {
043:
044:            protected HashMap renderer = new HashMap();
045:
046:            protected Rectangle bounds;
047:            protected Legend legend;
048:            protected CoordSystem coord;
049:            protected Title title;
050:            protected RowColorModel rcModel;
051:
052:            protected ChartDataModel model;
053:
054:            /** Creates new AbstractChart */
055:            public AbstractChart() {
056:            }
057:
058:            /** Adds a ChartRenderer with a specific z-coordinate.
059:             * @param render the ChartRenderer
060:             * @param z the z-coordinate, the highest coordinate is in front.
061:             */
062:            public void addChartRenderer(AbstractChartRenderer render, int z) {
063:                renderer.put(new Integer(z), render);
064:                render.setRowColorModel(rcModel);
065:            }
066:
067:            /** Returns the Map of all ChartRenderers.
068:             * @return a <CODE>java.util.Map</CODE> with all ChartRenderers
069:             */
070:            public Map getChartRenderer() {
071:                return renderer;
072:            }
073:
074:            /** Returns the ChartRenderer with a specific z-coordinate.
075:             * @param z the z-coordinate
076:             * @return the ChartRenderer or null.
077:             */
078:            public AbstractChartRenderer getChartRenderer(int z) {
079:                return (AbstractChartRenderer) renderer.get(new Integer(z));
080:            }
081:
082:            /** Returns the coordinate system.
083:             * @return a CoordSystem object or null if there is none.
084:             */
085:            public CoordSystem getCoordSystem() {
086:                return coord;
087:            }
088:
089:            /** Returns this chart's legend.
090:             * @return the Legend object.
091:             */
092:            public Legend getLegend() {
093:                return legend;
094:            }
095:
096:            /** Returns the title for this chart.
097:             * @return a Title object.
098:             */
099:            public Title getTitle() {
100:                return title;
101:            }
102:
103:            /** Returns the RowColorModel for this chart.
104:             * @return a RowColorModel object.
105:             */
106:            public RowColorModel getRowColorModel() {
107:                return rcModel;
108:            }
109:
110:            /** Sets the Map with all ChartRenderers. The keys
111:             * have to be the z-coordinates of the ChartRenderers.
112:             * @param render a <CODE>java.util.Map</CODE> with all ChartRenderers.
113:             */
114:            public void setChartRenderer(Map render) {
115:                Iterator i = render.values().iterator();
116:                int z = 0;
117:                while (i.hasNext()) {
118:                    addChartRenderer((AbstractChartRenderer) i.next(), z);
119:                }
120:            }
121:
122:            /** Sets the coordinate system for this chart,
123:             * which can be null if the ChartRenderer
124:             * doesn't need a coordinate system, e.g. if it's a
125:             * PieChart.
126:             * @param c the CoordSystem object
127:             */
128:            public void setCoordSystem(CoordSystem c) {
129:                coord = c;
130:            }
131:
132:            /** Sets the legend for this chart.
133:             * @param l the Legend
134:             */
135:            public void setLegend(Legend l) {
136:                legend = l;
137:            }
138:
139:            /** Sets the title for this chart.
140:             * @param t the Title object
141:             */
142:            public void setTitle(Title t) {
143:                title = t;
144:            }
145:
146:            /** Sets the RowColorModel for this chart.
147:             * @param rcm the new RowColorModel
148:             */
149:            public void setRowColorModel(RowColorModel rcm) {
150:                this .rcModel = rcm;
151:            }
152:
153:            /** Stores the ChartDataModel for this Chart.
154:             * @param model the ChartDataModel
155:             */
156:            public void setChartDataModel(ChartDataModel model) {
157:                this .model = model;
158:            }
159:
160:            /** Returns the ChartDataModel.
161:             * @return the ChartDataModel for the Chart
162:             */
163:            public ChartDataModel getChartDataModel() {
164:                return model;
165:            }
166:
167:            /** Sets the Bounds for this Chart. This is important for rendering the chart and
168:             * always has to be done before rendering.
169:             * @param r the <CODE>Rectangle</CODE> object defining this chart's bounds.
170:             */
171:            public void setBounds(Rectangle r) {
172:                this .bounds = r;
173:            }
174:
175:            /** Returns the Bounds for the Chart.
176:             * @return a <CODE>Rectangle</CODE> object defining this chart's bounds.
177:             */
178:            public Rectangle getBounds() {
179:                return bounds;
180:            }
181:
182:            /** This method is called by the paint method to do the actual painting.
183:             * The painting is supposed to start at point (0,0) and the size is
184:             * always the same as the preferred size. The paint method performs
185:             * the possible scaling.
186:             * @param g the <CODE>Graphics2D</CODE> object to paint in.
187:             */
188:            public void paintDefault(Graphics2D g) {
189:            }
190:
191:            /** Does the layout of the title, legend and coordinate system and
192:             * calls the render method of all those including the ChartRenderers.
193:             * @param g the <CODE>Graphics2D</CODE> object to paint in.
194:             */
195:            public void render(Graphics2D g) {
196:            }
197:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.