public class StateManager extends LogicManager
Modifier and Type | Field and Description |
---|---|
protected JMenuItem |
editRedo
The Redo menu item from the Edit menu.
|
protected JMenuItem |
editUndo
The Undo menu item from the Edit menu.
|
protected static String |
STATE_EXTENSION
Extension for VisBio state files.
|
protected JFileChooser |
stateBox
File chooser for state saves.
|
bio
Constructor and Description |
---|
StateManager(VisBioFrame bio)
Constructs a VisBio state management object.
|
StateManager(VisBioFrame bio,
String stateFile)
Constructs a VisBio state management object.
|
Modifier and Type | Method and Description |
---|---|
void |
checkCrash()
Saves an initial VisBio state, then checks to see if VisBio crashed last
time, and if so, asks the user whether to restore the previous state.
|
boolean |
checkSave()
Checks whether the program state has been saved, and if not, prompts the
user to save.
|
void |
destroy()
Deletes VisBio state temp file.
|
void |
doEvent(VisBioEvent evt)
Called to notify the logic manager of a VisBio event.
|
void |
editRedo()
Redoes the last action undone.
|
void |
editReset()
Resets the program to its initial state.
|
void |
editUndo()
Undoes the last action taken.
|
void |
fileRestore()
Restores the current state from a text file specified by the user.
|
void |
fileSave()
Saves the current state to a text file specified by the user.
|
int |
getTasks()
Gets the number of tasks required to initialize this logic manager.
|
boolean |
isRestoring()
Gets whether state is currently being restored.
|
static void |
mergeStates(Vector oldList,
Vector newList)
Merges states between two lists of dynamic objects.
|
void |
restoreState(Element el)
Restores the current state from the given DOM element ("VisBio").
|
void |
restoreState(File file)
Restores the current state from the given state file.
|
void |
saveState(Element el)
Writes the current state to the given DOM element ("VisBio").
|
void |
saveState(File file)
Saves the current state to the given state file.
|
void |
setRestoring(boolean restoring)
Sets whether state is currently being restored.
|
getVisBio
protected static final String STATE_EXTENSION
protected JFileChooser stateBox
protected JMenuItem editUndo
protected JMenuItem editRedo
public StateManager(VisBioFrame bio)
public StateManager(VisBioFrame bio, String stateFile)
public void setRestoring(boolean restoring)
public boolean isRestoring()
public void saveState(File file)
public void restoreState(File file)
public void checkCrash()
public boolean checkSave()
public void destroy()
public void fileRestore()
public void fileSave()
public void editUndo()
public void editRedo()
public void editReset()
public void saveState(Element el) throws SaveException
saveState
in interface Saveable
saveState
in class LogicManager
SaveException
public void restoreState(Element el) throws SaveException
restoreState
in interface Saveable
restoreState
in class LogicManager
SaveException
public void doEvent(VisBioEvent evt)
doEvent
in class LogicManager
public int getTasks()
getTasks
in class LogicManager
public static void mergeStates(Vector oldList, Vector newList)
Dynamic
documentation for more
information.Copyright © 2015–2022 SciJava. All rights reserved.