Class SgsActionEvent

java.lang.Object
org.jjazz.songstructure.api.event.SgsChangeEvent
org.jjazz.songstructure.api.event.SgsActionEvent

public class SgsActionEvent extends SgsChangeEvent
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 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 complete
      undo - True if we're actually undoing the action
      data - Optional data associated to the event
  • Method Details

    • isActionStarted

      public boolean isActionStarted()
    • isActionComplete

      public boolean isActionComplete()
    • getData

      public Object 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

      public String getActionId()
    • isUndo

      public boolean isUndo()
    • toString

      public String toString()
      Overrides:
      toString in class Object