Package org.jzy3d.chart.factories
Class NativePainterFactory
- java.lang.Object
-
- org.jzy3d.chart.factories.NativePainterFactory
-
- All Implemented Interfaces:
IPainterFactory
- Direct Known Subclasses:
AWTPainterFactory
,NewtPainterFactory
,SWTPainterFactory
public abstract class NativePainterFactory extends Object implements IPainterFactory
-
-
Field Summary
Fields Modifier and Type Field Description protected com.jogamp.opengl.GLCapabilities
capabilities
protected IChartFactory
chartFactory
protected boolean
debugGL
protected int
height
protected boolean
offscreen
protected boolean
traceGL
protected int
width
-
Constructor Summary
Constructors Constructor Description NativePainterFactory()
Initialize a factory with a default desiredGLCapabilities
defined bygetDefaultCapabilities(GLProfile)
based on the detectedGLProfile
, eitherGLProfile.GL2
orGLProfile.GL2ES2
ifGLProfile.GL2
is not available.NativePainterFactory(com.jogamp.opengl.GLCapabilities capabilities)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static com.jogamp.opengl.GLProfile
detectGLProfile()
OPENGL PROFILE AND CAPABILITIES HELPERScom.jogamp.opengl.GLCapabilities
getCapabilities()
Return desired Open GL CapabilitiesIChartFactory
getChartFactory()
static com.jogamp.opengl.GLCapabilities
getDefaultCapabilities(com.jogamp.opengl.GLProfile glp)
static com.jogamp.opengl.GLCapabilities
getOffscreenCapabilities(com.jogamp.opengl.GLProfile glp)
This profile has prove to fix the fact that using a raw GLCapabilities without settings let screenshot as gray onlyDimension
getOffscreenDimension()
boolean
isDebugGL()
boolean
isOffscreen()
boolean
isTraceGL()
NativeAnimator
newAnimator(ICanvas canvas)
IPainter
newPainter()
Renderer3d
newRenderer3D(View view)
Only needed byINativeCanvas
SymbolHandler
newSymbolHandler(IImageWrapper image)
void
setChartFactory(IChartFactory chartFactory)
void
setDebugGL(boolean debugGL)
If true, will let GL triggerGLException
if an error occur in OpenGL which ease debugging.void
setOffscreen(int width, int height)
Set the painter factory with the offscreen image dimension will configureCapabilities.setOnscreen(boolean)
properly and let inheriting painters they should useOffscreenCanvas
instead of theICanvas
they use by default for display.void
setOffscreen(Rectangle rectangle)
void
setOffscreenDisabled()
void
setTraceGL(boolean traceGL)
If true, will enable GL code tracing in console.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jzy3d.chart.factories.IPainterFactory
newCanvas, newFrame, newFrame, newKeyboardCameraController, newKeyboardScreenshotController, newMouseCameraController, newMousePickingController, newViewOverlay, newViewportLayout
-
-
-
-
Field Detail
-
chartFactory
protected IChartFactory chartFactory
-
capabilities
protected com.jogamp.opengl.GLCapabilities capabilities
-
offscreen
protected boolean offscreen
-
width
protected int width
-
height
protected int height
-
traceGL
protected boolean traceGL
-
debugGL
protected boolean debugGL
-
-
Constructor Detail
-
NativePainterFactory
public NativePainterFactory()
Initialize a factory with a default desiredGLCapabilities
defined bygetDefaultCapabilities(GLProfile)
based on the detectedGLProfile
, eitherGLProfile.GL2
orGLProfile.GL2ES2
ifGLProfile.GL2
is not available. If none of these profile is available, anUnsupportedOperationException
is thrown.
-
NativePainterFactory
public NativePainterFactory(com.jogamp.opengl.GLCapabilities capabilities)
-
-
Method Detail
-
getCapabilities
public com.jogamp.opengl.GLCapabilities getCapabilities()
Return desired Open GL Capabilities
-
newRenderer3D
public Renderer3d newRenderer3D(View view)
Only needed byINativeCanvas
-
newPainter
public IPainter newPainter()
- Specified by:
newPainter
in interfaceIPainterFactory
-
newAnimator
public NativeAnimator newAnimator(ICanvas canvas)
- Specified by:
newAnimator
in interfaceIPainterFactory
-
newSymbolHandler
public SymbolHandler newSymbolHandler(IImageWrapper image)
- Specified by:
newSymbolHandler
in interfaceIPainterFactory
-
getChartFactory
public IChartFactory getChartFactory()
- Specified by:
getChartFactory
in interfaceIPainterFactory
-
setChartFactory
public void setChartFactory(IChartFactory chartFactory)
- Specified by:
setChartFactory
in interfaceIPainterFactory
-
isOffscreen
public boolean isOffscreen()
- Specified by:
isOffscreen
in interfaceIPainterFactory
-
setOffscreenDisabled
public void setOffscreenDisabled()
- Specified by:
setOffscreenDisabled
in interfaceIPainterFactory
-
setOffscreen
public void setOffscreen(int width, int height)
Set the painter factory with the offscreen image dimension will configureCapabilities.setOnscreen(boolean)
properly and let inheriting painters they should useOffscreenCanvas
instead of theICanvas
they use by default for display.- Specified by:
setOffscreen
in interfaceIPainterFactory
-
setOffscreen
public void setOffscreen(Rectangle rectangle)
- Specified by:
setOffscreen
in interfaceIPainterFactory
-
getOffscreenDimension
public Dimension getOffscreenDimension()
- Specified by:
getOffscreenDimension
in interfaceIPainterFactory
-
detectGLProfile
public static com.jogamp.opengl.GLProfile detectGLProfile()
OPENGL PROFILE AND CAPABILITIES HELPERS
-
getOffscreenCapabilities
public static com.jogamp.opengl.GLCapabilities getOffscreenCapabilities(com.jogamp.opengl.GLProfile glp)
This profile has prove to fix the fact that using a raw GLCapabilities without settings let screenshot as gray only
-
getDefaultCapabilities
public static com.jogamp.opengl.GLCapabilities getDefaultCapabilities(com.jogamp.opengl.GLProfile glp)
-
isTraceGL
public boolean isTraceGL()
-
setTraceGL
public void setTraceGL(boolean traceGL)
If true, will enable GL code tracing in console. Default is false. This is equivalent to enabling the JVM flag-Djogl.debug.TraceGLGL
-
isDebugGL
public boolean isDebugGL()
- Specified by:
isDebugGL
in interfaceIPainterFactory
-
setDebugGL
public void setDebugGL(boolean debugGL)
If true, will let GL triggerGLException
if an error occur in OpenGL which ease debugging. Default is false. This is equivalent to enabling the JVM flag-Djogl.debug.DebugGL
- Specified by:
setDebugGL
in interfaceIPainterFactory
-
-