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

    Constructors
    Constructor Description
    UndoStack​(Score score)  
  • Method Summary

    Modifier and Type Method Description
    boolean anythingToRedo()  
    boolean anythingToUndo()  
    void clear()
    removes all snapshots and calls Java garbage collection & delete any Files in undo_cache
    static void clearUndoCache()
    Caution this deletes ALL files in undo_cache directory, even undo snapshots written by other Scores' undoStacks
    java.io.File getNextUndoFile()  
    java.lang.String getRedoName()  
    long getSizeOfTOS()  
    java.util.Vector getSnapshots()  
    long getTotalSize()  
    boolean isUseMemory()  
    void notifyDirty​(Score score, boolean flag, java.lang.String msg)  
    void redo()  
    void saveSnapshot​(java.lang.Object fileOrArray, java.lang.String eventMsg)
    add a new state of score to vector of states.
    void setUseMemory​(boolean useMemory)  
    void undo()  

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • UndoStack

      public UndoStack​(Score score)
  • 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

      public void notifyDirty​(Score score, boolean flag, java.lang.String msg)
      Specified by:
      notifyDirty in interface DirtyListener