Source Code Cross Referenced for JRBaseMeterPlot.java in  » Report » jasperreports-2.0.1 » net » sf » jasperreports » charts » base » 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 » Report » jasperreports 2.0.1 » net.sf.jasperreports.charts.base 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * ============================================================================
003:         * GNU Lesser General Public License
004:         * ============================================================================
005:         *
006:         * JasperReports - Free Java report-generating library.
007:         * Copyright (C) 2001-2006 JasperSoft Corporation http://www.jaspersoft.com
008:         *
009:         * This library is free software; you can redistribute it and/or
010:         * modify it under the terms of the GNU Lesser General Public
011:         * License as published by the Free Software Foundation; either
012:         * version 2.1 of the License, or (at your option) any later version.
013:         *
014:         * This library is distributed in the hope that it will be useful,
015:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
016:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
017:         * Lesser General Public License for more details.
018:         *
019:         * You should have received a copy of the GNU Lesser General Public
020:         * License along with this library; if not, write to the Free Software
021:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA.
022:         *
023:         * JasperSoft Corporation
024:         * 303 Second Street, Suite 450 North
025:         * San Francisco, CA 94107
026:         * http://www.jaspersoft.com
027:         */
028:        package net.sf.jasperreports.charts.base;
029:
030:        import net.sf.jasperreports.charts.JRDataRange;
031:        import net.sf.jasperreports.charts.JRMeterPlot;
032:        import net.sf.jasperreports.charts.JRValueDisplay;
033:        import net.sf.jasperreports.charts.base.JRBaseDataRange;
034:        import net.sf.jasperreports.charts.util.JRMeterInterval;
035:        import net.sf.jasperreports.charts.base.JRBaseValueDisplay;
036:        import net.sf.jasperreports.engine.JRChart;
037:        import net.sf.jasperreports.engine.JRChartPlot;
038:        import net.sf.jasperreports.engine.JRConstants;
039:        import net.sf.jasperreports.engine.JRExpressionCollector;
040:        import net.sf.jasperreports.engine.base.JRBaseChartPlot;
041:        import net.sf.jasperreports.engine.base.JRBaseObjectFactory;
042:
043:        import java.awt.Color;
044:        import java.util.Iterator;
045:        import java.util.List;
046:
047:        /**
048:         * An immutable representation of the layout of a Meter chart.
049:         *
050:         * @author Barry Klawans (bklawans@users.sourceforge.net)
051:         * @version $Id: JRBaseMeterPlot.java 1793 2007-07-30 09:06:18Z teodord $
052:         */
053:        public class JRBaseMeterPlot extends JRBaseChartPlot implements 
054:                JRMeterPlot {
055:
056:            /**
057:             *
058:             */
059:            private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
060:
061:            /**
062:             * The range displayed by the Meter.
063:             */
064:            protected JRDataRange dataRange = null;
065:
066:            /**
067:             * Formatting information for the textual display of the value.
068:             */
069:            protected JRValueDisplay valueDisplay = null;
070:
071:            /**
072:             * The shape to use when drawing the Meter. Only applied if the meter is
073:             * over 180 degrees wide and less than a full circle.
074:             */
075:            protected byte shape = JRMeterPlot.SHAPE_PIE;
076:
077:            /**
078:             * The defined intervals for the Meter.  Each interval indicates a
079:             * subsection of the meter and a color to use for that section.
080:             */
081:            protected List intervals = new java.util.ArrayList();
082:
083:            /**
084:             * The extend of the meter face in degrees.  It will always be centered
085:             * around the straight up position.
086:             */
087:            protected int meterAngle = 180;
088:
089:            /**
090:             * Optional description of what the meter is displaying.  It will be
091:             * appended to the textual representation of the value.
092:             */
093:            protected String units = null;
094:
095:            /**
096:             * How often to draw ticks around the face of the meter.  The interval
097:             * is relative to the meter range - if the meter displays 100 to 200 and
098:             * the tickInterval is 20, there will be 4 ticks at 120, 140, 160 and 180.
099:             */
100:            protected double tickInterval = 10.0;
101:
102:            /**
103:             * The color to use for the face of the meter.
104:             */
105:            protected Color meterBackgroundColor = null;
106:
107:            /**
108:             * The color to use for the pointer on the meter.
109:             */
110:            protected Color needleColor = null;
111:
112:            /**
113:             * The color to use for each tick on the face of the meter.
114:             */
115:            protected Color tickColor = null;
116:
117:            /**
118:             * Constructs a copy of an existing meter.
119:             *
120:             * @param meterPlot the meter to copy
121:             */
122:            public JRBaseMeterPlot(JRChartPlot meterPlot, JRChart chart) {
123:                super (meterPlot, chart);
124:            }
125:
126:            /**
127:             * Constructs a copy of an existing meter and registers all expressions
128:             * maintained by the meter plot with a factory.
129:             *
130:             * @param meterPlot the meter to copy
131:             * @param factory the factory to register expressions with
132:             */
133:            public JRBaseMeterPlot(JRMeterPlot meterPlot,
134:                    JRBaseObjectFactory factory) {
135:                super (meterPlot, factory);
136:
137:                dataRange = new JRBaseDataRange(meterPlot.getDataRange(),
138:                        factory);
139:                valueDisplay = new JRBaseValueDisplay(meterPlot
140:                        .getValueDisplay(), factory);
141:                shape = meterPlot.getShape();
142:                List origIntervals = meterPlot.getIntervals();
143:                intervals.clear();
144:                if (origIntervals != null) {
145:                    Iterator iter = origIntervals.iterator();
146:                    while (iter.hasNext()) {
147:                        JRMeterInterval interval = (JRMeterInterval) iter
148:                                .next();
149:                        intervals.add(new JRMeterInterval(interval, factory));
150:                    }
151:                }
152:
153:                meterAngle = meterPlot.getMeterAngle();
154:                units = meterPlot.getUnits();
155:                tickInterval = meterPlot.getTickInterval();
156:
157:                meterBackgroundColor = meterPlot.getMeterBackgroundColor();
158:                needleColor = meterPlot.getNeedleColor();
159:                tickColor = meterPlot.getTickColor();
160:            }
161:
162:            /**
163:             *
164:             */
165:            public JRDataRange getDataRange() {
166:                return dataRange;
167:            }
168:
169:            /**
170:             *
171:             */
172:            public JRValueDisplay getValueDisplay() {
173:                return valueDisplay;
174:            }
175:
176:            /**
177:             *
178:             */
179:            public byte getShape() {
180:                return shape;
181:            }
182:
183:            /**
184:             *
185:             */
186:            public List getIntervals() {
187:                return intervals;
188:            }
189:
190:            /**
191:             *
192:             */
193:            public int getMeterAngle() {
194:                return meterAngle;
195:            }
196:
197:            /**
198:             *
199:             */
200:            public String getUnits() {
201:                return units;
202:            }
203:
204:            /**
205:             *
206:             */
207:            public double getTickInterval() {
208:                return tickInterval;
209:            }
210:
211:            /**
212:             *
213:             */
214:            public Color getMeterBackgroundColor() {
215:                return meterBackgroundColor;
216:            }
217:
218:            /**
219:             *
220:             */
221:            public Color getNeedleColor() {
222:                return needleColor;
223:            }
224:
225:            /**
226:             *
227:             */
228:            public Color getTickColor() {
229:                return tickColor;
230:            }
231:
232:            /**
233:             * Adds all the expression used by this plot with the specified collector.
234:             * All collected expression that are also registered with a factory will
235:             * be included with the report is compiled.
236:             *
237:             * @param collector the expression collector to use
238:             */
239:            public void collectExpressions(JRExpressionCollector collector) {
240:                collector.collect(this);
241:            }
242:
243:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.