@Override public Chart build(final Chart chart, AWTAbstractMouseSelector alternativeMouse) { this.chart = chart; this.mouseSelection = alternativeMouse; // Create and add controllers threadCamera = new CameraThreadController(chart); mouseCamera = new MyCameraMouse(chart); mouseCamera.addSlaveThreadController(threadCamera); chart.getCanvas().addKeyController(buildToggleKeyListener(chart)); releaseCam(); // default mode is selection messageRenderer = buildMessageRenderer(); getAWTChart(chart).addRenderer(messageRenderer); return chart; }
@Override public IFrame newFrame(Chart chart, Rectangle bounds, String title) { Object canvas = chart.getCanvas(); // Use reflexion to access AWT dependant classes // They will not be available for Android if (canvas.getClass().getName().equals("org.jzy3d.plot3d.rendering.canvas.CanvasAWT")) return newFrameAWT(chart, bounds, title, null); // FrameSWT works as // well else if (canvas instanceof CanvasNewtAwt) return newFrameAWT(chart, bounds, title, "[Newt]"); // FrameSWT // works as // well else if (canvas.getClass().getName().equals("org.jzy3d.plot3d.rendering.canvas.CanvasSwing")) return newFrameSwing(chart, bounds, title); else throw new RuntimeException( "No default frame could be found for the given Chart canvas: " + canvas.getClass()); }
public void dispose() { for (Chart chart : targets) { chart.getCanvas().removeMouseController(this); } super.dispose(); }
public void register(Chart chart) { super.register(chart); chart.getCanvas().addMouseController(this); }