Class SgsActionEvent

java.lang.Object
org.jjazz.songstructure.api.event.SgsChangeEvent
org.jjazz.songstructure.api.event.SgsActionEvent
Direct Known Subclasses:
SongMetaEvents.SgsSourceActionEvent

public class SgsActionEvent extends SgsChangeEvent
An event to indicate that a high-level action, i.e. a call to a public API method that mutates the song structure, has started or is complete.

All low-level SgsChangeEvents fired by a SongStructure are always preceded and followed by start and complete SgsActionEvents. The complete SgsActionEvent contains the low-level SgsChangeEvents.

See Also:
  • Constructor Details

    • SgsActionEvent

      public SgsActionEvent(SongStructure src, SgsActionEvent.API_ID apiId, Object data)
      Create a SgsActionEvent in started state, with no subEvents.
      Parameters:
      src -
      apiId -
      data - An optional data associated to the event
  • Method Details

    • getApiId

      public SgsActionEvent.API_ID getApiId()
    • isComplete

      public boolean isComplete()
      Check if complete() was called.
      Returns:
      See Also:
    • complete

      public void complete()
      Mark this SgsActionEvent as complete.
      See Also:
    • addSubEvent

      public void addSubEvent(SgsChangeEvent e)
      Add a SgsChangeEvent to this SgsActionEvent.
      Parameters:
      e - Can not be a SgsActionEvent
    • getSubEvents

      public List<SgsChangeEvent> getSubEvents()
      The lower-level SgsChangeEvents added to this instance.
      Returns:
      An unmodifiable list. Can be empty.
    • 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.
    • toString

      public String toString()
      Overrides:
      toString in class Object