Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.virtuosotechnologies.asaph.standardmodel
Class StdChordAnnotation  view StdChordAnnotation download StdChordAnnotation.java

java.lang.Object
  extended bycom.virtuosotechnologies.lib.base.LinkedObject
      extended bycom.virtuosotechnologies.asaph.standardmodel.BaseSongMember
          extended bycom.virtuosotechnologies.asaph.standardmodel.StdChordAnnotation
All Implemented Interfaces:
com.virtuosotechnologies.asaph.model.ChordAnnotation, com.virtuosotechnologies.asaph.model.SongLineMember, com.virtuosotechnologies.asaph.model.SongMember

class StdChordAnnotation
extends BaseSongMember
implements com.virtuosotechnologies.asaph.model.ChordAnnotation

Standard implementation of ChordAnnotation


Nested Class Summary
(package private)  class StdChordAnnotation.ParseHandler
           
 
Field Summary
private  StdChordSet chordSet_
           
private  com.virtuosotechnologies.asaph.model.notation.Chord main_
           
private  com.virtuosotechnologies.asaph.model.notation.Chord[] post_
           
private  com.virtuosotechnologies.asaph.model.notation.Chord[] pre_
           
 
Fields inherited from class com.virtuosotechnologies.lib.base.LinkedObject
 
Constructor Summary
(package private) StdChordAnnotation(StdSongLine parent, StdChordSet chordSet, com.virtuosotechnologies.asaph.model.notation.Chord main, com.virtuosotechnologies.asaph.model.notation.Chord[] pre, com.virtuosotechnologies.asaph.model.notation.Chord[] post)
           
 
Method Summary
private  com.virtuosotechnologies.asaph.model.notation.Chord[] analyzeNewChords(com.virtuosotechnologies.asaph.model.notation.Chord[] chords, com.virtuosotechnologies.asaph.model.notation.Chord[] oldChords)
           
 com.virtuosotechnologies.asaph.model.ChordSet getChordSet()
          Get the ChordSet relevant to this annotation.
 com.virtuosotechnologies.asaph.model.notation.Chord[] getFollowingChords()
          Get the array of chords that should follow the main chord.
 com.virtuosotechnologies.asaph.model.notation.Chord[] getPrecedingChords()
          Get the array of chords that should precede the main chord.
 com.virtuosotechnologies.asaph.model.notation.Chord getPrimaryChord()
          Get the primary chord.
 com.virtuosotechnologies.asaph.model.Song getSong()
          Returns the Song containing this SongMember.
 com.virtuosotechnologies.asaph.model.SongLine getSongLine()
          Get the containing song line
(package private)  void internalClearDefunct()
           
(package private)  BaseSongMember internalGetParent()
           
(package private)  void internalReportUndoableEdit(javax.swing.event.UndoableEditListener undoListener, javax.swing.undo.UndoableEdit edit)
           
(package private)  void internalSetDefunct()
           
 boolean isDefunct()
          Returns true if this object is defunct-- that is, if it or any of its ancestors has been removed.
 boolean isInChordSet(com.virtuosotechnologies.asaph.model.ChordSet cs)
          Returns true if this annotation in the given ChordSet.
 void setFollowingChords(com.virtuosotechnologies.asaph.model.notation.Chord[] chords, javax.swing.event.UndoableEditListener undoListener)
          Set the array of chords that should follow the main one.
 void setPrecedingChords(com.virtuosotechnologies.asaph.model.notation.Chord[] chords, javax.swing.event.UndoableEditListener undoListener)
          Set the array of chords that should precede the main one.
 void setPrimaryChord(com.virtuosotechnologies.asaph.model.notation.Chord chord, javax.swing.event.UndoableEditListener undoListener)
          Set the primary chord.
(package private)  void unparse(com.virtuosotechnologies.lib.xml.XMLUnparser unparser)
           
 
Methods inherited from class com.virtuosotechnologies.lib.base.LinkedObject
getNext, getPrevious, linkThisAfter, linkThisBefore, unlinkThis
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.virtuosotechnologies.asaph.model.SongMember
getSong, isDefunct
 

