openpiano.gl
Class GLCore

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by javax.media.opengl.GLCanvas
              extended by openpiano.gl.GLCore
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, javax.media.opengl.ComponentEvents, javax.media.opengl.GLAutoDrawable, javax.media.opengl.GLDrawable, javax.media.opengl.GLEventListener

public class GLCore
extends javax.media.opengl.GLCanvas
implements javax.media.opengl.GLEventListener

The GLCore class represents the graphical main loop

Version:
1.0, 07/30/08
Author:
Sascha Westermann
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior
 
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
GLCore(Controller controller)
          Constructs a new GL core
 
Method Summary
 void display(javax.media.opengl.GLAutoDrawable drawable)
          Draws all items, the main GL loop
 void displayChanged(javax.media.opengl.GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged)
          Registers a changed display
 void init(javax.media.opengl.GLAutoDrawable drawable)
          Initializes the GL settings
 void reshape(javax.media.opengl.GLAutoDrawable drawable, int x, int y, int w, int h)
          Registers a reshape of the application window
 
Methods inherited from class javax.media.opengl.GLCanvas
addGLEventListener, addNotify, createContext, display, getAutoSwapBufferMode, getChosenGLCapabilities, getContext, getGL, getGraphicsConfiguration, paint, removeGLEventListener, removeNotify, reshape, setAutoSwapBufferMode, setGL, setRealized, swapBuffers, update
 
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, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, 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, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, 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, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.media.opengl.GLAutoDrawable
repaint
 
Methods inherited from interface javax.media.opengl.GLDrawable
getHeight, getWidth, setSize
 
Methods inherited from interface javax.media.opengl.ComponentEvents
addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

GLCore

public GLCore(Controller controller)
Constructs a new GL core

Parameters:
controller - the main controller of the application
Method Detail

init

public void init(javax.media.opengl.GLAutoDrawable drawable)
Initializes the GL settings

Specified by:
init in interface javax.media.opengl.GLEventListener
Parameters:
drawable - the GL context to deal with

display

public void display(javax.media.opengl.GLAutoDrawable drawable)
Draws all items, the main GL loop

Specified by:
display in interface javax.media.opengl.GLEventListener
Parameters:
drawable - the GL context to deal with

displayChanged

public void displayChanged(javax.media.opengl.GLAutoDrawable drawable,
                           boolean modeChanged,
                           boolean deviceChanged)
Registers a changed display

Specified by:
displayChanged in interface javax.media.opengl.GLEventListener
Parameters:
drawable - the GL context to deal with
modeChanged - true if mode changed
deviceChanged - true if device changed

reshape

public void reshape(javax.media.opengl.GLAutoDrawable drawable,
                    int x,
                    int y,
                    int w,
                    int h)
Registers a reshape of the application window

Specified by:
reshape in interface javax.media.opengl.GLEventListener
Parameters:
drawable - the GL context to deal with
x - the new x position
y - the new y position
w - the new window width
h - the new window height