public class CanvasAWT extends com.jogamp.opengl.awt.GLCanvas implements IScreenCanvas
CanvasAWT is a base implementation that primarily allows to integrate
a Jzy3d chart in an AWT application.
Relying on JOGL's GLPanel, this canvas can actually be used in AWT,
Swing, as well as SWT through
org.jzy3d.bridge.swt.Bridge.adapt(swt,awt).Canvas.AccessibleAWTCanvasComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
protected com.jogamp.opengl.util.Animator |
animator |
protected Renderer3d |
renderer |
protected View |
view |
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTDEFAULT_PRINT_TILE_SIZEAUTOMAX_PIXELSCALE, IDENTITY_PIXELSCALEABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
CanvasAWT(IChartComponentFactory factory,
Scene scene,
Quality quality) |
CanvasAWT(IChartComponentFactory factory,
Scene scene,
Quality quality,
com.jogamp.opengl.GLCapabilitiesImmutable glci) |
CanvasAWT(IChartComponentFactory factory,
Scene scene,
Quality quality,
com.jogamp.opengl.GLCapabilitiesImmutable glci,
boolean traceGL,
boolean debugGL)
|
| Modifier and Type | Method and Description |
|---|---|
void |
addKeyController(Object o)
A generic interface for mouse listener to remain Windowing toolkit
independant. * Implementation of this method should simply cast the input
assuming it will correspond to canvas-compatible mouse listener.
|
void |
addMouseController(Object o)
A generic interface for mouse listener to remain Windowing toolkit
independant. * Implementation of this method should simply cast the input
assuming it will correspond to canvas-compatible mouse listener.
|
void |
dispose()
Performs all required cleanup when destroying a Canvas.
|
void |
forceRepaint()
Invoked when a user requires the Canvas to be repainted (e.g. a non 3d
layer has changed).
|
String |
getDebugInfo() |
com.jogamp.opengl.GLDrawable |
getDrawable()
Returns the GLDrawable associated with the canvas
|
Renderer3d |
getRenderer() |
int |
getRendererHeight()
Provide the actual renderer height for the open gl camera settings, which
is obtained after a resize event.
|
int |
getRendererWidth()
Provide the actual renderer width for the open gl camera settings, which
is obtained after a resize event.
|
View |
getView()
Provide a reference to the View that renders into this canvas.
|
void |
removeKeyController(Object o)
A generic interface for key listener to remain Windowing toolkit
independant. * Implementation of this method should simply cast the input
assuming it will correspond to canvas-compatible key listener.
|
void |
removeMouseController(Object o)
A generic interface for key listener to remain Windowing toolkit
independant. * Implementation of this method should simply cast the input
assuming it will correspond to canvas-compatible key listener.
|
com.jogamp.opengl.util.texture.TextureData |
screenshot()
Returns an image with the current renderer's size
|
com.jogamp.opengl.util.texture.TextureData |
screenshot(File file) |
void |
setPixelScale(float[] scale)
Defines pixel scale.
|
void |
triggerMouseEvent(MouseEvent e) |
void |
triggerMouseMotionEvent(MouseEvent e) |
void |
triggerMouseWheelEvent(MouseWheelEvent e) |
addGLEventListener, addGLEventListener, addNotify, areAllGLEventListenerInitialized, createContext, destroy, destroyImpl, display, disposeGLEventListener, flushGLRunnables, getAnimator, getAutoSwapBufferMode, getChosenGLCapabilities, getContext, getContextCreationFlags, getCurrentSurfaceScale, getDefaultCloseOperation, getDelegatedDrawable, getExclusiveContextThread, getFactory, getGL, getGLEventListener, getGLEventListenerCount, getGLEventListenerInitState, getGLProfile, getGraphicsConfiguration, getHandle, getMaximumSurfaceScale, getMinimumSurfaceScale, getNativeSurface, getRequestedGLCapabilities, getRequestedSurfaceScale, getShallUseOffscreenLayer, getSurfaceHeight, getSurfaceWidth, getThreadName, getUpstreamLock, getUpstreamWidget, invoke, invoke, isGLOriented, isOffscreenLayerSurfaceEnabled, isRealized, isThreadGLCapable, main, paint, print, releasePrint, removeGLEventListener, removeNotify, reshape, setAnimator, setAutoSwapBufferMode, setContext, setContextCreationFlags, setDefaultCloseOperation, setExclusiveContextThread, setGL, setGLEventListenerInitState, setRealized, setShallUseOffscreenLayer, setSharedAutoDrawable, setSharedContext, setSurfaceScale, setupPrint, swapBuffers, toString, updatecreateBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategyaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle, validateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdisplay, getAnimatoraddComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListenerprotected View view
protected Renderer3d renderer
protected com.jogamp.opengl.util.Animator animator
public CanvasAWT(IChartComponentFactory factory, Scene scene, Quality quality)
public CanvasAWT(IChartComponentFactory factory, Scene scene, Quality quality, com.jogamp.opengl.GLCapabilitiesImmutable glci)
public CanvasAWT(IChartComponentFactory factory, Scene scene, Quality quality, com.jogamp.opengl.GLCapabilitiesImmutable glci, boolean traceGL, boolean debugGL)
public void setPixelScale(float[] scale)
ICanvasCamera.screenToModel(com.jogamp.opengl.GL, com.jogamp.opengl.glu.GLU, org.jzy3d.maths.Coord3d)
output wrong result.
When running on Retina display, those two options fixed buggy mouse
selections on Retina:
setPixelScale in interface ICanvasScalableSurface#setSurfaceScale(float[])} in JOGL javadoc for
more informationspublic void dispose()
ICanvaspublic String getDebugInfo()
getDebugInfo in interface ICanvaspublic void forceRepaint()
ICanvasforceRepaint in interface ICanvaspublic com.jogamp.opengl.util.texture.TextureData screenshot(File file) throws IOException
screenshot in interface ICanvasIOExceptionpublic com.jogamp.opengl.util.texture.TextureData screenshot()
ICanvasscreenshot in interface ICanvaspublic void triggerMouseEvent(MouseEvent e)
public void triggerMouseMotionEvent(MouseEvent e)
public void triggerMouseWheelEvent(MouseWheelEvent e)
public void addMouseController(Object o)
ICanvasaddMouseController in interface ICanvaspublic void addKeyController(Object o)
ICanvasaddKeyController in interface ICanvaspublic void removeMouseController(Object o)
ICanvasremoveMouseController in interface ICanvaspublic void removeKeyController(Object o)
ICanvasremoveKeyController in interface ICanvaspublic com.jogamp.opengl.GLDrawable getDrawable()
ICanvasgetDrawable in interface ICanvaspublic Renderer3d getRenderer()
getRenderer in interface ICanvaspublic View getView()
public int getRendererWidth()
getRendererWidth in interface ICanvaspublic int getRendererHeight()
getRendererHeight in interface ICanvasCopyright © 2016. All rights reserved.