com.virtuosotechnologies.asaph.model
Interface ChordAnnotation

All Superinterfaces:
SongLineMember, SongMember

public interface ChordAnnotation
extends SongLineMember

A SongLineMember that represents a chord annotation.


Method Summary
 ChordSet getChordSet()
          Get the ChordSet relevant to this annotation.
 Chord[] getFollowingChords()
          Get the array of chords that should follow the main chord.
 Chord[] getPrecedingChords()
          Get the array of chords that should precede the main chord.
 Chord getPrimaryChord()
          Get the primary chord.
 boolean isInChordSet(ChordSet cs)
          Returns true if this annotation in the given ChordSet.
 void setFollowingChords(Chord[] chords, UndoableEditListener undoListener)
          Set the array of chords that should follow the main one.
 void setPrecedingChords(Chord[] chords, UndoableEditListener undoListener)
          Set the array of chords that should precede the main one.
 void setPrimaryChord(Chord chord, UndoableEditListener undoListener)
          Set the primary chord.
 
Methods inherited from interface com.virtuosotechnologies.asaph.model.SongLineMember
getSongLine
 
Methods inherited from interface com.virtuosotechnologies.asaph.model.SongMember
getSong, isDefunct
 

Method Detail

getChordSet

public ChordSet getChordSet()
Get the ChordSet relevant to this annotation. Every annotation is part of a ChordSet. Note that this method may be slow, since implementations may need to search the Song for the correct ChordSet. If all you need to do is determine whether this annotation is associated with a given ChordSet, use isInChordSet instead, which may be optimized by the implementation.

Returns:
ChordSet this annotation is part of

isInChordSet

public boolean isInChordSet(ChordSet cs)
Returns true if this annotation in the given ChordSet. Implementations of this method may be faster than getChordSet().equals(). Returns false but does not throw an exception if the given ChordSet is null, or is not a member of the Song containing this annotation

Parameters:
cs - ChordSet to match with
Returns:
true if this annotation is in the given ChordSet

getPrimaryChord

public Chord getPrimaryChord()
Get the primary chord.

Returns:
the chord

getPrecedingChords

public Chord[] getPrecedingChords()
Get the array of chords that should precede the main chord. This will return an empty array if there are no preceding chords.

Returns:
the chord array

getFollowingChords

public Chord[] getFollowingChords()
Get the array of chords that should follow the main chord. This will return an empty array if there are no following chords.

Returns:
the chord array

setPrimaryChord

public void setPrimaryChord(Chord chord,
                            UndoableEditListener undoListener)
Set the primary chord. The primary chord may not be null.

Parameters:
chord - the chord.
undoListener - listener to notify if an undoable edit is generated, or null to suppress generation of undoable edits

setPrecedingChords

public void setPrecedingChords(Chord[] chords,
                               UndoableEditListener undoListener)
Set the array of chords that should precede the main one. You may pass null or the empty array for no preceding chords.

Parameters:
chords - the chord array
undoListener - listener to notify if an undoable edit is generated, or null to suppress generation of undoable edits

setFollowingChords

public void setFollowingChords(Chord[] chords,
                               UndoableEditListener undoListener)
Set the array of chords that should follow the main one. You may pass null or the empty array for no following chords.

Parameters:
chords - the chord array
undoListener - listener to notify if an undoable edit is generated, or null to suppress generation of undoable edits