Source Code Cross Referenced for PieChart.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 javax.swing.JFrame;
004:
005:        import net.sf.jmoney.model2.Session;
006:
007:        import org.jfree.chart.ChartFactory;
008:        import org.jfree.chart.ChartMouseEvent;
009:        import org.jfree.chart.ChartMouseListener;
010:        import org.jfree.chart.ChartPanel;
011:        import org.jfree.chart.JFreeChart;
012:        import org.jfree.chart.plot.PiePlot;
013:        import org.jfree.chart.title.TextTitle;
014:        import org.jfree.data.DefaultPieDataset;
015:
016:        /**
017:         * A simple PieChart
018:         * @author Faucheux
019:         */
020:        public abstract class PieChart extends JFrame implements 
021:                ChartMouseListener {
022:
023:            protected String title;
024:            protected String subTitle;
025:            protected Session session;
026:            public DefaultPieDataset data;
027:            protected JFreeChart chart;
028:
029:            /**
030:             * Default constructor.
031:             */
032:            public PieChart(String title, Session session) {
033:                super ();
034:
035:                this .title = title;
036:                this .session = session;
037:
038:            }
039:
040:            /**
041:             * Starting point for the panel.
042:             */
043:            public void run() {
044:                // create a dataset...
045:                data = new DefaultPieDataset();
046:
047:                // init the parameters
048:                initParameters();
049:
050:                // set the values
051:                createValues();
052:
053:                // create the chart...
054:                chart = ChartFactory.createPieChart(title, // chart title
055:                        data, // data
056:                        true, // include legend
057:                        false, // tooltips
058:                        false); // URL
059:                chart.addSubtitle(new TextTitle(subTitle));
060:
061:                /*
062:                // set the background color for the chart...
063:                chart.setBackgroundPaint(Color.yellow);
064:
065:                 */
066:
067:                // add the chart to a panel...
068:                ChartPanel chartPanel = new ChartPanel(chart);
069:                chartPanel.addChartMouseListener(this );
070:                this .getContentPane().add(chartPanel);
071:                this .pack();
072:                this .setVisible(true);
073:
074:            }
075:
076:            /**
077:             * initialize the parameters. This initialization will be called before "setValues"
078:             * @author Faucheux
079:             */
080:            protected void initParameters() {
081:            };
082:
083:            public ChartPanel getChartPanel() {
084:
085:                // create the chart...
086:                chart = ChartFactory.createPieChart(title, // chart title
087:                        data, // data
088:                        true, // include legend
089:                        false, // tooltips
090:                        false); // URL
091:                chart.setBorderVisible(true);
092:                PiePlot plot = (PiePlot) chart.getPlot();
093:                plot.setStartAngle(60);
094:
095:                // add the chart to a panel...
096:                ChartPanel chartPanel = new ChartPanel(chart);
097:
098:                return chartPanel;
099:            }
100:
101:            protected abstract void createValues();
102:
103:            public abstract void chartMouseClicked(ChartMouseEvent e);
104:
105:            public void chartMouseMoved(ChartMouseEvent e) {
106:                /* Nothing */
107:            }
108:
109:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.