Package org.jjazz.song.api
Class StructuralChangeListener
java.lang.Object
org.jjazz.song.api.StructuralChangeListener
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,ClsChangeListener
,SgsChangeListener
public class StructuralChangeListener
extends Object
implements ClsChangeListener, SgsChangeListener, PropertyChangeListener
A song listener to detect a structural change in the song: bar added or removed, time signature changed, section moved.
Chord symbols changes or rhythm parameter changes are not structural changes.
The listener automatically unregisters itself if song is closed.
-
Constructor Summary
ConstructorDescriptionStructuralChangeListener
(Song song, ChangeListener listener) Create a listener for structural changes in the song. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Some change events might need to be authorized by all listeners before being processed by chordLeadSheetChanged().void
Some change events might need to be authorized by all listeners before being processed by songStructureChanged().void
Process the change.void
cleanup()
void
void
Process the change.
-
Constructor Details
-
StructuralChangeListener
Create a listener for structural changes in the song.- Parameters:
song
-listener
- Called when a structural change occured.
-
-
Method Details
-
cleanup
public void cleanup() -
authorizeChange
Description copied from interface:ClsChangeListener
Some change events might need to be authorized by all listeners before being processed by chordLeadSheetChanged().- Specified by:
authorizeChange
in interfaceClsChangeListener
- Parameters:
e
- The change to authorize.- Throws:
UnsupportedEditException
- Listener shall throw this exception if change is not acceptable. Exception message might be shown to user to explain the problem.
-
chordLeadSheetChanged
Description copied from interface:ClsChangeListener
Process the change.Note that this method might be called outside of the EDT.
- Specified by:
chordLeadSheetChanged
in interfaceClsChangeListener
-
authorizeChange
Description copied from interface:SgsChangeListener
Some change events might need to be authorized by all listeners before being processed by songStructureChanged().- Specified by:
authorizeChange
in interfaceSgsChangeListener
- Parameters:
e
- The change to authorize.- Throws:
UnsupportedEditException
- Listener shall throw this exception if change is not acceptable. Exception message might be shown to user to explain the problem.
-
songStructureChanged
Description copied from interface:SgsChangeListener
Process the change.Note that this method might be called outside of the EDT.
- Specified by:
songStructureChanged
in interfaceSgsChangeListener
-
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
-