com.frinika.sequencer.model
Class EditHistoryRecordableAction

java.lang.Object
  extended by com.frinika.sequencer.model.EditHistoryRecordableAction
All Implemented Interfaces:
EditHistoryAction

public class EditHistoryRecordableAction
extends java.lang.Object
implements EditHistoryAction

EditHistoryRecordableActions handles add/remove operations on editHistoryRecordables It will automatically handle everything involving cloning, undo and redo etc.

Author:
Peter Johan Salomonsen

Field Summary
static int EDIT_HISTORY_TYPE_ADD
           
static int EDIT_HISTORY_TYPE_REMOVE
           
 
Constructor Summary
EditHistoryRecordableAction(EditHistoryContainer editHistoryContainer, EditHistoryRecorder recorder, int editHistoryType, EditHistoryRecordable recordable)
           
 
Method Summary
 int getEditHistoryType()
           
 EditHistoryRecordableAction getInvertedClone()
          Return a cloned EditHistoryEntry with the opposite editHistoryType.
 EditHistoryRecordable getRecordable()
           
 void redo()
          This method should be called by the EditHistory container
 java.lang.String toString()
           
 void undo()
          This method should be called by the EditHistory container
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EDIT_HISTORY_TYPE_ADD

public static final int EDIT_HISTORY_TYPE_ADD
See Also:
Constant Field Values

EDIT_HISTORY_TYPE_REMOVE

public static final int EDIT_HISTORY_TYPE_REMOVE
See Also:
Constant Field Values
Constructor Detail

EditHistoryRecordableAction

public EditHistoryRecordableAction(EditHistoryContainer editHistoryContainer,
                                   EditHistoryRecorder recorder,
                                   int editHistoryType,
                                   EditHistoryRecordable recordable)
Parameters:
editHistoryContainer -
recorder -
editHistoryType -
recordable - - Either a MultiEvent or MidiEvent
Method Detail

getEditHistoryType

public int getEditHistoryType()
Returns:
Returns the editHistoryType.

getRecordable

public EditHistoryRecordable getRecordable()
Returns:
Returns the event (Either a MultiEvent or a MidiEvent) affected by this entry

undo

public void undo()
This method should be called by the EditHistory container

Specified by:
undo in interface EditHistoryAction

redo

public void redo()
This method should be called by the EditHistory container

Specified by:
redo in interface EditHistoryAction

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getInvertedClone

public EditHistoryRecordableAction getInvertedClone()
Return a cloned EditHistoryEntry with the opposite editHistoryType. Used to notify listeners when undoing in order to indicate that the previous action was reversed

Returns: