Package com.metsci.glimpse.core.context
Class GlimpseContextImpl
- java.lang.Object
-
- com.metsci.glimpse.core.context.GlimpseContextImpl
-
- All Implemented Interfaces:
GlimpseContext
- Direct Known Subclasses:
WrappedGlimpseContext
public class GlimpseContextImpl extends Object implements GlimpseContext
-
-
Constructor Summary
Constructors Constructor Description GlimpseContextImpl(com.jogamp.opengl.GLContext context, float[] scale, int dpi)GlimpseContextImpl(GlimpseCanvas canvas)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetDPI()com.jogamp.opengl.GLgetGL()com.jogamp.opengl.GLContextgetGLContext()float[]getSurfaceScale()Returns the scale factors needed to convert the _native_ pixel coordinates to the _window_ pixel coordinates.GlimpseTargetStackgetTargetStack()TheGlimpseTargetStackstack contains the chain of nestedGlimpseTargets starting at the top levelGlimpseTarget(index 0) and ending at the GlimpseTarget currently being painted to.StringtoString()
-
-
-
Constructor Detail
-
GlimpseContextImpl
public GlimpseContextImpl(com.jogamp.opengl.GLContext context, float[] scale, int dpi)
-
GlimpseContextImpl
public GlimpseContextImpl(GlimpseCanvas canvas)
-
-
Method Detail
-
getGLContext
public com.jogamp.opengl.GLContext getGLContext()
- Specified by:
getGLContextin interfaceGlimpseContext- Returns:
- a reference to the OpenGL rendering context wrapped by this GlimpseContext
-
getGL
public com.jogamp.opengl.GL getGL()
- Specified by:
getGLin interfaceGlimpseContext- Returns:
- a convenience method shorthand for the common:
getGLContext( ).getGL( )
-
getTargetStack
public GlimpseTargetStack getTargetStack()
Description copied from interface:GlimpseContextTheGlimpseTargetStackstack contains the chain of nestedGlimpseTargets starting at the top levelGlimpseTarget(index 0) and ending at the GlimpseTarget currently being painted to.The top level GlimpseTarget is always an instance of GlimpseCanvas. The other levels are instances of
GlimpseLayout.- Specified by:
getTargetStackin interfaceGlimpseContext
-
getDPI
public int getDPI()
- Specified by:
getDPIin interfaceGlimpseContext- Returns:
- the ratio of pixels per inch for the current context
-
getSurfaceScale
public float[] getSurfaceScale()
Description copied from interface:GlimpseContextReturns 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:
getSurfaceScalein interfaceGlimpseContext- Returns:
- the scale factors as {scaleX, scaleY}
-
-