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.AccessibleAWTCanvas
Component.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_ALIGNMENT
DEFAULT_PRINT_TILE_SIZE
AUTOMAX_PIXELSCALE, IDENTITY_PIXELSCALE
ABORT, 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, update
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
action, 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, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
display, getAnimator
addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener
protected 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)
ICanvas
Camera.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 ICanvas
ScalableSurface#setSurfaceScale(float[])} in JOGL javadoc for
more informations
public void dispose()
ICanvas
public String getDebugInfo()
getDebugInfo
in interface ICanvas
public void forceRepaint()
ICanvas
forceRepaint
in interface ICanvas
public com.jogamp.opengl.util.texture.TextureData screenshot(File file) throws IOException
screenshot
in interface ICanvas
IOException
public com.jogamp.opengl.util.texture.TextureData screenshot()
ICanvas
screenshot
in interface ICanvas
public void triggerMouseEvent(MouseEvent e)
public void triggerMouseMotionEvent(MouseEvent e)
public void triggerMouseWheelEvent(MouseWheelEvent e)
public void addMouseController(Object o)
ICanvas
addMouseController
in interface ICanvas
public void addKeyController(Object o)
ICanvas
addKeyController
in interface ICanvas
public void removeMouseController(Object o)
ICanvas
removeMouseController
in interface ICanvas
public void removeKeyController(Object o)
ICanvas
removeKeyController
in interface ICanvas
public com.jogamp.opengl.GLDrawable getDrawable()
ICanvas
getDrawable
in interface ICanvas
public Renderer3d getRenderer()
getRenderer
in interface ICanvas
public View getView()
public int getRendererWidth()
getRendererWidth
in interface ICanvas
public int getRendererHeight()
getRendererHeight
in interface ICanvas
Copyright © 2016. All rights reserved.