|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmhframework.MHScreenManager
public final class MHScreenManager
The MHScreenManager class maintains references to the current screen, the application's data model, and encapsulates a screen stack (MHScreenStack) for providing the ability to backtrack through multiple game screens.
AN IDEA: Maybe this class could contain a generic loading screen that displays automatically if the new screen being loaded is not ready to be displayed. So, if it's told to change screens, it can query the new screen to see if it's ready. If not, it can display a generic loading screen until the new screen is ready. Consider this for the next version.
Constructor Summary | |
---|---|
MHScreenManager(MHScreen screen)
Constructor. |
Method Summary | |
---|---|
void |
addScreen(MHScreen newScreen)
Adds a new screen to the screen stack. |
void |
advance()
Tells the current screen to update its data. |
void |
gc()
Runs the screen manager's garbage collector to deallocate screens that are no longer needed (i.e. |
MHScreen |
getScreen()
Retrieves the current screen. |
void |
keyPressed(java.awt.event.KeyEvent e)
|
void |
keyReleased(java.awt.event.KeyEvent e)
|
void |
keyTyped(java.awt.event.KeyEvent e)
|
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
removeScreen()
Removes a screen from the screen stack. |
void |
render(java.awt.Graphics2D g)
Tells the current screen to draw itself onto the input Graphics2D object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MHScreenManager(MHScreen screen)
screen
- An initial screen object used to create the
stack. This is often a loading screen, title
screen, copyright notice, etc.Method Detail |
---|
public MHScreen getScreen()
public void gc()
public void addScreen(MHScreen newScreen)
public void removeScreen()
public void advance()
public void render(java.awt.Graphics2D g)
public void keyTyped(java.awt.event.KeyEvent e)
public void keyPressed(java.awt.event.KeyEvent e)
public void keyReleased(java.awt.event.KeyEvent e)
public void mousePressed(java.awt.event.MouseEvent e)
public void mouseReleased(java.awt.event.MouseEvent e)
public void mouseMoved(java.awt.event.MouseEvent e)
public void mouseClicked(java.awt.event.MouseEvent e)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |