Class ClsChangeEvent
java.lang.Object
org.jjazz.chordleadsheet.api.event.ClsChangeEvent
- Direct Known Subclasses:
DeletedBarsEvent, InsertedBarsEvent, ItemAddedEvent, ItemChangedEvent, ItemMovedEvent, ItemRemovedEvent, SectionAddedEvent, SectionChangedEvent, SectionMovedEvent, SectionRemovedEvent
Each mutating ChordLeadSheet API method fires one ClsChangeEvent.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddItemChanges(List<PropertyChangeEvent> changes) Add some ChordLeadSheetItem change events generated by this change.getItem()Get all the ChordLeadSheetItem change events generated by this change.getItemChanges(String propertyName) Get the ChordLeadSheetItem change events which match propertyName.getItems()<T extends ChordLeadSheetItem<?>>
List<T> Get the items which are instance the specified class.booleanisRedo()True if this is a redo event, i.e. this event's change was just redone.booleanisUndo()True if this is an undo event, i.e. this event's change was just undone.booleanvoidSet isRedo to true.voidSet isUndo to true.
-
Method Details
-
setIsUndo
public void setIsUndo()Set isUndo to true. -
setIsRedo
public void setIsRedo()Set isRedo to true. -
isUndo
public boolean isUndo()True if this is an undo event, i.e. this event's change was just undone.- Returns:
- See Also:
-
isRedo
public boolean isRedo()True if this is a redo event, i.e. this event's change was just redone.- Returns:
- See Also:
-
isUndoOrRedo
public boolean isUndoOrRedo() -
getItem
- Returns:
- The first item associated to the event, or null if no item associated to the event.
-
getItems
- Returns:
- An ordered list of items
-
getItems
Get the items which are instance the specified class.- Type Parameters:
T-- Parameters:
clazz-- Returns:
-
addItemChanges
Add some ChordLeadSheetItem change events generated by this change.- Parameters:
changes- PropertyChangeEvents must be adapted to this event's undo/redo state.
-
getItemChanges
Get all the ChordLeadSheetItem change events generated by this change.- Returns:
- Can be empty. Returned PropertyChangeEvents are adapted to the undo/redo state, i.e caller does not need to reverse oldValue/newValue if isUndo() is true.
-
getItemChanges
Get the ChordLeadSheetItem change events which match propertyName.- Parameters:
propertyName-- Returns:
- Can be empty
-
getSource
-