Documentation of 'org.jzy3d.plot3d.rendering.canvas.CanvasAWT' Java class
CanvasAWT
org.jzy3d.plot3d.rendering.canvas

Class CanvasAWT

  • All Implemented Interfaces:
    com.jogamp.nativewindow.awt.AWTPrintLifecycle, com.jogamp.nativewindow.NativeSurfaceHolder, com.jogamp.nativewindow.OffscreenLayerOption, 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, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, ICanvas, IScreenCanvas


    public class CanvasAWT
    extends com.jogamp.opengl.awt.GLCanvas
    implements IScreenCanvas
    CanvasAWT is a base implementation that primarily allows to integrate a Jzy3d chart in an AWT application. Relying on JOGL's GLPanel, this canvas can actually be used in AWT, Swing, as well as SWT through org.jzy3d.bridge.swt.Bridge.adapt(swt,awt).
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.BaselineResizeBehavior
      • Nested classes/interfaces inherited from interface com.jogamp.nativewindow.WindowClosingProtocol

        com.jogamp.nativewindow.WindowClosingProtocol.WindowClosingMode
      • Nested classes/interfaces inherited from interface com.jogamp.nativewindow.awt.AWTPrintLifecycle

        com.jogamp.nativewindow.awt.AWTPrintLifecycle.Context
    • Field Summary

      • Fields inherited from class java.awt.Component

        BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface com.jogamp.nativewindow.awt.AWTPrintLifecycle

        DEFAULT_PRINT_TILE_SIZE
      • Fields inherited from interface com.jogamp.opengl.GLAutoDrawable

        SCREEN_CHANGE_ACTION_ENABLED
      • Fields inherited from interface com.jogamp.nativewindow.ScalableSurface

        AUTOMAX_PIXELSCALE, IDENTITY_PIXELSCALE
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addKeyController(java.lang.Object o)
      A generic interface for mouse listener to remain Windowing toolkit independant.
      void addMouseController(java.lang.Object o)
      A generic interface for mouse listener to remain Windowing toolkit independant.
      void dispose()
      Performs all required cleanup when destroying a Canvas.
      void forceRepaint()
      Invoked when a user requires the Canvas to be repainted (e.g.
      java.lang.String getDebugInfo() 
      com.jogamp.opengl.GLDrawable getDrawable()
      Returns the GLDrawable associated with the canvas
      Renderer3d getRenderer() 
      int getRendererHeight()
      Provide the actual renderer height for the open gl camera settings, which is obtained after a resize event.
      int getRendererWidth()
      Provide the actual renderer width for the open gl camera settings, which is obtained after a resize event.
      View getView()
      Provide a reference to the View that renders into this canvas.
      void removeKeyController(java.lang.Object o)
      A generic interface for key listener to remain Windowing toolkit independant.
      void removeMouseController(java.lang.Object o)
      A generic interface for key listener to remain Windowing toolkit independant.
      com.jogamp.opengl.util.texture.TextureData screenshot()
      Returns an image with the current renderer's size
      com.jogamp.opengl.util.texture.TextureData screenshot(java.io.File file) 
      void setPixelScale(float[] scale)
      Defines pixel scale.
      void triggerMouseEvent(java.awt.event.MouseEvent e) 
      void triggerMouseMotionEvent(java.awt.event.MouseEvent e) 
      void triggerMouseWheelEvent(java.awt.event.MouseWheelEvent e) 
      • Methods inherited from class com.jogamp.opengl.awt.GLCanvas

        addGLEventListener, addGLEventListener, addNotify, areAllGLEventListenerInitialized, createContext, destroy, display, disposeGLEventListener, flushGLRunnables, getAnimator, getAutoSwapBufferMode, getChosenGLCapabilities, getContext, getContextCreationFlags, getCurrentSurfaceScale, getDefaultCloseOperation, getDelegatedDrawable, getExclusiveContextThread, getFactory, getGL, getGLEventListener, getGLEventListenerCount, getGLEventListenerInitState, getGLProfile, getGraphicsConfiguration, getHandle, getMaximumSurfaceScale, getMinimumSurfaceScale, getNativeSurface, getRequestedGLCapabilities, getRequestedSurfaceScale, getShallUseOffscreenLayer, getSurfaceHeight, getSurfaceWidth, getUpstreamLock, getUpstreamWidget, invoke, invoke, isGLOriented, isOffscreenLayerSurfaceEnabled, isRealized, isThreadGLCapable, main, paint, print, releasePrint, removeGLEventListener, removeNotify, reshape, setAnimator, setAutoSwapBufferMode, setContext, setContextCreationFlags, setDefaultCloseOperation, setExclusiveContextThread, setGL, setGLEventListenerInitState, setRealized, setShallUseOffscreenLayer, setSharedAutoDrawable, setSharedContext, setSurfaceScale, setupPrint, swapBuffers, toString, update
      • Methods inherited from class java.awt.Canvas

        createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.jogamp.opengl.awt.AWTGLAutoDrawable

        repaint, setSize
      • Methods inherited from interface com.jogamp.opengl.awt.ComponentEvents

        addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener
    • Method Detail

      • setPixelScale

        public void setPixelScale(float[] scale)
        Description copied from interface: ICanvas
        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(com.jogamp.opengl.GL, com.jogamp.opengl.glu.GLU, 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 })
          Specified by:
          setPixelScale in interface ICanvas
          See Also:
          ScalableSurface#setSurfaceScale(float[])} in JOGL javadoc for more informations
        • dispose

          public void dispose()
          Description copied from interface: ICanvas
          Performs all required cleanup when destroying a Canvas.
          Specified by:
          dispose in interface ICanvas
        • getDebugInfo

          public java.lang.String getDebugInfo()
          Specified by:
          getDebugInfo in interface ICanvas
        • forceRepaint

          public void forceRepaint()
          Description copied from interface: ICanvas
          Invoked when a user requires the Canvas to be repainted (e.g. a non 3d layer has changed).
          Specified by:
          forceRepaint in interface ICanvas
        • screenshot

          public com.jogamp.opengl.util.texture.TextureData screenshot(java.io.File file)
                                                                throws java.io.IOException
          Specified by:
          screenshot in interface ICanvas
          Throws:
          java.io.IOException
        • screenshot

          public com.jogamp.opengl.util.texture.TextureData screenshot()
          Description copied from interface: ICanvas
          Returns an image with the current renderer's size
          Specified by:
          screenshot in interface ICanvas
        • triggerMouseEvent

          public void triggerMouseEvent(java.awt.event.MouseEvent e)
        • triggerMouseMotionEvent

          public void triggerMouseMotionEvent(java.awt.event.MouseEvent e)
        • triggerMouseWheelEvent

          public void triggerMouseWheelEvent(java.awt.event.MouseWheelEvent e)
        • addMouseController

          public void addMouseController(java.lang.Object o)
          Description copied from interface: ICanvas
          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.
          Specified by:
          addMouseController in interface ICanvas
        • addKeyController

          public void addKeyController(java.lang.Object o)
          Description copied from interface: ICanvas
          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.
          Specified by:
          addKeyController in interface ICanvas
        • removeMouseController

          public void removeMouseController(java.lang.Object o)
          Description copied from interface: ICanvas
          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.
          Specified by:
          removeMouseController in interface ICanvas
        • removeKeyController

          public void removeKeyController(java.lang.Object o)
          Description copied from interface: ICanvas
          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.
          Specified by:
          removeKeyController in interface ICanvas
        • getDrawable

          public com.jogamp.opengl.GLDrawable getDrawable()
          Description copied from interface: ICanvas
          Returns the GLDrawable associated with the canvas
          Specified by:
          getDrawable in interface ICanvas
        • 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

    DMelt 3.0 © DataMelt by jWork.ORG

    You see the box below because you did not login.