Package com.metsci.glimpse.core.canvas
Interface GlimpseCanvas
-
- All Superinterfaces:
GlimpseTarget
- All Known Subinterfaces:
NewtGlimpseCanvas
- All Known Implementing Classes:
AbstractGlimpseCanvas
,FBOGlimpseCanvas
,NewtSwingEDTGlimpseCanvas
,NewtSwingGlimpseCanvas
,SwingGlimpseCanvas
,SwingLightweightGlimpseCanvas
public interface GlimpseCanvas extends GlimpseTarget
A heavy weight target for Glimpse rendering. Represents the base component onto which all Glimpse rendering is ultimately performed. GlimpseCanvas provides a facade that hides the implementation details of the specific widget toolkit (e.g. Swing, SWT) being used, allowing most Glimpse applications to be easily ported between the two.- Author:
- ulman
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
addDisposeListener(com.jogamp.opengl.GLRunnable runnable)
Called whenGLEventListener.dispose(GLAutoDrawable)
event is fired by theGLAutoDrawable
associated with the GlimpseCanvas.void
destroy()
Destroys the native surface which this canvas draws to.void
dispose()
A convenience method which is equivalent to:disposeAttached( ); destroy( );
void
disposeAttached()
Disposes native resources of GlimpseLayouts and GlimpsePainters associated with the GlimpseCanvas.void
disposePainter(GlimpsePainter painter)
CallsGlimpsePainter.dispose(GlimpseContext)
the next time the GLContext associated with this GlimpseCanvas is active.default int
getDpi()
Returns the ratio of pixels-per-inch for this canvas.com.jogamp.opengl.GLContext
getGLContext()
com.jogamp.opengl.GLAutoDrawable
getGLDrawable()
GlimpseContext
getGlimpseContext()
com.jogamp.opengl.GLProfile
getGLProfile()
float[]
getSurfaceScale()
Returns the scale factors needed to convert the _native_ pixel coordinates to the _window_ pixel coordinates.GlimpseBounds
getTargetBounds()
boolean
isDestroyed()
void
paint()
Lays out anyGlimpseLayout
instances attached to the GlimpseCanvas and paints allGlimpsePainter
instances attached to the GlimpseLayouts.-
Methods inherited from interface com.metsci.glimpse.core.context.GlimpseTarget
addLayout, addLayout, getTargetBounds, getTargetChildren, isEventConsumer, isEventGenerator, isVisible, removeAllLayouts, removeLayout, setEventConsumer, setEventGenerator, setLookAndFeel, setZOrder
-
-
-
-
Method Detail
-
getGLProfile
com.jogamp.opengl.GLProfile getGLProfile()
-
getGLDrawable
com.jogamp.opengl.GLAutoDrawable getGLDrawable()
-
getGLContext
com.jogamp.opengl.GLContext getGLContext()
-
getGlimpseContext
GlimpseContext getGlimpseContext()
-
getTargetBounds
GlimpseBounds getTargetBounds()
-
paint
void paint()
Lays out anyGlimpseLayout
instances attached to the GlimpseCanvas and paints allGlimpsePainter
instances attached to the GlimpseLayouts.
-
destroy
void destroy()
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()
.- See Also:
disposeAttached()
-
disposeAttached
void disposeAttached()
Disposes native resources of GlimpseLayouts and GlimpsePainters associated with the GlimpseCanvas.- See Also:
destroy()
-
dispose
void dispose()
A convenience method which is equivalent to:disposeAttached( ); destroy( );
-
disposePainter
void disposePainter(GlimpsePainter painter)
Calls
GlimpsePainter.dispose(GlimpseContext)
the next time the GLContext associated with this GlimpseCanvas is active. Generally this call is equivalent to:this.getGLDrawable( ).invoke( false, new GLRunnable( ) {
-
isDestroyed
boolean isDestroyed()
- Returns:
- whether or not
#dispose()
has been successfully called. Once true, this GlimpseCanvas is no longer valid for rendering.
-
addDisposeListener
void addDisposeListener(com.jogamp.opengl.GLRunnable runnable)
Called whenGLEventListener.dispose(GLAutoDrawable)
event is fired by theGLAutoDrawable
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.
-
getSurfaceScale
float[] getSurfaceScale()
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.- Returns:
- the scale factors as {scaleX, scaleY}
-
getDpi
default int getDpi()
Returns the ratio of pixels-per-inch for this canvas.
-
-