Class CanvasSwing

  • All Implemented Interfaces:
    com.jogamp.nativewindow.awt.AWTPrintLifecycle, com.jogamp.nativewindow.NativeSurfaceHolder, com.jogamp.nativewindow.ScalableSurface, com.jogamp.nativewindow.WindowClosingProtocol, com.jogamp.opengl.awt.AWTGLAutoDrawable, com.jogamp.opengl.awt.ComponentEvents, com.jogamp.opengl.GLAutoDrawable, com.jogamp.opengl.GLDrawable, com.jogamp.opengl.GLSharedContextSetter, ImageObserver, MenuContainer, Serializable, Accessible, ICanvas, INativeCanvas, IScreenCanvas

    public class CanvasSwing
    extends com.jogamp.opengl.awt.GLJPanel
    implements IScreenCanvas, INativeCanvas
    Author:
    Martin Pernollet
    See Also:
    Serialized Form
    • Constructor Detail

      • CanvasSwing

        public CanvasSwing​(IChartFactory factory,
                           org.jzy3d.plot3d.rendering.scene.Scene scene,
                           Quality quality,
                           com.jogamp.opengl.GLCapabilitiesImmutable glci)
        Initialize a Canvas3d attached to a Scene, with a given rendering Quality.
    • Method Detail

      • watchPixelScale

        protected void watchPixelScale()
      • setPixelScale

        public void setPixelScale​(float[] scale)
        Specified by:
        setPixelScale in interface ICanvas
      • getPixelScale

        public org.jzy3d.maths.Coord2d getPixelScale()
        Pixel scale is used to model the pixel ratio thay may be introduced by HiDPI or Retina displays.
        Specified by:
        getPixelScale in interface ICanvas
      • getPixelScaleJVM

        public org.jzy3d.maths.Coord2d getPixelScaleJVM()
        Specified by:
        getPixelScaleJVM in interface ICanvas
      • getPixelScaleX

        public double getPixelScaleX()
      • getPixelScaleY

        public double getPixelScaleY()
      • dispose

        public void dispose()
        Specified by:
        dispose in interface ICanvas
      • forceRepaint

        public void forceRepaint()
        Force repaint and ensure that GL2 rendering will occur in the GUI thread, wherever the caller stands.
        Specified by:
        forceRepaint in interface ICanvas
      • getDrawable

        public com.jogamp.opengl.GLAutoDrawable getDrawable()
        Specified by:
        getDrawable in interface INativeCanvas
      • getView

        public View getView()
        Provide a reference to the View that renders into this canvas.
        Specified by:
        getView in interface ICanvas
      • getRendererWidth

        public int getRendererWidth()
        Provide the actual renderer width for the open gl camera settings, which is obtained after a resize event.
        Specified by:
        getRendererWidth in interface ICanvas
      • getRendererHeight

        public int getRendererHeight()
        Provide the actual renderer height for the open gl camera settings, which is obtained after a resize event.
        Specified by:
        getRendererHeight in interface ICanvas
      • getDimension

        public org.jzy3d.maths.Dimension getDimension()
        Specified by:
        getDimension in interface ICanvas
      • firePixelScaleChanged

        protected void firePixelScaleChanged​(double pixelScaleX,
                                             double pixelScaleY)
      • isNative

        public boolean isNative()
        Specified by:
        isNative in interface ICanvas
      • getExporter

        public org.jzy3d.io.AWTImageExporter getExporter()
      • setExporter

        public void setExporter​(org.jzy3d.io.AWTImageExporter exporter)