1 34 35 package org.krysalis.jcharts.properties; 36 37 38 import org.krysalis.jcharts.Chart; 39 import org.krysalis.jcharts.properties.util.ChartFont; 40 import org.krysalis.jcharts.properties.util.ChartStroke; 41 import org.krysalis.jcharts.test.HTMLGenerator; 42 import org.krysalis.jcharts.test.HTMLTestable; 43 import org.krysalis.jcharts.types.PieLabelType; 44 45 46 51 public class PieChart2DProperties extends ChartTypeProperties implements HTMLTestable 52 { 53 60 61 private ChartStroke borderChartStroke= ChartStroke.DEFAULT_PIE_OUTLINE; 62 63 64 private float zeroDegreeOffset = 20.0f; 66 67 private PieLabelType pieLabelType = PieLabelType.NO_LABELS; 68 private boolean isCurrency = false; 69 private boolean showGrouping = false; 70 private int roundingPowerOfTen = 0; 71 private ChartFont valueLabelFont = ChartFont.DEFAULT_PIE_VALUE; 72 private float tickLength = 5; 73 74 75 78 public PieChart2DProperties() 79 { 80 super(); 81 } 82 83 84 90 public void setZeroDegreeOffset( float zeroDegreeOffset ) 91 { 92 this.zeroDegreeOffset = zeroDegreeOffset; 93 } 94 95 96 100 public float getZeroDegreeOffset() 101 { 102 return this.zeroDegreeOffset; 103 } 104 105 106 public ChartStroke getBorderChartStroke() 107 { 108 return borderChartStroke; 109 } 110 111 112 public void setBorderChartStroke( ChartStroke borderChartStroke ) 113 { 114 this.borderChartStroke = borderChartStroke; 115 } 116 117 118 121 public PieLabelType getPieLabelType() 122 { 123 return pieLabelType; 124 } 125 126 127 133 public void setPieLabelType( PieLabelType pieLabelType ) 134 { 135 this.pieLabelType = pieLabelType; 136 } 137 138 139 public ChartFont getValueLabelFont() 140 { 141 return valueLabelFont; 142 } 143 144 145 150 public void setValueLabelFont( ChartFont valueLabelFont ) 151 { 152 this.valueLabelFont = valueLabelFont; 153 } 154 155 156 public void setCurrency( boolean currency ) 157 { 158 isCurrency = currency; 159 } 160 161 162 public void setShowGrouping( boolean showGrouping ) 163 { 164 this.showGrouping = showGrouping; 165 } 166 167 168 public void setRoundingPowerOfTen( int roundingPowerOfTen ) 169 { 170 this.roundingPowerOfTen = roundingPowerOfTen; 171 } 172 173 174 public void setTickLength( float tickLength ) 175 { 176 this.tickLength = tickLength; 177 } 178 179 180 public float getTickLength() 181 { 182 return tickLength; 183 } 184 185 186 public boolean showValueLabelCurrency() 187 { 188 return isCurrency; 189 } 190 191 192 public boolean showValueLabelGrouping() 193 { 194 return showGrouping; 195 } 196 197 198 public int getValueLabelRoundingPowerOfTen() 199 { 200 return roundingPowerOfTen; 201 } 202 203 204 209 public void toHTML( HTMLGenerator htmlGenerator ) 210 { 211 htmlGenerator.propertiesTableStart( "PieChart2DProperties" ); 212 htmlGenerator.addTableRow( "Zero Degree Offset", Double.toString( this.getZeroDegreeOffset() ) ); 213 htmlGenerator.addTableRow( "Border Chart Stroke", this.getBorderChartStroke() ); 214 htmlGenerator.addTableRow( "Label Type", this.pieLabelType ); 215 htmlGenerator.propertiesTableEnd(); 216 } 217 218 219 225 public void validate( Chart chart ) throws PropertyException 226 { 227 } 229 230 } 231 | Popular Tags |