简体   繁体   中英

Simple Jzy3d application gives runtime exception - No implemented exception

I attempted to do a hello world application on jzy3d plotting library. I took the example from the website and when I run it I got the following error:

Exception in thread "main" java.lang.RuntimeException: No implemented exception

Can anyone tell me what this means?

Here is the code for your reference:

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);

}
}

Error:

Exception in thread "main" java.lang.RuntimeException: No implemented exception at org.jzy3d.chart.factories.ChartComponentFactory.newFrame(ChartComponentFactory.java:148) at org.jzy3d.chart.ChartLauncher.frame(ChartLauncher.java:82) at org.jzy3d.chart.ChartLauncher.openChart(ChartLauncher.java:39) at org.jzy3d.chart.ChartLauncher.openChart(ChartLauncher.java:33) at org.jzy3d.chart.ChartLauncher.openChart(ChartLauncher.java:17) at helloworld.HelloWorld.main(HelloWorld.java:77)

maybe this is a bug of the library itself, I had the same issue using jzy3d 0.9.1. Waiting for a new release, I solved the problem switching to the previous version jzy3d 0.9 that you can download from http://jzy3d.org/download-0.9.php . That worked for me, I hope it will work for you as well.

Best Regards

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM