Package org.jzy3d.plot3d.rendering.view
Class AWTNativeViewOverlay
- java.lang.Object
-
- org.jzy3d.plot3d.rendering.view.AWTNativeViewOverlay
-
- All Implemented Interfaces:
IViewOverlay
public class AWTNativeViewOverlay extends Object implements IViewOverlay
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.log4j.Logger
LOGGER
protected com.jogamp.opengl.util.awt.Overlay
overlay
protected Color
overlayBackground
-
Constructor Summary
Constructors Constructor Description AWTNativeViewOverlay()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
render(View view, ViewportConfiguration viewport, IPainter painter)
Renders all providedTooltip
s andAWTRenderer2d
s on top of the scene.
-
-
-
Field Detail
-
LOGGER
protected static org.apache.log4j.Logger LOGGER
-
overlay
protected com.jogamp.opengl.util.awt.Overlay overlay
-
overlayBackground
protected Color overlayBackground
-
-
Method Detail
-
render
public void render(View view, ViewportConfiguration viewport, IPainter painter)
Renders all providedTooltip
s andAWTRenderer2d
s on top of the scene. Due to the behaviour of theOverlay
implementation, Java2d geometries must be drawn relative to theChart
'sIScreenCanvas
, BUT will then be stretched to fit in theCamera
's viewport. This bug is very important to consider, since the Camera's viewport may not occupy the fullIScreenCanvas
. Indeed, when View is not maximized (like the default behaviour), the viewport remains square and centered in the canvas, meaning the Overlay won't cover the full canvas area. In other words, the following piece of code draws a border around theView
, and not around the complete chart canvas, although queried to occupy chart canvas dimensions: g2d.drawRect(1, 1, chart.getCanvas().getRendererWidth()-2, chart.getCanvas().getRendererHeight()-2);renderOverlay()
must be called while the OpenGL2 context for the drawable is current, and after the OpenGL2 scene has been rendered.- Specified by:
render
in interfaceIViewOverlay
-
-