jAER project on SourceForge

net.sf.jaer.graphics
Class EyeTarget

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by javax.media.opengl.GLCanvas
              extended by net.sf.jaer.graphics.EyeTarget
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.media.opengl.ComponentEvents, javax.media.opengl.GLAutoDrawable, javax.media.opengl.GLDrawable, javax.media.opengl.GLEventListener

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

A randomly moving and jumping target for test users to watch while having their eyes tracked. This can be used for calibration.

Author:
tobi
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
EyeTarget()
          Creates a new instance of EyeTarget
 
Method Summary
 void display(javax.media.opengl.GLAutoDrawable drawable)
          Called by the drawable to initiate OpenGL rendering by the client.
 void displayChanged(javax.media.opengl.GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged)
          Called by the drawable when the display mode or the display device associated with the GLAutoDrawable has changed.
 float getTargetSpeed()
           
 float getTargetX()
           
 float getTargetY()
           
 void init(javax.media.opengl.GLAutoDrawable drawable)
          Called by the drawable immediately after the OpenGL context is initialized.
 void repaint()
           
 void reshape(javax.media.opengl.GLAutoDrawable drawable, int x, int y, int width, int height)
          called on reshape of canvas.
 void setTargetSpeed(float speed)
           
 
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, 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, 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, requestFocus, requestFocus, requestFocusInWindow, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
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

EyeTarget

public EyeTarget()
Creates a new instance of EyeTarget

Method Detail

getTargetX

public float getTargetX()

getTargetY

public float getTargetY()

setTargetSpeed

public void setTargetSpeed(float speed)

getTargetSpeed

public float getTargetSpeed()

repaint

public void repaint()
Specified by:
repaint in interface javax.media.opengl.GLAutoDrawable
Overrides:
repaint in class java.awt.Component

init

public void init(javax.media.opengl.GLAutoDrawable drawable)
Called by the drawable immediately after the OpenGL context is initialized. Can be used to perform one-time OpenGL initialization such as setup of lights and display lists. Note that this method may be called more than once if the underlying OpenGL context for the GLAutoDrawable is destroyed and recreated, for example if a GLCanvas is removed from the widget hierarchy and later added again.

Specified by:
init in interface javax.media.opengl.GLEventListener

display

public void display(javax.media.opengl.GLAutoDrawable drawable)
Called by the drawable to initiate OpenGL rendering by the client. After all GLEventListeners have been notified of a display event, the drawable will swap its buffers if setAutoSwapBufferMode is enabled.

Specified by:
display in interface javax.media.opengl.GLEventListener

reshape

public void reshape(javax.media.opengl.GLAutoDrawable drawable,
                    int x,
                    int y,
                    int width,
                    int height)
called on reshape of canvas. Sets the scaling for drawing pixels to the screen.

Specified by:
reshape in interface javax.media.opengl.GLEventListener

displayChanged

public void displayChanged(javax.media.opengl.GLAutoDrawable drawable,
                           boolean modeChanged,
                           boolean deviceChanged)
Called by the drawable when the display mode or the display device associated with the GLAutoDrawable has changed. The two boolean parameters indicate the types of change(s) that have occurred. ( !!! CURRENTLY UNIMPLEMENTED !!! )

An example of a display mode change is when the bit depth changes (e.g., from 32-bit to 16-bit color) on monitor upon which the GLAutoDrawable is currently being displayed.

An example of a display device change is when the user drags the window containing the GLAutoDrawable from one monitor to another in a multiple-monitor setup.

The reason that this function handles both types of changes (instead of handling mode and device changes in separate methods) is so that applications have the opportunity to respond to display changes the most efficient manner. For example, the application may need make fewer adjustments to compensate for a device change if it knows that the mode on the new device is identical the previous mode.

Specified by:
displayChanged in interface javax.media.opengl.GLEventListener

jAER project on SourceForge