public class AWTView extends ChartView
Modifier and Type | Field and Description |
---|---|
protected BufferedImage |
bgImg |
protected Color |
bgOverlay |
protected AWTImageViewport |
bgViewport |
protected com.jogamp.opengl.util.awt.Overlay |
overlay |
protected List<Renderer2d> |
renderers |
protected List<ITooltipRenderer> |
tooltips |
annotations, axe, axeBoxDisplayed, bgColor, boundmode, cam, cameraMode, canvas, center, chart, current, DEFAULT_VIEW, dimensionDirty, DISPLAY_AXE_WHOLE_BOUNDS, factorViewPointDistance, glu, initBounds, MAINTAIN_ALL_OBJECTS_IN_VIEW, PI_div2, quality, scaling, scene, slave, spaceTransformer, squared, STRETCH_RATIO, viewbounds, viewDirty, viewLifecycleListeners, viewmode, viewOnTopListeners, viewpoint, viewPointChangedListeners, wasOnTopAtLastRendering
Constructor and Description |
---|
AWTView(IChartComponentFactory factory,
Scene scene,
ICanvas canvas,
Quality quality) |
Modifier and Type | Method and Description |
---|---|
void |
addRenderer2d(Renderer2d renderer) |
void |
addTooltip(ITooltipRenderer tooltip) |
void |
addTooltips(List<ITooltipRenderer> tooltip) |
void |
clearTooltips() |
protected void |
correctCameraPositionForIncludingTextLabels(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
ViewportConfiguration viewport) |
void |
dispose() |
BufferedImage |
getBackgroundImage() |
List<ITooltipRenderer> |
getTooltips() |
protected boolean |
hasOverlayStuffs() |
void |
removeRenderer2d(Renderer2d renderer) |
void |
renderAxeBox(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu) |
void |
renderBackground(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
float left,
float right)
To be implemented (see AWTView)
|
void |
renderBackground(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
ViewportConfiguration viewport)
To be implemented (see AWTView)
|
void |
renderOverlay(com.jogamp.opengl.GL gl,
ViewportConfiguration viewport)
Renders all provided
Tooltip s and Renderer2d s on top of
the scene. |
void |
setBackgroundImage(BufferedImage i)
Set a buffered image, or null to desactivate background image
|
void |
setTooltip(ITooltipRenderer tooltip) |
void |
setTooltips(List<ITooltipRenderer> tooltip) |
addViewLifecycleChangedListener, addViewOnTopEventListener, addViewPointChangedListener, clear, clearColorAndDepth, computeCameraEye, computeCameraEyeFree, computeCameraEyeProfile, computeCameraEyeTop, computeCameraRenderingSphereRadius, computeCameraTarget, computeCameraUp, computeCameraUpAndTriggerEvents, computeScaledViewBounds, computeSceneScaling, current, fireViewLifecycleHasInit, fireViewLifecycleWillRender, fireViewOnTopEvent, fireViewPointChangedEvent, getAnnotations, getAxe, getBackgroundColor, getBounds, getBoundsMode, getCamera, getCameraMode, getCanvas, getCanvasAsGLAutoDrawable, getCenter, getChart, getCurrentContext, getCurrentGL, getInitBounds, getLastViewScaling, getScale, getScene, getSceneGraphBounds, getSceneGraphBounds, getSceneViewportRectangle, getSpaceTransformer, getSquared, getViewMode, getViewPoint, glModelView, init, initLights, initQuality, initResources, isAxeBoxDisplayed, isSlave, lookToBox, project, projectMouse, removeViewLifecycleChangedListener, removeViewOnTopEventListener, removeViewPointChangedListener, renderAnnotations, renderOverlay, renderScene, renderScene, renderScene, renderSceneGraph, renderSceneGraph, rotate, rotate, setAxe, setAxeBoxDisplayed, setBackgroundColor, setBoundManual, setBoundMode, setCameraMode, setChart, setInitBounds, setMaximized, setScale, setScale, setScaleX, setScaleX, setScaleY, setScaleY, setScaleZ, setScaleZ, setSlave, setSpaceTransformer, setSquared, setViewPoint, setViewPoint, setViewPositionMode, shift, shift, shoot, squarify, updateBounds, updateBoundsForceUpdate, updateCamera, updateCamera, updateQuality, zoom, zoom, zoomX, zoomX, zoomY, zoomY, zoomZ, zoomZ
protected List<ITooltipRenderer> tooltips
protected List<Renderer2d> renderers
protected Color bgOverlay
protected AWTImageViewport bgViewport
protected BufferedImage bgImg
protected com.jogamp.opengl.util.awt.Overlay overlay
public AWTView(IChartComponentFactory factory, Scene scene, ICanvas canvas, Quality quality)
public void renderAxeBox(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu)
renderAxeBox
in class View
protected void correctCameraPositionForIncludingTextLabels(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, ViewportConfiguration viewport)
correctCameraPositionForIncludingTextLabels
in class View
public void renderOverlay(com.jogamp.opengl.GL gl, ViewportConfiguration viewport)
Tooltip
s and Renderer2d
s on top of
the scene.
Due to the behaviour of the Overlay
implementation, Java2d
geometries must be drawn relative to the Chart
's
IScreenCanvas
, BUT will then be stretched to fit in the
Camera
's viewport. This bug is very important to consider, since
the Camera's viewport may not occupy the full IScreenCanvas
.
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 the
View
, 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.renderOverlay
in class View
public void renderBackground(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, float left, float right)
View
renderBackground
in class View
public void renderBackground(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, ViewportConfiguration viewport)
View
renderBackground
in class View
public void setBackgroundImage(BufferedImage i)
public BufferedImage getBackgroundImage()
public void clearTooltips()
public void setTooltip(ITooltipRenderer tooltip)
public void addTooltip(ITooltipRenderer tooltip)
public void setTooltips(List<ITooltipRenderer> tooltip)
public void addTooltips(List<ITooltipRenderer> tooltip)
public List<ITooltipRenderer> getTooltips()
public void addRenderer2d(Renderer2d renderer)
public void removeRenderer2d(Renderer2d renderer)
protected boolean hasOverlayStuffs()
Copyright © 2016. All rights reserved.