Class SgsActionEvent
java.lang.Object
org.jjazz.songstructure.api.event.SgsChangeEvent
org.jjazz.songstructure.api.event.SgsActionEvent
An event to indicate that a high-level SongStructure action that changes the song structure has started or is complete.
All other SgsChangeEvents are always preceded and followed by one SgsActionEvent. This can be used by listener to group lower-level change events by actionId. The actionId must be the corresponding method name from the SongStructure interface, e.g. "addSongParts". The "setRhythmParameterValueContent" actionId is used when SongStructure propagates a MutableRpValue change event.
There is the guarantee that if a start SgsActionEvent is received, the complete sgsActionEvent will be received on the same actionId. It's possible that no lower-level change event occur between 2 started/complete action events on the same actionId.
-
Constructor Summary
ConstructorDescriptionSgsActionEvent
(SongStructure sgs, String actionId, boolean isComplete, boolean undo, Object data) -
Method Summary
Methods inherited from class org.jjazz.songstructure.api.event.SgsChangeEvent
getSongPart, getSongParts, getSource, sortSongParts
-
Constructor Details
-
SgsActionEvent
public SgsActionEvent(SongStructure sgs, String actionId, boolean isComplete, boolean undo, Object data) - Parameters:
sgs
-actionId
- The corresponding method name from the SongStructure interface which performs the change, e.g. "addSongParts".isComplete
- False means action has started, true action is completeundo
- True if we're actually undoing the actiondata
- Optional data associated to the event
-
-
Method Details
-
isActionStarted
public boolean isActionStarted() -
isActionComplete
public boolean isActionComplete() -
getData
Optional data associated to the event.Each actionId can have it own kind of data. Check SongStructureImpl.java code to know which data is available.
- Returns:
- Can be null.
-
getActionId
-
isUndo
public boolean isUndo() -
toString
-