KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > it > businesslogic > ireport > chart > MeterPlot


1 /*
2  * Copyright (C) 2005 - 2006 JasperSoft Corporation. All rights reserved.
3  * http://www.jaspersoft.com.
4  *
5  * Unless you have purchased a commercial license agreement from JasperSoft,
6  * the following license terms apply:
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as published by
10  * the Free Software Foundation.
11  *
12  * This program is distributed WITHOUT ANY WARRANTY; and without the
13  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
18  * or write to:
19  *
20  * Free Software Foundation, Inc.,
21  * 59 Temple Place - Suite 330,
22  * Boston, MA USA 02111-1307
23  *
24  *
25  *
26  *
27  * MeterPlot.java
28  *
29  * Created on 16 agosto 2005, 10.19
30  *
31  */

32
33 package it.businesslogic.ireport.chart;
34
35 import java.awt.Color JavaDoc;
36
37 /**
38  *
39  * @author Administrator
40  */

41 public class MeterPlot extends Plot{
42     
43     private String JavaDoc shape = "pie";
44     private int angle = 180;
45     private String JavaDoc units = "";
46     private double tickInterval = 10.0;
47     private java.awt.Color JavaDoc meterColor = null;
48     private java.awt.Color JavaDoc needleColor = null;
49     private java.awt.Color JavaDoc tickColor = null;
50     
51     private java.util.List JavaDoc meterIntervals = new java.util.ArrayList JavaDoc();
52     
53     private ValueDisplay valueDisplay = new ValueDisplay();
54     
55     private DataRange dataRange = new DataRange();
56     
57     
58     
59     /** Creates a new instance of PiePlot */
60     public MeterPlot() {
61     }
62   
63    
64     
65     public Plot cloneMe()
66     {
67         MeterPlot obj = new MeterPlot();
68         copyBasePlot(obj);
69         obj.setShape( new String JavaDoc(getShape()) );
70         obj.setAngle( getAngle() );
71         obj.setUnits( new String JavaDoc(getUnits()) );
72         obj.setTickInterval( getTickInterval() );
73         if (getTickColor() != null) obj.setTickColor( new Color JavaDoc( getTickColor().getRGB()) );
74         if (getNeedleColor() != null) obj.setNeedleColor( new Color JavaDoc( getNeedleColor().getRGB()) );
75         if (getMeterColor() != null) obj.setMeterColor( new Color JavaDoc( getMeterColor().getRGB()) );
76         obj.setValueDisplay( getValueDisplay().cloneMe() );
77         obj.setDataRange( getDataRange().cloneMe() );
78         
79         for (int i=0; i<getMeterIntervals().size(); ++i)
80         {
81             obj.getMeterIntervals().add( ((MeterInterval)getMeterIntervals().get(i)).cloneMe() );
82         }
83         
84         return obj;
85     }
86
87     public String JavaDoc getShape() {
88         return shape;
89     }
90
91     public void setShape(String JavaDoc shape) {
92         this.shape = shape;
93     }
94
95     public int getAngle() {
96         return angle;
97     }
98
99     public void setAngle(int angle) {
100         this.angle = angle;
101     }
102
103     public String JavaDoc getUnits() {
104         return units;
105     }
106
107     public void setUnits(String JavaDoc units) {
108         this.units = units;
109     }
110
111     public double getTickInterval() {
112         return tickInterval;
113     }
114
115     public void setTickInterval(double tickInterval) {
116         this.tickInterval = tickInterval;
117     }
118
119     public java.awt.Color JavaDoc getMeterColor() {
120         return meterColor;
121     }
122
123     public void setMeterColor(java.awt.Color JavaDoc meterColor) {
124         this.meterColor = meterColor;
125     }
126
127     public java.awt.Color JavaDoc getNeedleColor() {
128         return needleColor;
129     }
130
131     public void setNeedleColor(java.awt.Color JavaDoc needleColor) {
132         this.needleColor = needleColor;
133     }
134
135     public java.awt.Color JavaDoc getTickColor() {
136         return tickColor;
137     }
138
139     public void setTickColor(java.awt.Color JavaDoc tickColor) {
140         this.tickColor = tickColor;
141     }
142
143     public ValueDisplay getValueDisplay() {
144         return valueDisplay;
145     }
146
147     public void setValueDisplay(ValueDisplay valueDisplay) {
148         this.valueDisplay = valueDisplay;
149     }
150
151     public java.util.List JavaDoc getMeterIntervals() {
152         return meterIntervals;
153     }
154
155     public void setMeterIntervals(java.util.List JavaDoc meterIntervals) {
156         this.meterIntervals = meterIntervals;
157     }
158
159     public DataRange getDataRange() {
160         return dataRange;
161     }
162
163     public void setDataRange(DataRange dataRange) {
164         this.dataRange = dataRange;
165     }
166
167    
168 }
169
Popular Tags