KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > jasperreports > charts > JRMeterPlot


1 /*
2  * ============================================================================
3  * GNU Lesser General Public License
4  * ============================================================================
5  *
6  * JasperReports - Free Java report-generating library.
7  * Copyright (C) 2001-2006 JasperSoft Corporation http://www.jaspersoft.com
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
22  *
23  * JasperSoft Corporation
24  * 303 Second Street, Suite 450 North
25  * San Francisco, CA 94107
26  * http://www.jaspersoft.com
27  */

28 package net.sf.jasperreports.charts;
29
30 import net.sf.jasperreports.charts.JRDataRange;
31 import net.sf.jasperreports.charts.JRValueDisplay;
32 import net.sf.jasperreports.engine.JRChartPlot;
33
34 import java.awt.Color JavaDoc;
35 import java.util.List JavaDoc;
36
37
38 /**
39  * Represents the display options of a Meter Chart. A meter chart consists of a dial,
40  * a needle pointing to the current value on the dial, and the value itself. The Meter
41  * can be broken up into shaded regions to highlight portions of the range.
42  *
43  * @author Barry Klawans (bklawans@users.sourceforge.net)
44  * @version $Id: JRMeterPlot.java 1385 2006-09-06 00:29:03 +0300 (Wed, 06 Sep 2006) bklawans $
45  */

46 public interface JRMeterPlot extends JRChartPlot
47 {
48     /**
49      * The portion of the circle described by the Meter that is not occupied by the
50      * Meter is drawn as a chord. (A straight line connects the ends.)
51      */

52     public static final byte SHAPE_CHORD = 0;
53     
54     /**
55      * The portion of the circle described by the Meter that is not occupied by the
56      * Meter is drawn as a circle.
57      */

58     public static final byte SHAPE_CIRCLE = 1;
59
60     /**
61      * The portion of the circle described by the Meter that is not occupied by the
62      * Meter is not drawn.
63      */

64     public static final byte SHAPE_PIE = 2;
65     
66     /**
67      * Returns the range of values that the Meter can display.
68      *
69      * @return the range of values that the Meter can display
70      */

71     public JRDataRange getDataRange();
72     
73     /**
74      * Returns a description of how the value of the Meter is displayed. This includes
75      * any font and color information, the location of the value, a formatting mask and
76      * an optional "units" string to append to the value.
77      *
78      * @return a description of how the value of the Meter is displayed.
79      */

80     public JRValueDisplay getValueDisplay();
81     
82     /**
83      * Returns the shape of the Meter. The shape is only relevant if the Meter face is
84      * over 180 degrees wide, and controls how the portiong of the circle described by the
85      * Meter but outside of the Meter is drawn. (If the meter is 240 degrees wide the shape
86      * setting controls how the remaining 120 degrees is displayed.)
87      * <br><br>
88      * The value returned is one of the <code>SHAPE_</code> constants defined in this class.
89      *
90      * @return a description of how the value of the Meter is displayed.
91      */

92     public byte getShape();
93     
94     /**
95      * Returns a list of all the intervals contained in this Meter. The return value is never
96      * <code>null</code> but can be an empty list. Each element in the list is a
97      * {@link net.sf.jasperreports.charts.util.JRMeterInterval <code>net.sf.jasperreports.charts.util.JRMeterInterval</code>}
98      *
99      * @return a list of all the intervals contained in this Meter
100      */

101     public List JavaDoc getIntervals();
102
103     /**
104      * Returns the size of the Meter face in degrees.
105      *
106      * @return the size of the Meter face in degrees
107      */

108     public int getMeterAngle();
109     
110     /**
111      * Returns the name of the units that the Meter is displaying. This value will be
112      * appended to the value when displayed.
113      *
114      * @return the name of the units that the Meter is displaying
115      */

116     public String JavaDoc getUnits();
117     
118     /**
119      * Returns the spacing between the ticks on the face of the meter. The spacing is relative
120      * to the range that the meter is displaying - if the range is 0 to 500 and the tick interval
121      * is 50 then 10 ticks will be displayed.
122      *
123      * @return the spacing between the ticks on the face of the meter
124      */

125     public double getTickInterval();
126     
127     /**
128      * Returns the background color of the meter. This is the color of the meter's face.
129      *
130      * @return the background color of the meter.
131      */

132     public Color JavaDoc getMeterBackgroundColor();
133     
134     /**
135      * Returns the color used when drawing the meter's pointer.
136      *
137      * @return the color used when drawing the meter's pointer
138      */

139     public Color JavaDoc getNeedleColor();
140     
141     /**
142      * Returns the color used when drawing tick marks on the meter.
143      *
144      * @return the color used when drawing tick marks on the meter
145      */

146     public Color JavaDoc getTickColor();
147 }
148
Popular Tags