1 39 40 package org.krysalis.jcharts.properties; 41 42 43 import org.krysalis.jcharts.chartData.interfaces.IAxisPlotDataSet; 44 import org.krysalis.jcharts.test.HTMLGenerator; 45 46 import java.awt.*; 47 48 49 final public class ScatterPlotProperties extends AxisChartTypeProperties 50 { 51 public static final Stroke DEFAULT_LINE_STROKE=new BasicStroke( 1.5f ); 52 53 private Stroke[] lineStrokes; 54 private Shape[] shapes; 55 56 57 65 public ScatterPlotProperties( Stroke[] lineStrokes, Shape[] shapes ) 66 { 67 this.lineStrokes=lineStrokes; 68 this.shapes=shapes; 69 } 70 71 72 public Stroke[] getLineStrokes() 73 { 74 return this.lineStrokes; 75 } 76 77 78 public Shape[] getShapes() 79 { 80 return this.shapes; 81 } 82 83 84 89 public void toHTML( HTMLGenerator htmlGenerator ) 90 { 91 htmlGenerator.propertiesTableStart( "ScatterPlotProperties" ); 92 htmlGenerator.propertiesTableEnd(); 94 } 95 96 97 103 public void validate( IAxisPlotDataSet iAxisPlotDataSet ) throws PropertyException 104 { 105 if( this.lineStrokes == null ) 106 { 107 throw new PropertyException( "You must define Stroke Objects for the LineChart in the LineChartProperties Object." ); 108 } 109 else 110 { 111 if( iAxisPlotDataSet.getNumberOfDataSets() != this.lineStrokes.length ) 112 { 113 throw new PropertyException( "You must define a Stroke Object for each Line in the LineChart." ); 114 } 115 116 if( this.shapes != null ) 117 { 118 if( this.shapes.length != this.lineStrokes.length ) 119 { 120 throw new PropertyException( "The number of Shapes defined in the LineChartProperties Object must equal the number of Lines." ); 121 } 122 } 123 } 124 } 125 126 } 127 | Popular Tags |