Field Detail

chordSet_

private StdChordSet chordSet_

main_

private com.virtuosotechnologies.asaph.model.notation.Chord main_

pre_

private com.virtuosotechnologies.asaph.model.notation.Chord[] pre_

post_

private com.virtuosotechnologies.asaph.model.notation.Chord[] post_
Constructor Detail

StdChordAnnotation

StdChordAnnotation(StdSongLine parent,
                   StdChordSet chordSet,
                   com.virtuosotechnologies.asaph.model.notation.Chord main,
                   com.virtuosotechnologies.asaph.model.notation.Chord[] pre,
                   com.virtuosotechnologies.asaph.model.notation.Chord[] post)
Method Detail

unparse

void unparse(com.virtuosotechnologies.lib.xml.XMLUnparser unparser)
       throws java.io.IOException

getSongLine

public com.virtuosotechnologies.asaph.model.SongLine getSongLine()
Get the containing song line

Specified by:
getSongLine in interface com.virtuosotechnologies.asaph.model.SongLineMember

getChordSet

public com.virtuosotechnologies.asaph.model.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.

Specified by:
getChordSet in interface com.virtuosotechnologies.asaph.model.ChordAnnotation

isInChordSet

public boolean isInChordSet(com.virtuosotechnologies.asaph.model.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

Specified by:
isInChordSet in interface com.virtuosotechnologies.asaph.model.ChordAnnotation

getPrimaryChord

public com.virtuosotechnologies.asaph.model.notation.Chord getPrimaryChord()
Get the primary chord.

Specified by:
getPrimaryChord in interface com.virtuosotechnologies.asaph.model.ChordAnnotation

getPrecedingChords

public com.virtuosotechnologies.asaph.model.notation.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.

Specified by:
getPrecedingChords in interface com.virtuosotechnologies.asaph.model.ChordAnnotation

getFollowingChords

public com.virtuosotechnologies.asaph.model.notation.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.

Specified by:
getFollowingChords in interface com.virtuosotechnologies.asaph.model.ChordAnnotation

setPrimaryChord

public void setPrimaryChord(com.virtuosotechnologies.asaph.model.notation.Chord chord,
                            javax.swing.event.UndoableEditListener undoListener)
Set the primary chord. The primary chord may not be null.

Specified by:
setPrimaryChord in interface com.virtuosotechnologies.asaph.model.ChordAnnotation

analyzeNewChords

private com.virtuosotechnologies.asaph.model.notation.Chord[] analyzeNewChords(com.virtuosotechnologies.asaph.model.notation.Chord[] chords,
                                                                               com.virtuosotechnologies.asaph.model.notation.Chord[] oldChords)

setPrecedingChords

public void setPrecedingChords(com.virtuosotechnologies.asaph.model.notation.Chord[] chords,
                               javax.swing.event.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.

Specified by:
setPrecedingChords in interface com.virtuosotechnologies.asaph.model.ChordAnnotation

setFollowingChords

public void setFollowingChords(com.virtuosotechnologies.asaph.model.notation.Chord[] chords,
                               javax.swing.event.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.

Specified by:
setFollowingChords in interface com.virtuosotechnologies.asaph.model.ChordAnnotation

internalSetDefunct

void internalSetDefunct()

internalClearDefunct

void internalClearDefunct()

internalReportUndoableEdit

void internalReportUndoableEdit(javax.swing.event.UndoableEditListener undoListener,
                                javax.swing.undo.UndoableEdit edit)

internalGetParent

BaseSongMember internalGetParent()

isDefunct

public boolean isDefunct()
Returns true if this object is defunct-- that is, if it or any of its ancestors has been removed. If this returns true, the behavior of any other methods on this object is undefined.

Specified by:
isDefunct in interface com.virtuosotechnologies.asaph.model.SongMember

getSong

public com.virtuosotechnologies.asaph.model.Song getSong()
Returns the Song containing this SongMember. If this member is defunct, this will return the song that contained this member before the member was defuncted.

Specified by:
getSong in interface com.virtuosotechnologies.asaph.model.SongMember