|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.brackeen.javagamebook.graphics.ScreenManager
The ScreenManager class manages initializing and displaying full screen graphics modes.
Constructor Summary | |
ScreenManager()
Creates a new ScreenManager object. |
Method Summary | |
java.awt.image.BufferedImage |
createCompatibleImage(int w,
int h,
int transparancy)
Creates an image compatible with the current display. |
boolean |
displayModesMatch(java.awt.DisplayMode mode1,
java.awt.DisplayMode mode2)
Determines if two display modes "match". |
java.awt.DisplayMode |
findFirstCompatibleMode(java.awt.DisplayMode[] modes)
Returns the first compatible mode in a list of modes. |
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. |
javax.swing.JFrame |
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 |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ScreenManager()
Method Detail |
public java.awt.DisplayMode[] getCompatibleDisplayModes()
public java.awt.DisplayMode findFirstCompatibleMode(java.awt.DisplayMode[] modes)
public java.awt.DisplayMode getCurrentDisplayMode()
public boolean displayModesMatch(java.awt.DisplayMode mode1, java.awt.DisplayMode mode2)
public void setFullScreen(java.awt.DisplayMode displayMode)
The display uses a BufferStrategy with 2 buffers.
public java.awt.Graphics2D getGraphics()
The application must dispose of the graphics object.
public void update()
public javax.swing.JFrame getFullScreenWindow()
public int getWidth()
public int getHeight()
public void restoreScreen()
public java.awt.image.BufferedImage createCompatibleImage(int w, int h, int transparancy)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |