| 1 39 40 package org.krysalis.jcharts.properties; 41 42 43 import java.awt.BasicStroke ; 44 import java.awt.Stroke ; 45 46 import org.krysalis.jcharts.chartData.interfaces.IAxisPlotDataSet; 47 import org.krysalis.jcharts.test.HTMLGenerator; 48 49 50 public final class StockChartProperties extends AxisChartTypeProperties 51 { 52 public static final Stroke DEFAULT_STROKE= new BasicStroke ( 1.5f ); 53 54 private Stroke hiLowStroke; 55 56 private Stroke openStroke; 57 private int openLength; 58 59 private Stroke closeStroke; 60 private int closeLength; 61 62 63 67 public StockChartProperties() 68 { 69 this.hiLowStroke = DEFAULT_STROKE; 70 this.openStroke = DEFAULT_STROKE; 71 this.openLength = 5; 72 this.closeStroke = DEFAULT_STROKE; 73 this.closeLength = 5; 74 } 75 76 77 85 public StockChartProperties( Stroke hiLowStroke, 86 Stroke openStroke, 87 int openPixelLength, 88 Stroke closeStroke, 89 int closePixelLength ) 90 { 91 this.hiLowStroke = hiLowStroke; 92 this.openStroke = openStroke; 93 this.openLength = openPixelLength; 94 this.closeStroke = closeStroke; 95 this.closeLength = closePixelLength; 96 } 97 98 99 103 public Stroke getHiLowStroke() 104 { 105 return this.hiLowStroke; 106 } 107 108 109 113 public void setHiLowStroke( Stroke stroke ) 114 { 115 this.hiLowStroke = stroke; 116 } 117 118 119 123 public Stroke getOpenStroke() 124 { 125 return this.openStroke; 126 } 127 128 129 133 public void setOpenStroke( Stroke stroke ) 134 { 135 this.openStroke = stroke; 136 } 137 138 139 143 public int getOpenPixelLength() 144 { 145 return this.openLength; 146 } 147 148 149 153 public void setOpenPixelLength( int pixelLength ) 154 { 155 this.openLength = pixelLength; 156 } 157 158 159 163 public Stroke getCloseStroke() 164 { 165 return this.closeStroke; 166 } 167 168 169 173 public void setCloseStroke( Stroke stroke ) 174 { 175 this.closeStroke = stroke; 176 } 177 178 179 183 public int getClosePixelLength() 184 { 185 return this.closeLength; 186 } 187 188 189 193 public void setClosePixelLength( int pixelLength ) 194 { 195 this.closeLength = pixelLength; 196 } 197 198 199 205 public void validate( IAxisPlotDataSet iAxisPlotDataSet ) throws PropertyException 206 { 207 210 } 211 212 213 218 public void toHTML( HTMLGenerator htmlGenerator ) 219 { 220 htmlGenerator.propertiesTableStart( "StockChartProperties" ); 221 htmlGenerator.addTableRow( "HiLow Stroke", this.hiLowStroke ); 222 htmlGenerator.addTableRow( "Open Stroke", this.openStroke ); 223 htmlGenerator.addTableRow( "Open Length", Integer.toString( this.openLength ) ); 224 htmlGenerator.addTableRow( "Close Stroke", this.closeStroke ); 225 htmlGenerator.addTableRow( "Close Length", Integer.toString( this.closeLength ) ); 226 htmlGenerator.propertiesTableEnd(); 227 } 228 229 230 } 231 | Popular Tags |