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

Quick Search    Search Deep

com.virtuosotechnologies.asaph.notationmanager
Class StandardNotationFactory  view StandardNotationFactory download StandardNotationFactory.java

java.lang.Object
  extended bycom.virtuosotechnologies.asaph.notationmanager.StandardNotationFactory
All Implemented Interfaces:
com.virtuosotechnologies.asaph.model.notation.NotationFactory

class StandardNotationFactory
extends java.lang.Object
implements com.virtuosotechnologies.asaph.model.notation.NotationFactory

Standard implementation of NotationFactory


Field Summary
private  StandardNote defaultNote_
           
private  StandardChord emptyChord_
           
private  StandardNoteModifier flatModifier_
           
private  StandardNote[] guiBaseNotes_
           
private  boolean isGerman_
           
private  java.util.LinkedHashMap longIntervalStrings_
           
private  StandardNoteModifier naturalModifier_
           
private  StandardNote[] parseBaseNotes_
           
private  StandardNoteModifier sharpModifier_
           
private static java.lang.String STR_Interval_Unknown
           
private static java.lang.String STR_NoteModifier_DoubleFlat
           
private static java.lang.String STR_NoteModifier_DoubleSharp
           
private static java.lang.String STR_NoteModifier_Flat
           
private static java.lang.String STR_NoteModifier_Natural
           
private static java.lang.String STR_NoteModifier_Sharp
           
private static com.virtuosotechnologies.lib.util.LocalizedStringBuilder strings_
           
 
Constructor Summary
(package private) StandardNotationFactory(boolean isGerman)
           
 
Method Summary
(package private)  StandardNote addIntervalToNote(int letterValue, int pitchValue, boolean isCaps, int letterDiff, int pitchDiff)
           
 com.virtuosotechnologies.asaph.model.notation.Note[] getBaseNotes()
          Get an array of the base notes-- that is, with a default modifier (usually natural).
 com.virtuosotechnologies.asaph.model.notation.Interval[] getCommonIntervals()
          Get an array of the common intervals.
 com.virtuosotechnologies.asaph.model.notation.NoteModifier[] getCommonModifiersForNote(com.virtuosotechnologies.asaph.model.notation.Note note)
          Get an array of common modifiers for the given base note.
 com.virtuosotechnologies.asaph.model.notation.Note getDefaultNote()
          Construct a default Note
 com.virtuosotechnologies.asaph.model.notation.NoteModifier getDefaultNoteModifierFor(com.virtuosotechnologies.asaph.model.notation.Note n)
          Get the default NoteModifier (typically natural) for the given note.
 com.virtuosotechnologies.asaph.model.notation.Chord getEmptyChord()
          Construct an empty Chord
(package private)  java.lang.String getLongStringForInterval(StandardInterval interval)
           
(package private)  java.lang.String getLongStringForNoteModifierValue(int value)
           
(package private)  java.lang.String getShortStringForNoteModifierValue(int value)
           
(package private)  java.lang.String getStringForChord(StandardNote mainNote, java.lang.String mainType, StandardNote bassNote, java.lang.String bassType)
           
(package private)  java.lang.String getStringForNote(int letterValue, int pitchValue, StandardNoteModifier modifier, boolean isCaps)
           
 boolean isModifierAllowedForNote(com.virtuosotechnologies.asaph.model.notation.Note note, com.virtuosotechnologies.asaph.model.notation.NoteModifier mod)
          Is the given modifier allowed for the given note?
 com.virtuosotechnologies.asaph.model.notation.Chord parseChord(java.lang.String str)
          Parse a Chord from a String
 com.virtuosotechnologies.asaph.model.notation.Chord[] parseChordArray(java.lang.String str)
          Parse a Chord array from a String
(package private)  StandardChord parseChordFromScanner(StringScanner scan)
           
 com.virtuosotechnologies.asaph.model.notation.Note parseNote(java.lang.String str)
          Parse a Note from a String
 com.virtuosotechnologies.asaph.model.notation.Note[] parseNoteArray(java.lang.String str)
          Parse a Note array from a String
(package private)  StandardNote parseNoteFromScanner(StringScanner str)
           
(package private)  StandardNote rawCreateNote(int letterValue, int basePitchValue, int modifierValue, boolean isCaps)
           
 java.lang.String unparseChordArray(com.virtuosotechnologies.asaph.model.notation.Chord[] chords)
          Generate a string for a chord array
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isGerman_

private boolean isGerman_

naturalModifier_

private StandardNoteModifier naturalModifier_

flatModifier_

private StandardNoteModifier flatModifier_

sharpModifier_

private StandardNoteModifier sharpModifier_

defaultNote_

private StandardNote defaultNote_

emptyChord_

private StandardChord emptyChord_

guiBaseNotes_

private StandardNote[] guiBaseNotes_

parseBaseNotes_

private StandardNote[] parseBaseNotes_

strings_

private static final com.virtuosotechnologies.lib.util.LocalizedStringBuilder strings_

STR_NoteModifier_Natural

private static final java.lang.String STR_NoteModifier_Natural

STR_NoteModifier_Sharp

private static final java.lang.String STR_NoteModifier_Sharp

