KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > krysalis > jcharts > properties > RadarChartProperties


1 /***********************************************************************************************
2  * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved.
3  *
4  * Redistribution and use of this software and associated documentation ("Software"), with or
5  * without modification, are permitted provided that the following conditions are met:
6  *
7  * 1. Redistributions of source code must retain copyright statements and notices.
8  * Redistributions must also contain a copy of this document.
9  *
10  * 2. Redistributions in binary form must reproduce the above copyright notice, this list of
11  * conditions and the following disclaimer in the documentation and/or other materials
12  * provided with the distribution.
13  *
14  * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote
15  * products derived from this Software without prior written permission of Nathaniel G.
16  * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net
17  *
18  * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear
19  * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a
20  * registered trademark of Nathaniel G. Auvil.
21  *
22  * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/).
23  *
24  * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY
25  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
26  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
27  * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT
31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
32  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
33  ************************************************************************************************/

34
35 package org.krysalis.jcharts.properties;
36
37
38 import java.text.DecimalFormat JavaDoc;
39 import java.text.NumberFormat JavaDoc;
40
41 import org.krysalis.jcharts.Chart;
42 import org.krysalis.jcharts.properties.util.ChartFont;
43 import org.krysalis.jcharts.test.HTMLGenerator;
44 import org.krysalis.jcharts.test.HTMLTestable;
45
46
47 /*************************************************************************************
48  * Properties of a radar chart.
49  *
50  * @author Rami Hansenne
51  * @version $Id: RadarChartProperties.java,v 1.2 2003/08/08 02:40:54 nathaniel_auvil Exp $
52  * @since 1.0.0
53  ************************************************************************************/

54 final public class RadarChartProperties extends ChartTypeProperties implements HTMLTestable
55 {
56
57     private boolean showGridLines = true;
58     private boolean fillRadar = true;
59     private double max = Double.NaN;
60     private double increment = Double.NaN;
61     private ChartFont axisLabelChartFont = ChartFont.DEFAULT_AXIS_TITLE;
62     private ChartFont titleChartFont = ChartFont.DEFAULT_CHART_TITLE;
63     private NumberFormat JavaDoc numberFormat = new DecimalFormat JavaDoc();
64
65
66     public RadarChartProperties()
67     {
68         super();
69         numberFormat.setMaximumFractionDigits( 2 );
70     }
71
72
73     public boolean getShowGridLines()
74     {
75         return showGridLines;
76     }
77
78
79     public void setShowGridLines( boolean showGridLines )
80     {
81         this.showGridLines = showGridLines;
82     }
83
84
85     public boolean getFillRadar()
86     {
87         return fillRadar;
88     }
89
90
91     public void setFillRadar( boolean fillRadar )
92     {
93         this.fillRadar = fillRadar;
94     }
95
96
97     public ChartFont getTitleChartFont()
98     {
99         return titleChartFont;
100     }
101
102
103     public void setTitleChartFont( ChartFont titleChartFont )
104     {
105         this.titleChartFont = titleChartFont;
106     }
107
108
109     public ChartFont getAxisLabelChartFont()
110     {
111         return axisLabelChartFont;
112     }
113
114
115     public void setAxisLabelChartFont( ChartFont axisLabelChartFont )
116     {
117         this.axisLabelChartFont = axisLabelChartFont;
118     }
119
120
121     public void setGridLabelFormat( NumberFormat JavaDoc format )
122     {
123         if( format != null )
124             this.numberFormat = format;
125     }
126
127
128     public NumberFormat JavaDoc getGridLabelFormat()
129     {
130         return this.numberFormat;
131     }
132
133
134     public double getScaleMaxValue()
135     {
136         return this.max;
137     }
138
139
140     public void setScaleMaxValue( double max )
141     {
142         this.max = max;
143     }
144
145
146     public double getScaleIncrement()
147     {
148         return this.increment;
149     }
150
151
152     public void setScaleIncrement( double increment )
153     {
154         this.increment = increment;
155     }
156
157
158     /*********************************************************************************************
159      * Enables the testing routines to display the contents of this Object.
160      *
161      * @param htmlGenerator
162      **********************************************************************************************/

163     public void toHTML( HTMLGenerator htmlGenerator )
164     {
165         htmlGenerator.propertiesTableStart( "RadarChartProperties" );
166         htmlGenerator.addTableRow( "Show gridlines", new Boolean JavaDoc( this.showGridLines ) );
167         htmlGenerator.addTableRow( "Fill radar", new Boolean JavaDoc( this.fillRadar ) );
168         htmlGenerator.addTableRow( "Scale max value", new Double JavaDoc( this.max ) );
169         htmlGenerator.addTableRow( "Scale increment", new Double JavaDoc( this.increment ) );
170         htmlGenerator.propertiesTableEnd();
171     }
172
173
174     /******************************************************************************************
175      * Validates the properties.
176      *
177      * @param chart
178      * @throws PropertyException
179      *****************************************************************************************/

180     public void validate( Chart chart ) throws PropertyException
181     {
182
183     }
184
185 }
186
Popular Tags