psychWithJava
Class FullScreen

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by psychWithJava.FullScreen
All Implemented Interfaces:
java.awt.event.KeyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants
Direct Known Subclasses:
BitsPP, BitsPPFake

public class FullScreen
extends javax.swing.JFrame
implements java.awt.event.KeyListener

FullScreen class provides methods to display visual stimuli and interact with the observer in full screen exclusive mode (FSEM).

FullScreen is capable of chosing the best available display mode and strategy on a particular software (OS) and hardware. By default the user does not have to change any of these strategies. However it provides methods for expert users who wish to modify those strategies. Requires Java SE 5.0 or higher.

Methods provided include: displayImage() to display images, displayText() to display text, and getKeyPressed() to get observer's keyboard responses. Because it is inherited from the Java core class JFrame, all its methods are available, such as setForeground().

See Psychophysics Programming with Java for more information and sample demo programs.

FullScreen class utilizes the Full screen exclusive mode (FSEM) is a feature of Java (after J2SE 1.4) that allows programmers to suspend the windowing system of the underlying OS, and directly access the video card and draw on the screen. If exclusive full screen is not supported, a regular window is positioned at upper left corner (0,0) and resized to fit the whole screen to mimic full screen exclusive mode. Whether in full screen exclusive mode or not, FullScreen uses active rendering as opposed to passive rendering - in passive rendering the underlying OS may intervene and send directives to the rendering program, whereas in active rendering the program itself is responsible of drawing and re-drawing the contents on the screen without the intervention of OS's directives.

For more details, developers can see JSE API definitions at http://java.sun.com. See also Java 2D API, Full-Screen Exclusive Mode API tutorial, Programmer's Guide to the Java 2D API, Painting in AWT and Swing, Trail: 2D Graphics, and Java 2D new features in J2SE 5.0.

Note: Java 2D API (and rest of the entire platform) is improved with JSE 5.0, and the FullScreen requires at least edition 5.0. Java SE 5.0 and 6.0 is available on all platforms (Linux, Mac OS X (only Tiger and later), and MS Windows).

Note: Real full screen exclusive mode is not supported on Linux in Java SE 5.0, but it simulates the exclusive mode. However this situation is fixed in edition 6. Now FSEM on Linux works fine especially with opengl pipeline enabled. To enable opengl pipeline user must specify the following system property on the command line: -Dsun.java2d.opengl=True. More information is available at Psychophysics programming with Java.

Matlab and Mathematica development:
It is possible to create Java objects from within Matlab and Mathematica. You can, therefore, create a Java object in Matlab or Mathematica and invoke its methods. In other words, if you choose, you could use this package with Matlab or Mathematica as a tool for psychophysics programming in a way much like the well known "Psychtoolbox" package. See Psychophysics Programming with Java for more information.

Since:
2012-02-28
Author:
Huseyin Boyaci
See Also:
NormalWindow, BitsPP, Serialized Form

Nested Class Summary
 class FullScreen.KeyPressed
          A class to handle key pressing events.
 class FullScreen.KeyReleased
          A class to handle key releasing events.
 class FullScreen.KeyTyped
          A class to handle key typing events.
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
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 javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
FullScreen()
          Constructs a FullScreen object on the default screen.
FullScreen(int displayID)
          Constructs a FullScreen object on the screen designated with displayID.
 
