Interface ICanvas

    • Field Detail

      • LAST_RENDER_TIME_UNDEFINED

        static final double LAST_RENDER_TIME_UNDEFINED
        See Also:
        Constant Field Values
      • ALLOW_WATCH_PIXEL_SCALE

        @Deprecated
        static final boolean ALLOW_WATCH_PIXEL_SCALE
        Deprecated.
        Temporary way of enabling/disabling a thread watching pixel scale change of a native canvas. Set to false if you encounter threading issues with a native Canvas.
        See Also:
        Constant Field Values
    • Method Detail

      • getView

        View getView()
        Returns a reference to the held view.
      • getRendererWidth

        int getRendererWidth()
        Returns the renderer's width, i.e. the display width.
      • getRendererHeight

        int getRendererHeight()
        Returns the renderer's height, i.e. the display height.
      • screenshot

        Object screenshot()
      • forceRepaint

        void forceRepaint()
        Invoked when a user requires the Canvas to be repainted (e.g. a non 3d layer has changed).
      • dispose

        void dispose()
        Performs all required cleanup when destroying a Canvas.
      • addMouseController

        void addMouseController​(Object o)
        A generic interface for mouse listener to remain Windowing toolkit independant. Implementation of this method should simply cast the input assuming it will correspond to canvas-compatible mouse listener.
      • addKeyController

        void addKeyController​(Object o)
        A generic interface for mouse listener to remain Windowing toolkit independant. Implementation of this method should simply cast the input assuming it will correspond to canvas-compatible mouse listener.
      • removeMouseController

        void removeMouseController​(Object o)
        A generic interface for key listener to remain Windowing toolkit independant. Implementation of this method should simply cast the input assuming it will correspond to canvas-compatible key listener.
      • removeKeyController

        void removeKeyController​(Object o)
        A generic interface for key listener to remain Windowing toolkit independant. * Implementation of this method should simply cast the input assuming it will correspond to canvas-compatible key listener.
      • getDebugInfo

        String getDebugInfo()
      • setPixelScale

        void setPixelScale​(float[] scale)
        Defines pixel scale. On MacOS Retina displays, a X*Y chart uses a (X*2)*(Y*2) viewport. This makes some calculation based on viewport (such as Camera.screenToModel(IPainter, org.jzy3d.maths.Coord3d) output wrong result. When running on Retina display, those two options fixed buggy mouse selections on Retina:
        • setPixelScale(new float[]{0.5f,0.5f})
        • setPixelScale(new float[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE })
        • getPixelScale

          Coord2d getPixelScale()
          Provide pixel scale as feasible by the Hardware, OS, and JVM, independently of what was asked by setPixelScale(float[]). Hence the two functions may not be consistent together.
        • getLastRenderingTimeMs

          double getLastRenderingTimeMs()
        • removeCanvasListener

          void removeCanvasListener​(ICanvasListener listener)