Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.lwjgl.opengl
Class AWTGLCanvas

    java.lang.Object
      java.awt.Component
          java.awt.Canvas
              org.lwjgl.opengl.AWTGLCanvas

All Implemented Interfaces:
  java.awt.event.ComponentListener, java.awt.event.HierarchyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, Drawable

    public class AWTGLCanvas

extends java.awt.Canvas
implements Drawable, java.awt.event.ComponentListener, java.awt.event.HierarchyListener

An AWT rendering context.

Version:
  $Revision: 2730 $
Author:
  $Author: elias_naur $ $Id: AWTGLCanvas.java 2730 2007-01-17 12:58:38Z elias_naur $
See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class java.awt.Canvas
`java.awt.Canvas.AccessibleAWTCanvas`

Nested classes/interfaces inherited from class java.awt.Component
`java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy`

Field Summary

Fields inherited from class java.awt.Component
`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
`AWTGLCanvas()` Constructor using the default PixelFormat.
`AWTGLCanvas(java.awt.GraphicsDevice device, PixelFormat pixel_format)` Create an AWTGLCanvas with the requested PixelFormat on the default GraphicsDevice.
`AWTGLCanvas(java.awt.GraphicsDevice device, PixelFormat pixel_format, Drawable drawable)` Create an AWTGLCanvas with the requested PixelFormat on the specified GraphicsDevice.
`AWTGLCanvas(PixelFormat pixel_format)` Create an AWTGLCanvas with the requested PixelFormat on the default GraphicsDevice.

Method Summary
`void` | `addNotify()`
`void` | `componentHidden(java.awt.event.ComponentEvent e)`
`void` | `componentMoved(java.awt.event.ComponentEvent e)`
`void` | `componentResized(java.awt.event.ComponentEvent e)`
`void` | `componentShown(java.awt.event.ComponentEvent e)`
`protected void` | `exceptionOccurred(LWJGLException exception)` This method will be called if an unhandled LWJGLException occurs in paint().
`org.lwjgl.opengl.Context` | `getContext()` This method should only be called internally.
`void` | `hierarchyChanged(java.awt.event.HierarchyEvent e)`
`protected void` | `initGL()` Override this to do initialising of the context.
`void` | `makeCurrent()` Make the canvas' context current.
`void` | `paint(java.awt.Graphics g)` The default paint() operation makes the context current and calls paintGL() which should be overridden to do GL operations.
`protected void` | `paintGL()` Override this to do painting
`void` | `releaseContext()`
`void` | `removeNotify()`
`void` | `setBounds(int x, int y, int width, int height)`
`void` | `setLocation(int x, int y)`
`void` | `setLocation(java.awt.Point p)`
`void` | `setSize(java.awt.Dimension d)`
`void` | `setSize(int width, int height)`
`void` | `setSwapInterval(int swap_interval)` Set swap interval.
`void` | `setVSyncEnabled(boolean enabled)` Enable vsync
`void` | `swapBuffers()` Swap the canvas' buffer
`void` | `update(java.awt.Graphics g)` override update to avoid clearing

Methods inherited from class java.awt.Canvas
`createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy`

Methods inherited from class java.awt.Component
`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, getGraphicsConfiguration, 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, 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, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMinimumSize, setName, setPreferredSize, 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`

Constructor Detail

### AWTGLCanvas

    public AWTGLCanvas()
                throws LWJGLException

  Constructor using the default PixelFormat.

  Throws:
    `LWJGLException`

### AWTGLCanvas

    public AWTGLCanvas(PixelFormat pixel_format)
                throws LWJGLException

  Create an AWTGLCanvas with the requested PixelFormat on the default GraphicsDevice.

  Parameters:
    `pixelFormat` - The desired pixel format. May not be null
    `device` - the device to create the canvas on.
  Throws:
    `LWJGLException`

### AWTGLCanvas

    public AWTGLCanvas(java.awt.GraphicsDevice device,
                       PixelFormat pixel_format)
                throws LWJGLException

  Create an AWTGLCanvas with the requested PixelFormat on the default GraphicsDevice.

  Parameters:
    `pixelFormat` - The desired pixel format. May not be null
    `device` - the device to create the canvas on.
  Throws:
    `LWJGLException`

### AWTGLCanvas

    public AWTGLCanvas(java.awt.GraphicsDevice device,
                       PixelFormat pixel_format,
                       Drawable drawable)
                throws LWJGLException

  Create an AWTGLCanvas with the requested PixelFormat on the specified GraphicsDevice.

  Parameters:
    `device` - the device to create the canvas on.
    `pixelFormat` - The desired pixel format. May not be null
    `shared_drawable` - The Drawable to share context with
  Throws:
    `LWJGLException`

Method Detail

### getContext

    public org.lwjgl.opengl.Context getContext()

  This method should only be called internally.

  Specified by:
    `getContext` in interface `Drawable`

### addNotify

    public void addNotify()

  Overrides:
    `addNotify` in class `java.awt.Canvas`

### removeNotify

    public void removeNotify()

  Overrides:
    `removeNotify` in class `java.awt.Component`

### setSwapInterval

    public void setSwapInterval(int swap_interval)

  Set swap interval.

### setVSyncEnabled

    public void setVSyncEnabled(boolean enabled)

  Enable vsync

### swapBuffers

    public void swapBuffers()
                     throws LWJGLException

  Swap the canvas' buffer

  Throws:
    `LWJGLException`

### releaseContext

    public void releaseContext()
                        throws LWJGLException

  Throws:
    `LWJGLException`

### makeCurrent

    public void makeCurrent()
                     throws LWJGLException

  Make the canvas' context current. It is highly recommended that the context is only made current inside the AWT thread (for example in an overridden paintGL()).

  Throws:
    `LWJGLException`

### initGL

    protected void initGL()

  Override this to do initialising of the context. It will be called once from paint(), immediately after the context is created and made current.

### paintGL

    protected void paintGL()

  Override this to do painting

### paint

    public final void paint(java.awt.Graphics g)

  The default paint() operation makes the context current and calls paintGL() which should be overridden to do GL operations.

  Overrides:
    `paint` in class `java.awt.Canvas`

### exceptionOccurred

    protected void exceptionOccurred(LWJGLException exception)

  This method will be called if an unhandled LWJGLException occurs in paint(). Override this method to be notified of this.

  Parameters:
    `exception` - The exception that occurred.

### update

    public void update(java.awt.Graphics g)

  override update to avoid clearing

  Overrides:
    `update` in class `java.awt.Canvas`

### componentShown

    public void componentShown(java.awt.event.ComponentEvent e)

  Specified by:
    `componentShown` in interface `java.awt.event.ComponentListener`

### componentHidden

    public void componentHidden(java.awt.event.ComponentEvent e)

  Specified by:
    `componentHidden` in interface `java.awt.event.ComponentListener`

### componentResized

    public void componentResized(java.awt.event.ComponentEvent e)

  Specified by:
    `componentResized` in interface `java.awt.event.ComponentListener`

### componentMoved

    public void componentMoved(java.awt.event.ComponentEvent e)

  Specified by:
    `componentMoved` in interface `java.awt.event.ComponentListener`

### setLocation

    public void setLocation(int x,
                            int y)

  Overrides:
    `setLocation` in class `java.awt.Component`

### setLocation

    public void setLocation(java.awt.Point p)

  Overrides:
    `setLocation` in class `java.awt.Component`

### setSize

    public void setSize(java.awt.Dimension d)

  Overrides:
    `setSize` in class `java.awt.Component`

### setSize

    public void setSize(int width,
                        int height)

  Overrides:
    `setSize` in class `java.awt.Component`

### setBounds

    public void setBounds(int x,
                          int y,
                          int width,
                          int height)

  Overrides:
    `setBounds` in class `java.awt.Component`

### hierarchyChanged

    public void hierarchyChanged(java.awt.event.HierarchyEvent e)

  Specified by:
    `hierarchyChanged` in interface `java.awt.event.HierarchyListener`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2006 lwjgl.org. All Rights Reserved.