Method Summary
 void blankScreen()
          Blanks the whole screen using the current background color.
 void closeScreen()
          Closes the full screen exclusive mode screen.
 void displayImage(java.awt.image.BufferedImage bi)
          Displays a BufferedImage at the center of the screen.
 void displayImage(int x, int y, java.awt.image.BufferedImage bi)
          Displays a BufferedImage at the specified position.
 void displayText(int x, int y, java.lang.String text)
          Displays text at the specified position.
 void displayText(java.lang.String text)
          Displays text at the center of the screen.
 void flushKeyPressed()
          Clears the keyPressed queue.
 void flushKeyReleased()
          Clears the keyReleased queue.
 void flushKeyTyped()
          Clears the keyTyped queue.
 java.awt.Color getBackground()
          Returns the current background color.
 java.awt.DisplayMode getDisplayMode()
          Returns the current DisplayMode.
 java.awt.DisplayMode[] getDisplayModes()
          Returns all available DisplayModes on client's system.
 FullScreen.KeyPressed getKeyPressed()
          Returns the top element in keyPressed queue or null if queue is empty.
 FullScreen.KeyPressed getKeyPressed(long wt)
          Returns a KeyPressed object, which contains fields for the key pressed and when it is pressed within a specified wait time (wt).
 FullScreen.KeyReleased getKeyReleased()
          Returns the top element in keyReleased queue or null if queue is empty.
 FullScreen.KeyReleased getKeyReleased(long wt)
          Returns a KeyReleased object, which contains fields for the key released and when it is released within a specified wait time (wt).
 FullScreen.KeyTyped getKeyTyped()
          Returns the key typed by the observer.
 FullScreen.KeyTyped getKeyTyped(long wt)
          Returns a KeyTyped object, which contains fields for the key typed and when it is typed within a specified wait time (wt).
 int getNBuffers()
          Returns number of video buffers (including the front (visible) one) currently used by this FullScreen object.
 void hideCursor()
          Renders the cursor invisible.
 boolean isDisplayChangeSupported()
          Returns whether or not DisplayMode change is available on client's system.
 boolean isDisplayModeAvailable(java.awt.DisplayMode dm)
          Returns whether or not given DisplayMode is applicable to client's screen.
 boolean isFullScreenSupported()
          Returns whether or not Full Screen Exclusive Mode (FSEM) is supported on client's system.
 void keyPressed(java.awt.event.KeyEvent ke)
           
 void keyReleased(java.awt.event.KeyEvent ke)
           
 void keyTyped(java.awt.event.KeyEvent ke)
           
 java.lang.String reportDisplayMode()
          Returns the current screen resolution, vertical synchronization rate and color depth in a readable form.
 java.lang.String[] reportDisplayModes()
          Reports all available DisplayMode parameters in a readable format.
 void setBackground(java.awt.Color bg)
          Sets the background color.
 void setDisplayMode(java.awt.DisplayMode dm)
          Sets a new DisplayMode: secreen resolution, vertical synchronization rate, and color depth.
 void setNBuffers(int n)
          Sets number of video buffers (including the front (visible) one).
 void showCursor()
          Renders the cursor visible using default cursor
 void updateScreen()
          Updates the entire screen by bringing the back video buffer front (if there is no back video buffer it has no effect).
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Constructor Detail

FullScreen

public FullScreen(int displayID)
Constructs a FullScreen object on the screen designated with displayID. By default it uses a single video buffer and the current display mode of the client's OS. Once it is constructed, FullScreen captures the entire screen immediately. At the end user's program must terminate this mode and go back to system's default display. To do this use the method closeScreen().

Parameters:
displayID - a numerical id indicating the screen device
See Also:
setDisplayMode(DisplayMode), setNBuffers(int), closeScreen()

FullScreen

public FullScreen()
Constructs a FullScreen object on the default screen. By default it uses a single video buffer and the current display mode. Once it is constructed, FullScreen captures the entire screen immediately. At the end user's program must terminate this mode and go back to system's default display. To do this use the method closeScreen().

See Also:
setDisplayMode(DisplayMode), setNBuffers(int), closeScreen()
Method Detail

keyTyped

public void keyTyped(java.awt.event.KeyEvent ke)
Specified by:
keyTyped in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent ke)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent ke)
Specified by:
keyPressed in interface java.awt.event.KeyListener

setNBuffers

public void setNBuffers(int n)
Sets number of video buffers (including the front (visible) one). If the number is 1, it implies no back buffer. 2 implies one front one back buffer (double buffering).

Parameters:
n - number of buffers requested; must not be less than 1
See Also:
getNBuffers()

getNBuffers

public int getNBuffers()
Returns number of video buffers (including the front (visible) one) currently used by this FullScreen object.

Returns:
number of video buffers used by this FullScreen object
See Also:
setNBuffers(int)

updateScreen

public void updateScreen()
Updates the entire screen by bringing the back video buffer front (if there is no back video buffer it has no effect). The methods in FullScreen class (displayImage(), displayText() or blankScreen(), see below) always manipulate the video buffer, not necessarily the screen. After invoking those methods user has to invoke the updateScreen() method to actually bring the back buffer to front, in other words to make it actually visible on the screen device.

See Also:
displayImage(int, int, BufferedImage), displayText(int, int, String), blankScreen()

displayImage

public void displayImage(java.awt.image.BufferedImage bi)
Displays a BufferedImage at the center of the screen. Note that, in case there is a back video buffer this method draws the image on the back buffer. In that case user has to invoke the updateScreen() method to actually display the image on the screen.

Parameters:
bi - BufferedImage to display
See Also:
displayImage(int, int, BufferedImage), updateScreen()

displayImage

public void displayImage(int x,
                         int y,
                         java.awt.image.BufferedImage bi)
Displays a BufferedImage at the specified position. Note that, in case there is a back video buffer this method draws the image on the back buffer. In that case user has to invoke the updateScreen() method to actually display the image on the screen.

