Class NewtSwingGlimpseCanvas

    • Constructor Detail

      • NewtSwingGlimpseCanvas

        @Deprecated
        public NewtSwingGlimpseCanvas​(com.jogamp.opengl.GLProfile glProfile,
                                      com.jogamp.opengl.GLContext context)
        Deprecated.
        Use NewtSwingGlimpseCanvas(GLContext) instead. The context implicitly provides a GLProfile.
      • NewtSwingGlimpseCanvas

        public NewtSwingGlimpseCanvas​(com.jogamp.opengl.GLProfile glProfile)
      • NewtSwingGlimpseCanvas

        public NewtSwingGlimpseCanvas​(String profile)
      • NewtSwingGlimpseCanvas

        public NewtSwingGlimpseCanvas​(com.jogamp.opengl.GLContext context)
      • NewtSwingGlimpseCanvas

        public NewtSwingGlimpseCanvas()
    • Method Detail

      • getCanvas

        public com.jogamp.newt.awt.NewtCanvasAWT getCanvas()
      • getGLDrawable

        public com.jogamp.opengl.GLAutoDrawable getGLDrawable()
        Specified by:
        getGLDrawable in interface GlimpseCanvas
      • addLayout

        public void addLayout​(GlimpseLayout layout)
        Description copied from interface: GlimpseTarget
        Adds a sub-layout to this GlimpseTarget which will only paint in a region of this GlimpseTarget based on its layout constraints. This same GlimpseLayout may be a child of any number of different GlimpseTargets.
        Specified by:
        addLayout in interface GlimpseTarget
      • removeAllLayouts

        public void removeAllLayouts()
        Description copied from interface: GlimpseTarget
        Clears the canvas, removing all attached GlimpseLayouts.
        Specified by:
        removeAllLayouts in interface GlimpseTarget
      • getDimension

        public Dimension getDimension()
      • isEventConsumer

        public boolean isEventConsumer()
        Description copied from interface: GlimpseTarget
        Sets whether this GlimpseTarget hides events from GlimpseTargets under it. This value does not determine whether or not the GlimpseTarget will generate GlimpseMouseEvents (see {@link #isEventGenerator()).
        Specified by:
        isEventConsumer in interface GlimpseTarget
        Returns:
        whether this target hides events from targets under it
      • setEventConsumer

        public void setEventConsumer​(boolean consume)
        Description copied from interface: GlimpseTarget
        Set whether or not this GlimpseTarget will consume or pass through mouse events.
        Specified by:
        setEventConsumer in interface GlimpseTarget
      • isEventGenerator

        public boolean isEventGenerator()
        Description copied from interface: GlimpseTarget
        Sets whether this GlimpseTarget generates GlimpseMouseEvents. This value does not determine whether or not GlimpseTargets underneath this GlimpseTarget will also generate GlimpseMouseEvents (see GlimpseTarget.isEventConsumer()).
        Specified by:
        isEventGenerator in interface GlimpseTarget
        Returns:
        whether this target will generate GlimpseMouseEvents
      • setEventGenerator

        public void setEventGenerator​(boolean generate)
        Description copied from interface: GlimpseTarget
        Set whether or not this GlimpseTarget will generate GlimpseMouseEvents.
        Specified by:
        setEventGenerator in interface GlimpseTarget
      • destroy

        public void destroy()
        Description copied from interface: GlimpseCanvas
        Destroys the native surface which this canvas draws to. Does not dispose of GL resources associated with GlimpsePainters and GlimpseLayouts attached to the GlimpseCanvas (as these may be attached to other GlimpseCanvases as well). Disposing of Glimpse resources can be done via #disposeAttached().
        Specified by:
        destroy in interface GlimpseCanvas
        See Also:
        GlimpseCanvas.disposeAttached()
      • isDestroyed

        public boolean isDestroyed()
        Specified by:
        isDestroyed in interface GlimpseCanvas
        Returns:
        whether or not #dispose() has been successfully called. Once true, this GlimpseCanvas is no longer valid for rendering.
      • addDisposeListener

        public void addDisposeListener​(com.jogamp.opengl.GLRunnable runnable)
        Description copied from interface: GlimpseCanvas
        Called when GLEventListener.dispose(GLAutoDrawable) event is fired by the GLAutoDrawable associated with the GlimpseCanvas. This can happen for reasons other than the window containing the GlimpseCanvas being closed (for example, moving the window between physical monitors or moving the container between docks in a docking framework). Thus, GlimpsePainters and GlimpseLayouts attached to this GlimpseCanvas should generally not be disposed when this callback occurs.
        Specified by:
        addDisposeListener in interface GlimpseCanvas
      • dispose

        public void dispose()
        Description copied from interface: GlimpseCanvas
        A convenience method which is equivalent to: disposeAttached( ); destroy( );
        Specified by:
        dispose in interface GlimpseCanvas
      • getSurfaceScale

        public float[] getSurfaceScale()
        Description copied from interface: GlimpseCanvas
        Returns the scale factors needed to convert the _native_ pixel coordinates to the _window_ pixel coordinates. This only really matters on displays like like Macbook Retina.
        Specified by:
        getSurfaceScale in interface GlimpseCanvas
        Returns:
        the scale factors as {scaleX, scaleY}
      • getDpi

        public int getDpi()
        Description copied from interface: GlimpseCanvas
        Returns the ratio of pixels-per-inch for this canvas.
        Specified by:
        getDpi in interface GlimpseCanvas