1 34 35 package org.krysalis.jcharts.properties; 36 37 38 import java.text.DecimalFormat ; 39 import java.text.NumberFormat ; 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 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 numberFormat = new DecimalFormat (); 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 format ) 122 { 123 if( format != null ) 124 this.numberFormat = format; 125 } 126 127 128 public NumberFormat 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 163 public void toHTML( HTMLGenerator htmlGenerator ) 164 { 165 htmlGenerator.propertiesTableStart( "RadarChartProperties" ); 166 htmlGenerator.addTableRow( "Show gridlines", new Boolean ( this.showGridLines ) ); 167 htmlGenerator.addTableRow( "Fill radar", new Boolean ( this.fillRadar ) ); 168 htmlGenerator.addTableRow( "Scale max value", new Double ( this.max ) ); 169 htmlGenerator.addTableRow( "Scale increment", new Double ( this.increment ) ); 170 htmlGenerator.propertiesTableEnd(); 171 } 172 173 174 180 public void validate( Chart chart ) throws PropertyException 181 { 182 183 } 184 185 } 186 | Popular Tags |