Parameters:
x - horizontal offset of the upper left corner of the image from the upper left corner of the screen
y - vertical offset of the upper left corner of the image from the upper left corner of the screen
bi - BufferedImage to display
See Also:
displayImage(BufferedImage), updateScreen()

displayText

public void displayText(java.lang.String text)
Displays text at the center of the screen. Note that, in case there is a back video buffer this method draws the text on the back buffer. In that case user has to invoke the updateScreen() method to actually display the text on the screen.

Parameters:
text - a text message to display
See Also:
displayText(int, int, String), updateScreen()

displayText

public void displayText(int x,
                        int y,
                        java.lang.String text)
Displays text at the specified position. Note that, in case there is a back video buffer this method draws the text on the back buffer. In that case user has to invoke the updateScreen() method to actually display the text on the screen.

Parameters:
x - horizontal offset of the upper left corner of the text from the upper left corner of the screen
y - vertical offset of the upper left corner of the text from the upper left corner of the screen
text - a text message to display
See Also:
displayText(String), updateScreen()

blankScreen

public void blankScreen()
Blanks the whole screen using the current background color. Note that, in case there is a back video buffer this method blanks the back buffer. In that case user has to invoke the updateScreen() method to actually blank the screen.

See Also:
updateScreen()

getBackground

public java.awt.Color getBackground()
Returns the current background color.

Overrides:
getBackground in class java.awt.Component
Returns:
current background color
See Also:
setBackground(Color)

setBackground

public void setBackground(java.awt.Color bg)
Sets the background color.

Overrides:
setBackground in class java.awt.Component
Parameters:
bg - new background color
See Also:
getBackground()

hideCursor

public void hideCursor()
Renders the cursor invisible.

See Also:
showCursor()

showCursor

public void showCursor()
Renders the cursor visible using default cursor

See Also:
hideCursor()

closeScreen

public void closeScreen()
Closes the full screen exclusive mode screen. This method performs also the following additional steps: It switches the resolution back to system setting (if it was altered), releases all the screen resources to the operating system. User must invoke this method to re-gain access to normal desktop.

See Also:
FullScreen(int), FullScreen()

getKeyTyped

public FullScreen.KeyTyped getKeyTyped(long wt)
Returns a KeyTyped object, which contains fields for the key typed and when it is typed within a specified wait time (wt).

If the wait time wt is positive: This method either (i) returns the top element in the keyTyped queue immediately if there is at least one element in the keyTyped event queue or (ii) waits up to wt for an element to become available. If no key is typed within wait time wt it returns null.

If the wait time wt is zero: Returns the top element in the keyTyped event queue or null if queue is empty.

If the wait time wt is negative: This method either returns the top element in the queue or if the queue is empty it waits indefinitely until the observer types a character.

In all cases, the element returned is removed from the event queue.

General principles of event handling in FullScreen: FullScreen captures the key events in a separate Thread and stores them in Thread safe BlockingQueue objects. Any time observer types, presses or releases a key, that key and the time of the event are inserted to the end (tail) of the respective queue. When one of the getKeyTyped(), getKeyPressed() or getKeyReleased() methods is invoked, the top (head) of the respective queue is retrieved and removed from the queue. The character typed, or the key pressed or released can be retrieved using getKey(), and the time of that event can be retrieved using getWhen() methods. flushKeyTyped(), flushKeyPressed() and flushKeyReleased() methods clear respective queues.

For more information and examples see Psychophysics programming with Java.

Parameters:
wt - time in milliseconds to wait for a response
Returns:
the key typed
See Also:
getKeyTyped(), flushKeyTyped(), FullScreen.KeyTyped

getKeyTyped

public FullScreen.KeyTyped getKeyTyped()
Returns the key typed by the observer. Returns the top element in keyTyped queue or null if queue is empty. Equivalent to invoking getKeyTyped(0).

The element returned is removed from the event queue. See also general principles of event handling in FullScreen above.

For more information and examples see Psychophysics programming with Java.

Returns:
the key typed
See Also:
getKeyTyped(long), flushKeyTyped(), FullScreen.KeyTyped

flushKeyTyped

public void flushKeyTyped()
Clears the keyTyped queue. See also general principles of event handling in FullScreen above.

For more information and examples see Psychophysics programming with Java.

See Also:
getKeyTyped(long)

getKeyPressed

public FullScreen.KeyPressed getKeyPressed(long wt)
Returns a KeyPressed object, which contains fields for the key pressed and when it is pressed within a specified wait time (wt).

If the wait time wt is positive: This method either (i) returns the top element in the keyPressed queue immediately if there is at least one element in the keyPressed event queue or (ii) waits up to wt for an element to become available. If no key is pressed within wait time wt it returns null.

