001: /***********************************************************************************************
002: * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved.
003: *
004: * Redistribution and use of this software and associated documentation ("Software"), with or
005: * without modification, are permitted provided that the following conditions are met:
006: *
007: * 1. Redistributions of source code must retain copyright statements and notices.
008: * Redistributions must also contain a copy of this document.
009: *
010: * 2. Redistributions in binary form must reproduce the above copyright notice, this list of
011: * conditions and the following disclaimer in the documentation and/or other materials
012: * provided with the distribution.
013: *
014: * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote
015: * products derived from this Software without prior written permission of Nathaniel G.
016: * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net
017: *
018: * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear
019: * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a
020: * registered trademark of Nathaniel G. Auvil.
021: *
022: * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/).
023: *
024: * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY
025: * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
026: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
027: * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
028: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
029: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
030: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT
031: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
032: * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
033: ************************************************************************************************/package org.krysalis.jcharts.properties;
034:
035: import java.text.DecimalFormat;
036: import java.text.NumberFormat;
037:
038: import org.krysalis.jcharts.Chart;
039: import org.krysalis.jcharts.properties.util.ChartFont;
040: import org.krysalis.jcharts.test.HTMLGenerator;
041: import org.krysalis.jcharts.test.HTMLTestable;
042:
043: /*************************************************************************************
044: * Properties of a radar chart.
045: *
046: * @author Rami Hansenne
047: * @version $Id: RadarChartProperties.java,v 1.2 2003/08/08 02:40:54 nathaniel_auvil Exp $
048: * @since 1.0.0
049: ************************************************************************************/
050: final public class RadarChartProperties extends ChartTypeProperties
051: implements HTMLTestable {
052:
053: private boolean showGridLines = true;
054: private boolean fillRadar = true;
055: private double max = Double.NaN;
056: private double increment = Double.NaN;
057: private ChartFont axisLabelChartFont = ChartFont.DEFAULT_AXIS_TITLE;
058: private ChartFont titleChartFont = ChartFont.DEFAULT_CHART_TITLE;
059: private NumberFormat numberFormat = new DecimalFormat();
060:
061: public RadarChartProperties() {
062: super ();
063: numberFormat.setMaximumFractionDigits(2);
064: }
065:
066: public boolean getShowGridLines() {
067: return showGridLines;
068: }
069:
070: public void setShowGridLines(boolean showGridLines) {
071: this .showGridLines = showGridLines;
072: }
073:
074: public boolean getFillRadar() {
075: return fillRadar;
076: }
077:
078: public void setFillRadar(boolean fillRadar) {
079: this .fillRadar = fillRadar;
080: }
081:
082: public ChartFont getTitleChartFont() {
083: return titleChartFont;
084: }
085:
086: public void setTitleChartFont(ChartFont titleChartFont) {
087: this .titleChartFont = titleChartFont;
088: }
089:
090: public ChartFont getAxisLabelChartFont() {
091: return axisLabelChartFont;
092: }
093:
094: public void setAxisLabelChartFont(ChartFont axisLabelChartFont) {
095: this .axisLabelChartFont = axisLabelChartFont;
096: }
097:
098: public void setGridLabelFormat(NumberFormat format) {
099: if (format != null)
100: this .numberFormat = format;
101: }
102:
103: public NumberFormat getGridLabelFormat() {
104: return this .numberFormat;
105: }
106:
107: public double getScaleMaxValue() {
108: return this .max;
109: }
110:
111: public void setScaleMaxValue(double max) {
112: this .max = max;
113: }
114:
115: public double getScaleIncrement() {
116: return this .increment;
117: }
118:
119: public void setScaleIncrement(double increment) {
120: this .increment = increment;
121: }
122:
123: /*********************************************************************************************
124: * Enables the testing routines to display the contents of this Object.
125: *
126: * @param htmlGenerator
127: **********************************************************************************************/
128: public void toHTML(HTMLGenerator htmlGenerator) {
129: htmlGenerator.propertiesTableStart("RadarChartProperties");
130: htmlGenerator.addTableRow("Show gridlines", new Boolean(
131: this .showGridLines));
132: htmlGenerator.addTableRow("Fill radar", new Boolean(
133: this .fillRadar));
134: htmlGenerator.addTableRow("Scale max value", new Double(
135: this .max));
136: htmlGenerator.addTableRow("Scale increment", new Double(
137: this .increment));
138: htmlGenerator.propertiesTableEnd();
139: }
140:
141: /******************************************************************************************
142: * Validates the properties.
143: *
144: * @param chart
145: * @throws PropertyException
146: *****************************************************************************************/
147: public void validate(Chart chart) throws PropertyException {
148:
149: }
150:
151: }
|