KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > jasperreports > engine > JRChartPlot


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.engine;
29
30 import java.awt.Color JavaDoc;
31 import java.util.SortedSet JavaDoc;
32
33 import org.jfree.chart.plot.PlotOrientation;
34
35
36 /**
37  * Chart plots define chart appearance and display details such as colors, legend or labels. Each plot may have different
38  * characteristics, depending on the chart type it belongs to. This is the superinterface for all plots and contains common
39  * properties.
40  * @author Teodor Danciu (teodord@users.sourceforge.net)
41  * @version $Id: JRChartPlot.java 1393 2006-09-06 01:04:21 +0300 (Wed, 06 Sep 2006) bklawans $
42  */

43 public interface JRChartPlot
44 {
45
46
47     /**
48      * Gets the chart background color.
49      */

50     public Color JavaDoc getBackcolor();
51     
52     /**
53      * Sets the chart background color.
54      */

55     public void setBackcolor(Color JavaDoc backcolor);
56
57
58     /**
59      * Gets the plot orientation (horizontal or vertical).
60      */

61     public PlotOrientation getOrientation();
62     
63     /**
64      * Sets the plot orientation (horizontal or vertical).
65      */

66     public void setOrientation(PlotOrientation orientation);
67
68     /**
69      * Gets the transparency factor for this plot background. The range is from 0 to 1, where 0 means transparent and 1
70      * opaque. The default is 1.
71      * @return a float value between 0 and 1.
72      */

73     public float getBackgroundAlpha();
74     
75     /**
76      * Sets the transparency factor for this plot background. The range is from 0 to 1, where 0 means transparent and 1
77      * opaque. The default is 1.
78      */

79     public void setBackgroundAlpha(float backgroundAlpha);
80
81     /**
82      * Gets the transparency factor for this plot foreground. The range is from 0 to 1, where 0 means transparent and 1
83      * opaque. The default is 1.
84      * @return a float value between 0 and 1.
85      */

86     public float getForegroundAlpha();
87     
88     /**
89      * Sets the transparency factor for this plot foreground. The range is from 0 to 1, where 0 means transparent and 1
90      * opaque. The default is 1.
91      */

92     public void setForegroundAlpha(float foregroundAlpha);
93
94     /**
95      * Gets the angle in degrees to rotate the data axis labels. The range is -360 to 360. A positive value angles
96      * the label so it reads downwards wile a negative value angles the label so it reads upwards. Only charts that
97      * use a category based axis (such as line or bar charts) support label rotation.
98      */

99     public double getLabelRotation();
100     
101     /**
102      * Sets the angle in degrees to rotate the data axis labels. The range is -360 to 360. A positive value angles
103      * the label so it reads downwards wile a negative value angles the label so it reads upwards. Only charts that
104      * use a category based axis (such as line or bar charts) support label rotation.
105      */

106     public void setLabelRotation(double labelRotation);
107     
108     /**
109      * Returns a list of all the defined series colors. Every entry in the list is of type JRChartPlot.JRSeriesColor.
110      * If there are no defined series colors this method will return an empty list, not null.
111      */

112     public SortedSet JavaDoc getSeriesColors();
113     
114     /**
115      * Removes all defined series colors.
116      */

117     public void clearSeriesColors();
118     
119     /**
120      * Adds the specified series color to the plot.
121      */

122     public void addSeriesColor(JRSeriesColor seriesColor);
123     
124     /**
125      *
126      */

127     public void collectExpressions(JRExpressionCollector collector);
128
129     public interface JRSeriesColor
130     {
131         /**
132          * Returns the series order that this color applies to. The series order is relative to
133          * the series order of all other <code>JRSeriesColor</code>s defined for this plot. The
134          * relative ordering defines the order of the colors in the series.
135          */

136         public int getSeriesOrder();
137         
138         /**
139          * Returns the color to use for this series.
140          */

141         public Color JavaDoc getColor();
142     }
143 }
144
Popular Tags