|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdip.gui.PersistenceManager
Manages saving / opening of game files, and creation of new games, and exiting of the program.
Ensures user can save any changes (if changes were made) before committing to an action that cannot be undone.
Also sets the main frame title.
Constructor Summary | |
PersistenceManager(ClientFrame clientFrame)
Creates a new PersistenceManager object. |
Method Summary | |
World |
acceptDrag(java.io.File selectedFile,
World currentWorld)
Given a file from a Drag operation, attempt to open it as a game file if it has an extension of SimpleFileFilter.SAVE_GAME_FILTER type. |
void |
close()
Cleanup |
void |
exit()
Exit from the program, after confirmation |
java.lang.ThreadGroup |
getPMThreadGroup()
Threads added to this ThreadGroup will be joined() at exit (with a pre-defined timeout) such that they will complete before jDip exits. |
java.lang.String |
getSuggestedExportName()
Gets a suggested export name. |
java.lang.String |
getSuggestedSaveName()
Gets a suggested filename for a saved game. |
World |
importFloc()
Imports a game from Floc.Net. |
World |
importJudge(java.io.File file,
World currentWorld)
Imports the given Judge file (no file requester dialog is displayed) Returns: null, if the current world has been updated, or a new world object |
World |
importJudge(World currentWorld)
Lets the user choose the judge file to import |
boolean |
isChanged()
If any change has occured singe the last time we saved. |
World |
newF2FGame()
Creates a new game (Displays New Game dialog), after confirmation |
World |
newGame()
Creates a new game (Displays New Game dialog), after confirmation |
World |
open()
Opens a world, displaying a FileChooser dialog. |
World |
open(java.io.File file)
Opens a World from the given File, after confirmation |
boolean |
save()
Saves the current world, if changes have occured. |
boolean |
saveAs()
Save As: Saves the world after requesting for the filename. |
void |
saveTo()
Saves the current file to a new file, without changing the currently open file or current state. |
void |
updateTitle()
Force an update of the game name / title bar |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PersistenceManager(ClientFrame clientFrame)
Method Detail |
public void close()
public java.lang.ThreadGroup getPMThreadGroup()
This ensures that certain IO operations (e.g., Exports) will not be aborted at exit.
public boolean isChanged()
public void updateTitle()
public void exit()
public World open(java.io.File file)
public World open()
public World newGame()
public World newF2FGame()
public boolean save()
public boolean saveAs()
public void saveTo()
public World importJudge(World currentWorld)
public World importJudge(java.io.File file, World currentWorld)
public World importFloc()
public World acceptDrag(java.io.File selectedFile, World currentWorld)
public java.lang.String getSuggestedSaveName()
public java.lang.String getSuggestedExportName()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |