PuyoPuyo Documentation


puyopuyo
Class ScreenManager

java.lang.Object
  extended by puyopuyo.ScreenManager

public class ScreenManager
extends java.lang.Object

The ScreenManager class manages initializing and displaying full screen graphics modes.


Field Summary
private  java.awt.GraphicsDevice device
           
 
Constructor Summary
ScreenManager()
          Creates a new ScreenManager object.
 
Method Summary
 java.awt.DisplayMode[] getCompatibleDisplayModes()
          Returns a list of compatible display modes for the default device on the system.
 java.awt.DisplayMode getCurrentDisplayMode()
          Returns the current display mode.
 java.awt.Window getFullScreenWindow()
          Returns the window currently used in full screen mode.
 java.awt.Graphics2D getGraphics()
          Gets the graphics context for the display.
 int getHeight()
          Returns the height of the window currently used in full screen mode.
 int getWidth()
          Returns the width of the window currently used in full screen mode.
 void restoreScreen()
          Restores the screen's display mode.
 void setFullScreen(java.awt.DisplayMode displayMode)
          Enters full screen mode and changes the display mode.
 void update()
          Updates the display.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

device

private java.awt.GraphicsDevice device
Constructor Detail

ScreenManager

public ScreenManager()
Creates a new ScreenManager object.

Method Detail

getCompatibleDisplayModes

public java.awt.DisplayMode[] getCompatibleDisplayModes()
Returns a list of compatible display modes for the default device on the system.


getCurrentDisplayMode

public java.awt.DisplayMode getCurrentDisplayMode()
Returns the current display mode.


setFullScreen

public void setFullScreen(java.awt.DisplayMode displayMode)
Enters full screen mode and changes the display mode. If the specified display mode is null or not compatible with this device, or if the display mode cannot be changed on this system, the current display mode is used.

The display uses a BufferStrategy with 2 buffers.


getGraphics

public java.awt.Graphics2D getGraphics()
Gets the graphics context for the display. The ScreenManager uses double buffering, so applications must call update() to show any graphics drawn.

The application must dispose of the graphics object.


update

public void update()
Updates the display.


getFullScreenWindow

public java.awt.Window getFullScreenWindow()
Returns the window currently used in full screen mode. Returns null if the device is not in full screen mode.


getWidth

public int getWidth()
Returns the width of the window currently used in full screen mode. Returns 0 if the device is not in full screen mode.


getHeight

public int getHeight()
Returns the height of the window currently used in full screen mode. Returns 0 if the device is not in full screen mode.


restoreScreen

public void restoreScreen()
Restores the screen's display mode.


Dev Ghai