Package de.sciss.app
Class AbstractCompoundEdit
- java.lang.Object
-
- javax.swing.undo.AbstractUndoableEdit
-
- javax.swing.undo.CompoundEdit
-
- de.sciss.app.AbstractCompoundEdit
-
- All Implemented Interfaces:
PerformableEdit,java.io.Serializable,javax.swing.undo.UndoableEdit
- Direct Known Subclasses:
BasicCompoundEdit
public abstract class AbstractCompoundEdit extends javax.swing.undo.CompoundEdit implements PerformableEdit
This subclass ofCompoundEditis used to synchronize an Undo or Redo operation. If for example, several edits of writing to a MultirateTrackEditor are recorded, this happens in a synchronized block. This class guarantees that an appropriate synchronization is maintained in an undo / redo operation.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractCompoundEdit()Creates aCompountEditobjectprotectedAbstractCompoundEdit(java.lang.String presentationName)Creates aCompountEditobject with a given name
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddPerform(PerformableEdit edit)voidcancel()Cancels the compound edit and undos all sub edits made so far.protected abstract voidcancelDone()This gets called after the cancel operation but still inside the sync block.voiddebugDump(int nest)java.lang.StringgetPresentationName()java.lang.StringgetRedoPresentationName()protected java.lang.StringgetResourceString(java.lang.String key)java.lang.StringgetUndoPresentationName()PerformableEditperform()voidredo()Performs redo on all compound sub editsprotected abstract voidredoDone()This gets called after the redo operation but still inside the sync block.voidundo()Performs undo on all compound sub editsprotected abstract voidundoDone()This gets called after the undo operation but still inside the sync block.-
Methods inherited from class javax.swing.undo.CompoundEdit
addEdit, canRedo, canUndo, die, end, isInProgress, isSignificant, lastEdit, toString
-
-
-
-
Constructor Detail
-
AbstractCompoundEdit
protected AbstractCompoundEdit()
Creates aCompountEditobject
-
AbstractCompoundEdit
protected AbstractCompoundEdit(java.lang.String presentationName)
Creates aCompountEditobject with a given name- Parameters:
presentationName- text describing the compound edit
-
-
Method Detail
-
undo
public void undo()
Performs undo on all compound sub edits- Specified by:
undoin interfacejavax.swing.undo.UndoableEdit- Overrides:
undoin classjavax.swing.undo.CompoundEdit
-
redo
public void redo()
Performs redo on all compound sub edits- Specified by:
redoin interfacejavax.swing.undo.UndoableEdit- Overrides:
redoin classjavax.swing.undo.CompoundEdit
-
cancel
public void cancel()
Cancels the compound edit and undos all sub edits made so far.
-
undoDone
protected abstract void undoDone()
This gets called after the undo operation but still inside the sync block. Subclasses can use this to fire any notification events.
-
redoDone
protected abstract void redoDone()
This gets called after the redo operation but still inside the sync block. Subclasses can use this to fire any notification events.
-
cancelDone
protected abstract void cancelDone()
This gets called after the cancel operation but still inside the sync block. Subclasses can use this to fire any notification events.
-
getPresentationName
public java.lang.String getPresentationName()
- Specified by:
getPresentationNamein interfacejavax.swing.undo.UndoableEdit- Overrides:
getPresentationNamein classjavax.swing.undo.CompoundEdit
-
getUndoPresentationName
public java.lang.String getUndoPresentationName()
- Specified by:
getUndoPresentationNamein interfacejavax.swing.undo.UndoableEdit- Overrides:
getUndoPresentationNamein classjavax.swing.undo.CompoundEdit
-
getRedoPresentationName
public java.lang.String getRedoPresentationName()
- Specified by:
getRedoPresentationNamein interfacejavax.swing.undo.UndoableEdit- Overrides:
getRedoPresentationNamein classjavax.swing.undo.CompoundEdit
-
getResourceString
protected java.lang.String getResourceString(java.lang.String key)
-
addPerform
public void addPerform(PerformableEdit edit)
-
perform
public PerformableEdit perform()
- Specified by:
performin interfacePerformableEdit
-
debugDump
public void debugDump(int nest)
- Specified by:
debugDumpin interfacePerformableEdit
-
-