STR_NoteModifier_Flat

private static final java.lang.String STR_NoteModifier_Flat

STR_NoteModifier_DoubleSharp

private static final java.lang.String STR_NoteModifier_DoubleSharp

STR_NoteModifier_DoubleFlat

private static final java.lang.String STR_NoteModifier_DoubleFlat

STR_Interval_Unknown

private static final java.lang.String STR_Interval_Unknown

longIntervalStrings_

private java.util.LinkedHashMap longIntervalStrings_
Constructor Detail

StandardNotationFactory

StandardNotationFactory(boolean isGerman)
Method Detail

getLongStringForNoteModifierValue

java.lang.String getLongStringForNoteModifierValue(int value)

getShortStringForNoteModifierValue

java.lang.String getShortStringForNoteModifierValue(int value)

getStringForNote

java.lang.String getStringForNote(int letterValue,
                                  int pitchValue,
                                  StandardNoteModifier modifier,
                                  boolean isCaps)

rawCreateNote

StandardNote rawCreateNote(int letterValue,
                           int basePitchValue,
                           int modifierValue,
                           boolean isCaps)

getLongStringForInterval

java.lang.String getLongStringForInterval(StandardInterval interval)

getStringForChord

java.lang.String getStringForChord(StandardNote mainNote,
                                   java.lang.String mainType,
                                   StandardNote bassNote,
                                   java.lang.String bassType)

parseNoteFromScanner

StandardNote parseNoteFromScanner(StringScanner str)

parseChordFromScanner

StandardChord parseChordFromScanner(StringScanner scan)

addIntervalToNote

StandardNote addIntervalToNote(int letterValue,
                               int pitchValue,
                               boolean isCaps,
                               int letterDiff,
                               int pitchDiff)

getCommonIntervals

public com.virtuosotechnologies.asaph.model.notation.Interval[] getCommonIntervals()
Get an array of the common intervals. This is used to construct choosers for intervals.

Specified by:
getCommonIntervals in interface com.virtuosotechnologies.asaph.model.notation.NotationFactory

getBaseNotes

public com.virtuosotechnologies.asaph.model.notation.Note[] getBaseNotes()
Get an array of the base notes-- that is, with a default modifier (usually natural). This is used to construct choosers for notes.

Specified by:
getBaseNotes in interface com.virtuosotechnologies.asaph.model.notation.NotationFactory

getCommonModifiersForNote

public com.virtuosotechnologies.asaph.model.notation.NoteModifier[] getCommonModifiersForNote(com.virtuosotechnologies.asaph.model.notation.Note note)
Get an array of common modifiers for the given base note. This is used to construct choosers for notes.

Specified by:
getCommonModifiersForNote in interface com.virtuosotechnologies.asaph.model.notation.NotationFactory

isModifierAllowedForNote

public boolean isModifierAllowedForNote(com.virtuosotechnologies.asaph.model.notation.Note note,
                                        com.virtuosotechnologies.asaph.model.notation.NoteModifier mod)
Is the given modifier allowed for the given note?


getDefaultNoteModifierFor

public com.virtuosotechnologies.asaph.model.notation.NoteModifier getDefaultNoteModifierFor(com.virtuosotechnologies.asaph.model.notation.Note n)
Get the default NoteModifier (typically natural) for the given note.

Specified by:
getDefaultNoteModifierFor in interface com.virtuosotechnologies.asaph.model.notation.NotationFactory

parseNote

public com.virtuosotechnologies.asaph.model.notation.Note parseNote(java.lang.String str)
Parse a Note from a String

Specified by:
parseNote in interface com.virtuosotechnologies.asaph.model.notation.NotationFactory

parseNoteArray

public com.virtuosotechnologies.asaph.model.notation.Note[] parseNoteArray(java.lang.String str)
Parse a Note array from a String

Specified by:
parseNoteArray in interface com.virtuosotechnologies.asaph.model.notation.NotationFactory

parseChord

public com.virtuosotechnologies.asaph.model.notation.Chord parseChord(java.lang.String str)
Parse a Chord from a String

Specified by:
parseChord in interface com.virtuosotechnologies.asaph.model.notation.NotationFactory

parseChordArray

public com.virtuosotechnologies.asaph.model.notation.Chord[] parseChordArray(java.lang.String str)
Parse a Chord array from a String

Specified by:
parseChordArray in interface com.virtuosotechnologies.asaph.model.notation.NotationFactory

unparseChordArray

public java.lang.String unparseChordArray(com.virtuosotechnologies.asaph.model.notation.Chord[] chords)
Generate a string for a chord array

Specified by:
unparseChordArray in interface com.virtuosotechnologies.asaph.model.notation.NotationFactory

getEmptyChord

public com.virtuosotechnologies.asaph.model.notation.Chord getEmptyChord()
Construct an empty Chord

Specified by:
getEmptyChord in interface com.virtuosotechnologies.asaph.model.notation.NotationFactory

getDefaultNote

public com.virtuosotechnologies.asaph.model.notation.Note getDefaultNote()
Construct a default Note

Specified by:
getDefaultNote in interface com.virtuosotechnologies.asaph.model.notation.NotationFactory