请教高手:我编译程序出错?但可以运行用!请帮忙指出问题可能在哪个类或方法(在线)
housl 2002-10-12 04:13:37 javac -deprecation LineTest.java
LineTest.java :87:Warning:addIAxisChartDataSet(org.jcharts.chartData.interfaces.IAxisChartDataSet) in org.jcharts.chartData.DataSeries has been deprecated
dataSeries.addIAxisChartDataSet(iAxisChartDataSet);
1 warning
源代码LineTest.java
package sjk;
import java.awt.*;
import org.jCharts.chartData.*;
import org.jCharts.properties.*;
import org.jCharts.axisChart.*;
import org.jCharts.types.ChartType;
import org.jCharts.test.TestDataGenerator;
import java.io.FileOutputStream;
import java.io.IOException;
import java.awt.*;
import org.jCharts.Chart;
import org.jCharts.encoders.PNGEncoder1;
import java.awt.*;
import org.jCharts.chartData.*;
import org.jCharts.properties.*;
import org.jCharts.axisChart.*;
import org.jCharts.test.TestDataGenerator;
import org.jCharts.types.ChartType;
/************************************************************************************
*
*
*************************************************************************************/
public class Line
{
String[] xAxisLabels ;
String xAxisTitle;
String yAxisTitle;
String title;
String name;
double[][] data;
String[] legendLabels;
public void setxAxisLabels( String[] xAxisLabels)
{
this.xAxisLabels=xAxisLabels;
}
public void setxAxisTitle(String xaxistitle)
{
this.xAxisTitle=xaxistitle;
}
public void setyAxisTitle(String yaxistitle)
{
this.yAxisTitle=yaxistitle;
}
public void settitle(String title)
{
this.title=title;
}
public void setdata(double[][] data)
{
this.data=data;
}
public void setlegendLabels( String[] legendLabels)
{
this.legendLabels=legendLabels;
}
public void setname(String name)
{
this.name=name;
}
public void run() throws ChartDataException
{
this.strokes();
}
private void strokes() throws ChartDataException
{
DataSeries dataSeries = new DataSeries( xAxisLabels, xAxisTitle, yAxisTitle, title );
Stroke[] strokes= { LineChartProperties.DEFAULT_LINE_STROKE, LineChartProperties.DEFAULT_LINE_STROKE, LineChartProperties.DEFAULT_LINE_STROKE };
Shape[] shapes= { PointChartProperties.SHAPE_SQUARE,PointChartProperties.SHAPE_TRIANGLE,PointChartProperties.SHAPE_DIAMOND, PointChartProperties.SHAPE_CIRCLE };
LineChartProperties lineChartProperties = new LineChartProperties(strokes,shapes);
Paint[] paints= TestDataGenerator.getRandomPaints( data.length );
AxisChartDataSet axisChartDataSet= new AxisChartDataSet( data, legendLabels, paints, ChartType.LINE, lineChartProperties );
dataSeries.addIAxisChartDataSet( axisChartDataSet );
ChartProperties chartProperties= new ChartProperties();
AxisProperties axisProperties= new AxisProperties();
LegendProperties legendProperties= new LegendProperties();
AxisChart axisChart= new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, 500, 300 );
this.exportImage( axisChart, name );
}
void exportImage( Chart chart, String fileName )
{
String extension= ".png";
FileOutputStream fileOutputStream;
try
{
fileOutputStream= new FileOutputStream( fileName + extension );
PNGEncoder1.encode( chart, fileOutputStream );
fileOutputStream.flush();
fileOutputStream.close();
}
catch( IOException ioException )
{
ioException.printStackTrace();
}
}
}