1 39 40 package org.krysalis.jcharts.properties; 41 42 43 import org.krysalis.jcharts.properties.util.ChartFont; 44 import org.krysalis.jcharts.test.HTMLGenerator; 45 import org.krysalis.jcharts.test.HTMLTestable; 46 47 import java.lang.reflect.Field ; 48 49 50 public class ChartProperties extends AreaProperties implements HTMLTestable 51 { 52 public ChartFont titleChartFont = ChartFont.DEFAULT_CHART_TITLE; 53 54 private float titlePadding = 5f; 56 57 private boolean validate = true; 59 60 private boolean useAntiAliasing= true; 61 62 63 67 public ChartFont getTitleFont() 68 { 69 return this.titleChartFont; 70 } 71 72 73 public void setTitleFont( ChartFont titleFont ) 74 { 75 this.titleChartFont = titleFont; 76 } 77 78 79 84 public float getTitlePadding() 85 { 86 return this.titlePadding; 87 } 88 89 90 public void setTitlePadding( float pixels ) 91 { 92 this.titlePadding = pixels; 93 } 94 95 96 101 public boolean validate() 102 { 103 return validate; 104 } 105 106 107 114 public void setValidate( boolean validate ) 115 { 116 this.validate = validate; 117 } 118 119 120 125 public boolean useAntiAliasing() 126 { 127 return useAntiAliasing; 128 } 129 130 131 139 public void setUseAntiAliasing( boolean useAntiAliasing ) 140 { 141 this.useAntiAliasing = useAntiAliasing; 142 } 143 144 145 150 public void toHTML( HTMLGenerator htmlGenerator ) 151 { 152 htmlGenerator.propertiesTableStart( this.getClass().getName() ); 153 super.toHTML( htmlGenerator ); 154 155 Field [] fields = this.getClass().getDeclaredFields(); 156 for( int i = 0; i < fields.length; i++ ) 157 { 158 try 159 { 160 htmlGenerator.addField( fields[ i ].getName(), fields[ i ].get( this ) ); 161 } 162 catch( IllegalAccessException illegalAccessException ) 163 { 164 illegalAccessException.printStackTrace(); 165 } 166 } 167 168 htmlGenerator.propertiesTableEnd(); 169 170 171 179 } 180 181 } 182 | Popular Tags |