Package panamagl.canvas.swt
Class GLCanvasSWT_direct
java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.swt.widgets.Canvas
org.eclipse.swt.opengl.GLCanvas
panamagl.canvas.swt.GLCanvasSWT_direct
- All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable,panamagl.canvas.GLCanvas
public class GLCanvasSWT_direct
extends org.eclipse.swt.opengl.GLCanvas
implements panamagl.canvas.GLCanvas
-
Nested Class Summary
Nested classes/interfaces inherited from interface panamagl.canvas.GLCanvas
panamagl.canvas.GLCanvas.Flip -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.eclipse.swt.graphics.Colorprotected panamagl.opengl.GLContextprotected panamagl.factory.PanamaGLFactoryprotected panamagl.canvas.GLCanvas.Flipprotected panamagl.opengl.GLprotected panamagl.Image<?> protected panamagl.GLEventListenerprotected panamagl.offscreen.OffscreenRendererprotected final Runnableprotected panamagl.performance.RenderCounterprotected AtomicBooleanFields inherited from class org.eclipse.swt.widgets.Composite
embeddedHandleFields inherited from class org.eclipse.swt.widgets.Widget
handle -
Constructor Summary
ConstructorsConstructorDescriptionGLCanvasSWT_direct(org.eclipse.swt.widgets.Composite parent, int style, org.eclipse.swt.opengl.GLData data, panamagl.factory.PanamaGLFactory glFactory) GLCanvasSWT_direct(org.eclipse.swt.widgets.Composite parent, int style, panamagl.factory.PanamaGLFactory glFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the background and fill it with the widgets background colorprotected static org.eclipse.swt.opengl.GLDatastatic org.eclipse.swt.graphics.ImagecreateImageWithTransparentBackground(org.eclipse.swt.graphics.Device device, int width, int height) voiddisplay()voiddrawImage(org.eclipse.swt.graphics.ImageData image, double x, double y, boolean alpha) voiddrawRaster(double x, double y, int width, int height, boolean transparent, Consumer<org.eclipse.swt.graphics.GC> paintHandler) org.eclipse.swt.graphics.PointdrawString(String text, double x, double y) org.eclipse.swt.graphics.PointdrawString(String text, org.eclipse.swt.graphics.Point measure, double x, double y) protected static intextractValue(int pixel, int mask, int shift) org.eclipse.swt.graphics.ColorgetColor()panamagl.opengl.GLContextpanamagl.canvas.GLCanvas.FlipgetFlip()panamagl.opengl.GLgetGL()panamagl.GLEventListenerintpanamagl.performance.RenderCounterpanamagl.offscreen.OffscreenRendererstatic byte[]getPixelData(org.eclipse.swt.graphics.ImageData imageData, boolean withAlphaChannel) static byte[]getPixelData(org.eclipse.swt.graphics.Image image, boolean withAlphaChannel) panamagl.Image<?> intgetWidth()booleanbooleanstatic org.eclipse.swt.graphics.PointmeasureText(String text, org.eclipse.swt.graphics.Font font) Measure the the text size of the given string and fontvoidvoidrepaint()voidsetColor(org.eclipse.swt.graphics.Color color) voidsetFlip(panamagl.canvas.GLCanvas.Flip flip) voidsetGLEventListener(panamagl.GLEventListener listener) Does not call display().voidsetOffscreenRenderer(panamagl.offscreen.OffscreenRenderer offscreen) voidsetScreenshot(panamagl.Image<?> image) Methods inherited from class org.eclipse.swt.opengl.GLCanvas
getGLData, isCurrent, setCurrent, swapBuffersMethods inherited from class org.eclipse.swt.widgets.Canvas
drawBackground, getCaret, getIME, scroll, setCaret, setFont, setIMEMethods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toStringMethods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar, setScrollbarsModeMethods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isAutoScalable, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, updateMethods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, addTypedListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface panamagl.canvas.GLCanvas
isVisible
-
Field Details
-
gl
protected panamagl.opengl.GL gl -
listener
protected panamagl.GLEventListener listener -
offscreen
protected panamagl.offscreen.OffscreenRenderer offscreen -
image
protected panamagl.Image<?> image -
renderCounter
protected panamagl.performance.RenderCounter renderCounter -
paintLoop
-
rendering
-
context
protected panamagl.opengl.GLContext context -
color
protected org.eclipse.swt.graphics.Color color -
flip
protected panamagl.canvas.GLCanvas.Flip flip -
factory
protected panamagl.factory.PanamaGLFactory factory
-
-
Constructor Details
-
GLCanvasSWT_direct
public GLCanvasSWT_direct(org.eclipse.swt.widgets.Composite parent, int style, panamagl.factory.PanamaGLFactory glFactory) -
GLCanvasSWT_direct
public GLCanvasSWT_direct(org.eclipse.swt.widgets.Composite parent, int style, org.eclipse.swt.opengl.GLData data, panamagl.factory.PanamaGLFactory glFactory)
-
-
Method Details
-
display
public void display()- Specified by:
displayin interfacepanamagl.canvas.GLCanvas
-
isRendering
public boolean isRendering()- Specified by:
isRenderingin interfacepanamagl.canvas.GLCanvas
-
getGLEventListener
public panamagl.GLEventListener getGLEventListener()- Specified by:
getGLEventListenerin interfacepanamagl.canvas.GLCanvas
-
setGLEventListener
public void setGLEventListener(panamagl.GLEventListener listener) Does not call display(). Should be called explicitely.- Specified by:
setGLEventListenerin interfacepanamagl.canvas.GLCanvas
-
isInitialized
public boolean isInitialized()- Specified by:
isInitializedin interfacepanamagl.canvas.GLCanvas
-
getContext
public panamagl.opengl.GLContext getContext()- Specified by:
getContextin interfacepanamagl.canvas.GLCanvas
-
getGL
public panamagl.opengl.GL getGL()- Specified by:
getGLin interfacepanamagl.canvas.GLCanvas
-
getMonitoring
public panamagl.performance.RenderCounter getMonitoring()- Specified by:
getMonitoringin interfacepanamagl.canvas.GLCanvas
-
getWidth
public int getWidth()- Specified by:
getWidthin interfacepanamagl.canvas.GLCanvas
-
getHeight
public int getHeight()- Specified by:
getHeightin interfacepanamagl.canvas.GLCanvas
-
repaint
public void repaint()- Specified by:
repaintin interfacepanamagl.canvas.GLCanvas
-
setScreenshot
public void setScreenshot(panamagl.Image<?> image) - Specified by:
setScreenshotin interfacepanamagl.canvas.GLCanvas
-
getScreenshot
public panamagl.Image<?> getScreenshot()- Specified by:
getScreenshotin interfacepanamagl.canvas.GLCanvas
-
getOffscreenRenderer
public panamagl.offscreen.OffscreenRenderer getOffscreenRenderer()- Specified by:
getOffscreenRendererin interfacepanamagl.canvas.GLCanvas
-
setOffscreenRenderer
public void setOffscreenRenderer(panamagl.offscreen.OffscreenRenderer offscreen) - Specified by:
setOffscreenRendererin interfacepanamagl.canvas.GLCanvas
-
createDefaultGLData
protected static org.eclipse.swt.opengl.GLData createDefaultGLData() -
getColor
public org.eclipse.swt.graphics.Color getColor() -
clear
public void clear()Clear the background and fill it with the widgets background color -
setColor
public void setColor(org.eclipse.swt.graphics.Color color) -
orthographic
public void orthographic() -
drawImage
public void drawImage(org.eclipse.swt.graphics.ImageData image, double x, double y, boolean alpha) -
drawRaster
public void drawRaster(double x, double y, int width, int height, boolean transparent, Consumer<org.eclipse.swt.graphics.GC> paintHandler) -
drawString
-
drawString
public org.eclipse.swt.graphics.Point drawString(String text, org.eclipse.swt.graphics.Point measure, double x, double y) -
createImageWithTransparentBackground
public static org.eclipse.swt.graphics.Image createImageWithTransparentBackground(org.eclipse.swt.graphics.Device device, int width, int height) -
measureText
public static org.eclipse.swt.graphics.Point measureText(String text, org.eclipse.swt.graphics.Font font) Measure the the text size of the given string and font- Parameters:
text- the text to measurefont- the font to use- Returns:
-
getPixelData
public static byte[] getPixelData(org.eclipse.swt.graphics.Image image, boolean withAlphaChannel) -
getPixelData
public static byte[] getPixelData(org.eclipse.swt.graphics.ImageData imageData, boolean withAlphaChannel) -
extractValue
protected static int extractValue(int pixel, int mask, int shift) -
getFlip
public panamagl.canvas.GLCanvas.Flip getFlip()- Specified by:
getFlipin interfacepanamagl.canvas.GLCanvas
-
setFlip
public void setFlip(panamagl.canvas.GLCanvas.Flip flip) - Specified by:
setFlipin interfacepanamagl.canvas.GLCanvas
-