If the wait time wt is zero: Returns the top element in the keyPressed event queue or null if queue is empty.

If the wait time wt is negative: This method either returns the top element in the queue or if the queue is empty it waits indefinitely until the observer pressed a key.

In all cases, the element returned is removed from the event queue. See also general principles of event handling in FullScreen above.

For more information and examples see Psychophysics programming with Java.

Parameters:
wt - time in milliseconds to wait for a response
Returns:
numeric code of the key pressed
See Also:
getKeyPressed(), flushKeyPressed(), FullScreen.KeyPressed

getKeyPressed

public FullScreen.KeyPressed getKeyPressed()
Returns the top element in keyPressed queue or null if queue is empty. Equivalent to invoking getKeyPressed(0).

The element returned is removed from the event queue. See also general principles of event handling in FullScreen above.

For more information and examples see Psychophysics programming with Java.

Returns:
numeric code of the key pressed
See Also:
getKeyPressed(long), flushKeyPressed(), FullScreen.KeyPressed

flushKeyPressed

public void flushKeyPressed()
Clears the keyPressed queue. See also general principles of event handling in FullScreen above.

For more information and examples see Psychophysics programming with Java.

See Also:
getKeyPressed(long)

getKeyReleased

public FullScreen.KeyReleased getKeyReleased(long wt)
Returns a KeyReleased object, which contains fields for the key released and when it is released within a specified wait time (wt).

If the wait time wt is positive: This method either (i) returns the top element in the keyReleased queue immediately if there is at least one element in the keyTyped event queue or (ii) waits up to wt for an element to become available. If no key is released within wait time wt it returns null.

If the wait time wt is zero: Returns the top element in the keyReleased event queue or null if queue is empty.

If the wait time wt is negative: This method either returns the top element in the queue or if the queue is empty it waits indefinitely until the observer releases a key.

In all cases, the element returned is removed from the event queue. See also general principles of event handling in FullScreen above.

For more information and examples see Psychophysics programming with Java.

Parameters:
wt - time in milliseconds to wait for a response
Returns:
numerical code of the key released
See Also:
getKeyReleased(), flushKeyReleased(), FullScreen.KeyReleased

getKeyReleased

public FullScreen.KeyReleased getKeyReleased()
Returns the top element in keyReleased queue or null if queue is empty. Equivalent to invoking getKeyReleased(0).

The element returned is removed from the event queue. See also general principles of event handling in FullScreen above.

For more information and examples see Psychophysics programming with Java.

Returns:
numerical code of the key released
See Also:
getKeyReleased(long), flushKeyReleased(), FullScreen.KeyReleased

flushKeyReleased

public void flushKeyReleased()
Clears the keyReleased queue. See also general principles of event handling in FullScreen above.

For more information and examples see Psychophysics programming with Java.

See Also:
getKeyReleased(long)

isFullScreenSupported

public boolean isFullScreenSupported()
Returns whether or not Full Screen Exclusive Mode (FSEM) is supported on client's system.

Returns:
true if full screen exclusive mode is supported

setDisplayMode

public void setDisplayMode(java.awt.DisplayMode dm)
Sets a new DisplayMode: secreen resolution, vertical synchronization rate, and color depth. If the requested DisplayMode is not applicable or DisplayMode change is not supported it causes the termination of the user's program, in order to avoid an erronous experimental session.

Parameters:
dm - new display mode to apply
See Also:
isDisplayChangeSupported(), isDisplayModeAvailable(DisplayMode)

isDisplayModeAvailable

public boolean isDisplayModeAvailable(java.awt.DisplayMode dm)
Returns whether or not given DisplayMode is applicable to client's screen.

Parameters:
dm - DisplayMode to check
Returns:
whether dm is applicable or not

reportDisplayMode

public java.lang.String reportDisplayMode()
Returns the current screen resolution, vertical synchronization rate and color depth in a readable form.

Returns:
current DisplayMode in readable form

getDisplayMode

public java.awt.DisplayMode getDisplayMode()
Returns the current DisplayMode.

Returns:
current DisplayMode

isDisplayChangeSupported

public boolean isDisplayChangeSupported()
Returns whether or not DisplayMode change is available on client's system.

Returns:
true if DisplayMode change is available

reportDisplayModes

public java.lang.String[] reportDisplayModes()
Reports all available DisplayMode parameters in a readable format.

Returns:
all available DisplayMode parameters.

getDisplayModes

public java.awt.DisplayMode[] getDisplayModes()
Returns all available DisplayModes on client's system.

Returns:
all available DisplayModes.