Package icyllis.modernui.core.awt

# Class AWTGLCanvas

java.lang.Object
java.awt.Component
java.awt.Canvas
icyllis.modernui.core.awt.AWTGLCanvas

All Implemented Interfaces:
  `ImageObserver`, `MenuContainer`, `Serializable`, `Accessible`

public abstract class AWTGLCanvas extends Canvas
An AWT `Canvas` that supports to be drawn on using OpenGL.

See Also:
  - Serialized Form

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class java.awt.Canvas

  `Canvas.AccessibleAWTCanvas`

  ## Nested classes/interfaces inherited from class java.awt.Component

  `Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected long`
  `context`
  `protected final GLData`
  `data`
  `protected final GLData`
  `effective`
  `protected boolean`
  `initCalled`
  `protected PlatformGLCanvas`
  `platformCanvas`

  ### Fields inherited from class java.awt.Component

  `accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT`

  ### Fields inherited from interface java.awt.image.ImageObserver

  `ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `AWTGLCanvas()`
  `protected`
  `AWTGLCanvas(GLData data)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addComponentListener(ComponentListener l)`
  `protected void`
  `afterRender()`
  `protected void`
  `beforeRender()`
  `void`
  `disposeCanvas()`
  `<T> T`
  `executeInContext(Callable<T> callable)`
  `int`
  `getFramebufferHeight()`
  `int`
  `getFramebufferWidth()`
  `Graphics`
  `getGraphics()`
  Returns Graphics object that ignores `Graphics.clearRect(int, int, int, int)` calls.
  `abstract void`
  `initGL()`
  Will be called once after the OpenGL has been created.
  `abstract void`
  `paintGL()`
  Will be called whenever the `Canvas` needs to paint itself.
  `void`
  `removeNotify()`
  `void`
  `render()`
  `void`
  `runInContext(Runnable runnable)`
  `final void`
  `swapBuffers()`

  ### Methods inherited from class java.awt.Canvas

  `addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, paint, update`

  ### Methods inherited from class java.awt.Component

  `action, add, 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, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, 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, print, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### platformCanvas

    protected PlatformGLCanvas platformCanvas

  - ### context

    protected long context

  - ### data

    protected final GLData data

  - ### effective

    protected final GLData effective

  - ### initCalled

    protected boolean initCalled

- ## Constructor Details

  - ### AWTGLCanvas

    protected AWTGLCanvas(GLData data)

  - ### AWTGLCanvas

    protected AWTGLCanvas()

- ## Method Details

  - ### removeNotify

    public void removeNotify()
    Overrides:
      `removeNotify` in class `Component`

  - ### addComponentListener

    public void addComponentListener(ComponentListener l)
    Overrides:
      `addComponentListener` in class `Component`

  - ### disposeCanvas

    public void disposeCanvas()

  - ### beforeRender

    protected void beforeRender()

  - ### afterRender

    protected void afterRender()

  - ### executeInContext

    public <T> T executeInContext(Callable<T> callable) throws Exception
    Throws:
      `Exception`

  - ### runInContext

    public void runInContext(Runnable runnable)

  - ### render

    public void render()

  - ### initGL

    public abstract void initGL()
    Will be called once after the OpenGL has been created.

  - ### paintGL

    public abstract void paintGL()
    Will be called whenever the `Canvas` needs to paint itself.

  - ### getFramebufferWidth

    public int getFramebufferWidth()

  - ### getFramebufferHeight

    public int getFramebufferHeight()

  - ### swapBuffers

    public final void swapBuffers()

  - ### getGraphics

    public Graphics getGraphics()
    Returns Graphics object that ignores `Graphics.clearRect(int, int, int, int)` calls. This is done so that the frame buffer will not be cleared by AWT/Swing internals.
    Overrides:
      `getGraphics` in class `Component`