|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.frinika.sequencer.model.EditHistoryContainer
public class EditHistoryContainer
The EditHistoryContainer monitors all edits on a EditHistoryRecorders. By setting a marking pont using the mark method - it will be possible to roll back to the state at the marking point at a later stage. It's also possible to roll back and roll forward again. This gives undo/redo features to a EditHistoryRecorder. How to use? Simply call the mark method before any action or series of actions on the sequence. Set the markstring according to a description of what can be undone. Remember that all actions on a EditHistoryRecordable has to be either add or remove - also meaning that if you're just going to change a MidiEvent you should always remove it - change it - and then add it to the track again. If you have undo/redo menuitems reference them with the setMenuItem methods, so that they're constantly updated according to the undo/redo marks. You can also reuse your undo/redo menuitems in other windows. Do this by adding a the undo/redo menuitems from this EditHistoryContainer rather than creating them yourself.
Constructor Summary | |
---|---|
EditHistoryContainer()
|
Method Summary | |
---|---|
void |
addEditHistoryListener(EditHistoryListener editHistoryListener)
Add an editHistory listener to this edithistorycontainer |
void |
disableRecording()
Use during undo/redo operations so that these are not recorded in the EditHistory |
void |
enableRecording()
Use after undo/redo operations to reenable edithistory recording |
java.lang.String |
getNextRedoMarkString()
Get the descriptive string of the actions that will be redone on the next redo |
java.lang.String |
getNextUndoMarkString()
Get the descriptive string of the actions that will be rolled back on the next undo |
javax.swing.JMenuItem |
getRedoMenuItem()
|
javax.swing.JMenuItem |
getUndoMenuItem()
|
boolean |
hasChanges()
Tell if there has been any edits on this history container |
boolean |
isRecordingEnabled()
|
void |
mark(java.lang.String markString)
Call the mark method before any action or series of actions on the sequence. |
void |
notifyEditHistoryListeners()
Clients should call this method when done with a marked action, in order to notify listeners for changes. |
void |
push(EditHistoryAction editHistoryAction)
Push a generic editHistoryAction onto the recording |
void |
push(EditHistoryRecorder recorder,
int edit_history_type,
EditHistoryRecordable event)
Called by the FrinikaTrackWrapper add and remove methods when there are changes to the track. |
void |
redo()
Redo actions up to the next mark |
void |
removeEditHistoryListener(EditHistoryListener editHistoryListener)
Remove an editHistory listener from this edithistorycontainer |
void |
setRedoMenuItem(javax.swing.JMenuItem redoMenuItem)
Use to give a menuitem reference to the EditHistoryContainer so that it can update the menuitem text |
void |
setUndoMenuItem(javax.swing.JMenuItem undoMenuItem)
Use to give a menuitem reference to the EditHistoryContainer so that it can update the menuitem text |
void |
undo()
Undo actions back to the previous mark |
void |
updateMenuItems()
Update undo/redo menuitems so that they show info according to the undo/redo marks. |
void |
updateSavedPosition()
Called by the ProjectContainer when saving the project so that hasChanges() will return false as long as there are no changes after the save |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EditHistoryContainer()
Method Detail |
---|
public void push(EditHistoryRecorder recorder, int edit_history_type, EditHistoryRecordable event)
edit_history_type
- track
- event
- public void push(EditHistoryAction editHistoryAction)
editHistoryAction
- public void mark(java.lang.String markString)
markString
- public void notifyEditHistoryListeners()
public void addEditHistoryListener(EditHistoryListener editHistoryListener)
editHistoryListener
- public void removeEditHistoryListener(EditHistoryListener editHistoryListener)
editHistoryListener
- public void redo()
public java.lang.String getNextUndoMarkString()
public java.lang.String getNextRedoMarkString()
public void undo()
public void updateMenuItems()
public javax.swing.JMenuItem getRedoMenuItem()
public javax.swing.JMenuItem getUndoMenuItem()
public void setRedoMenuItem(javax.swing.JMenuItem redoMenuItem)
redoMenuItem
- public void setUndoMenuItem(javax.swing.JMenuItem undoMenuItem)
redoMenuItem
- public boolean hasChanges()
public boolean isRecordingEnabled()
public void disableRecording()
public void enableRecording()
public void updateSavedPosition()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |