Package com.softsynth.jmsl.score
Class UndoStack
java.lang.Object
com.softsynth.jmsl.score.UndoStack
- All Implemented Interfaces:
DirtyListener
public class UndoStack extends java.lang.Object implements DirtyListener
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description booleananythingToRedo()booleananythingToUndo()voidclear()removes all snapshots and calls Java garbage collection & delete any Files in undo_cachestatic voidclearUndoCache()Caution this deletes ALL files in undo_cache directory, even undo snapshots written by other Scores' undoStacksjava.io.FilegetNextUndoFile()java.lang.StringgetRedoName()longgetSizeOfTOS()java.util.VectorgetSnapshots()longgetTotalSize()booleanisUseMemory()voidnotifyDirty(Score score, boolean flag, java.lang.String msg)voidredo()voidsaveSnapshot(java.lang.Object fileOrArray, java.lang.String eventMsg)add a new state of score to vector of states.voidsetUseMemory(boolean useMemory)voidundo()Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
UndoStack
-
-
Method Details
-
getNextUndoFile
public java.io.File getNextUndoFile() -
clearUndoCache
public static void clearUndoCache()Caution this deletes ALL files in undo_cache directory, even undo snapshots written by other Scores' undoStacks -
isUseMemory
public boolean isUseMemory()- Returns:
- the useMemory
-
setUseMemory
public void setUseMemory(boolean useMemory)- Parameters:
useMemory- the useMemory to set
-
saveSnapshot
public void saveSnapshot(java.lang.Object fileOrArray, java.lang.String eventMsg)add a new state of score to vector of states. Kill off all states past current cursor index. -
clear
public void clear()removes all snapshots and calls Java garbage collection & delete any Files in undo_cache -
getSizeOfTOS
public long getSizeOfTOS()- Returns:
- size in MB of top image on stack
-
getTotalSize
public long getTotalSize()- Returns:
- total mb stored in stack
-
getSnapshots
public java.util.Vector getSnapshots() -
undo
public void undo() throws java.io.FileNotFoundException- Throws:
java.io.FileNotFoundException
-
redo
public void redo() throws java.io.FileNotFoundException- Throws:
java.io.FileNotFoundException
-
anythingToUndo
public boolean anythingToUndo() -
getRedoName
public java.lang.String getRedoName() -
anythingToRedo
public boolean anythingToRedo() -
notifyDirty
- Specified by:
notifyDirtyin interfaceDirtyListener
-