我试图在jzy3d绘图库上做一个hello world应用程序。我从网站上拿了这个例子,当我运行它时出现以下错误:
线程“main”中的异常java.lang.RuntimeException:没有实现 例外
谁能告诉我这意味着什么?
以下是供您参考的代码:
import org.jzy3d.chart.Chart;
import org.jzy3d.chart.ChartLauncher;
import org.jzy3d.colors.Color;
import org.jzy3d.colors.ColorMapper;
import org.jzy3d.colors.colormaps.ColorMapRainbow;
import org.jzy3d.maths.Range;
import org.jzy3d.plot3d.builder.Builder;
import org.jzy3d.plot3d.builder.Mapper;
import org.jzy3d.plot3d.builder.concrete.OrthonormalGrid;
import org.jzy3d.plot3d.primitives.Shape;
import org.jzy3d.plot3d.rendering.canvas.Quality;
public class HelloWorld {
public static void main(String[] args) {
// Define a function to plot
Mapper mapper = new Mapper() {
public double f(double x, double y) {
return 10 * Math.sin(x / 10) * Math.cos(y / 20) * x;
}
};
// Define range and precision for the function to plot
Range range = new Range(-150, 150);
int steps = 50;
// Create a surface drawing that function
Shape surface = Builder.buildOrthonormal(new OrthonormalGrid(range, steps, range, steps), mapper);
surface.setColorMapper(new ColorMapper(new ColorMapRainbow(), surface.getBounds().getZmin(), surface.getBounds().getZmax(), new Color(1, 1, 1, .5f)));
surface.setFaceDisplayed(true);
surface.setWireframeDisplayed(false);
surface.setWireframeColor(Color.BLACK);
// Create a chart and add the surface
Chart chart = new Chart(Quality.Advanced);
chart.getScene().getGraph().add(surface);
ChartLauncher.openChart(chart);
}
}
错误:
线程“main”中的异常java.lang.RuntimeException:没有实现 例外 org.jzy3d.chart.factories.ChartComponentFactory.newFrame(ChartComponentFactory.java:148) 在org.jzy3d.chart.ChartLauncher.frame(ChartLauncher.java:82)at org.jzy3d.chart.ChartLauncher.openChart(ChartLauncher.java:39)at at org.jzy3d.chart.ChartLauncher.openChart(ChartLauncher.java:33)at at org.jzy3d.chart.ChartLauncher.openChart(ChartLauncher.java:17)at helloworld.HelloWorld.main(HelloWorld.java:77)
答案 0 :(得分:0)
也许这是图书馆本身的一个错误,我使用jzy3d 0.9.1也有同样的问题。等待新版本,我解决了问题切换到您可以从http://jzy3d.org/download-0.9.php下载的先前版本jzy3d 0.9。这对我有用,我希望它对你也有用。
最好的问候