Просмотр исходного кода

Documenting other graphical objects

Andrea Condoluci 8 лет назад
Родитель
Сommit
e6baa6beb8

+ 3 - 0
src/MusicalScore/Graphical/AccidentalCalculator.ts

@@ -6,6 +6,9 @@ import {Pitch} from "../../Common/DataObjects/Pitch";
 import {NoteEnum} from "../../Common/DataObjects/Pitch";
 import Dictionary from "typescript-collections/dist/lib/Dictionary";
 
+/**
+ * Compute the accidentals for notes according to the current key instruction
+ */
 export class AccidentalCalculator {
     private symbolFactory: IGraphicalSymbolFactory;
     private keySignatureNoteAlterationsDict: Dictionary<number, AccidentalEnum> = new Dictionary<number, AccidentalEnum>();

+ 3 - 0
src/MusicalScore/Graphical/BoundingBox.ts

@@ -3,6 +3,9 @@ import {PointF2D} from "../../Common/DataObjects/PointF2D";
 import {SizeF2D} from "../../Common/DataObjects/SizeF2D";
 import {RectangleF2D} from "../../Common/DataObjects/RectangleF2D";
 
+/**
+ * A bounding box delimits an area on the 2D plane.
+ */
 export class BoundingBox {
     protected isSymbol: boolean = false;
     protected relativePositionHasBeenSet: boolean = false;

+ 4 - 0
src/MusicalScore/Graphical/GraphicalLabel.ts

@@ -5,6 +5,10 @@ import {BoundingBox} from "./BoundingBox";
 import {EngravingRules} from "./EngravingRules";
 import {MusicSheetCalculator} from "./MusicSheetCalculator";
 
+/**
+ * A text label on the graphical music sheet.
+ * It is used e.g. for titles, composer names, instrument names and dynamic instructions.
+ */
 export class GraphicalLabel extends Clickable {
     private label: Label;
 

+ 3 - 0
src/MusicalScore/Graphical/GraphicalMusicSheet.ts

@@ -25,6 +25,9 @@ import {SelectionStartSymbol} from "./SelectionStartSymbol";
 import {SelectionEndSymbol} from "./SelectionEndSymbol";
 import {OutlineAndFillStyleEnum} from "./DrawingEnums";
 
+/**
+ * The graphical counterpart of a [[MusicSheet]]
+ */
 export class GraphicalMusicSheet {
     constructor(musicSheet: MusicSheet, calculator: MusicSheetCalculator) {
         this.musicSheet = musicSheet;

+ 3 - 0
src/MusicalScore/Graphical/GraphicalNote.ts

@@ -9,6 +9,9 @@ import {GraphicalObject} from "./GraphicalObject";
 import {MusicSheetCalculator} from "./MusicSheetCalculator";
 import {BoundingBox} from "./BoundingBox";
 
+/**
+ * The graphical counterpart of a Note
+ */
 export class GraphicalNote extends GraphicalObject {
     constructor(note: Note, parent: GraphicalStaffEntry) {
         super();

+ 1 - 0
src/MusicalScore/Graphical/GraphicalRectangle.ts

@@ -2,6 +2,7 @@ import {OutlineAndFillStyleEnum} from "./DrawingEnums";
 import {BoundingBox} from "./BoundingBox";
 import {PointF2D} from "../../Common/DataObjects/PointF2D";
 import {GraphicalObject} from "./GraphicalObject";
+
 export class GraphicalRectangle extends GraphicalObject {
     constructor(upperLeftPoint: PointF2D, lowerRightPoint: PointF2D, parent: BoundingBox, style: OutlineAndFillStyleEnum) {
         super();

+ 3 - 0
src/MusicalScore/Graphical/GraphicalStaffEntry.ts

@@ -17,6 +17,9 @@ import {AbstractGraphicalInstruction} from "./AbstractGraphicalInstruction";
 import {GraphicalStaffEntryLink} from "./GraphicalStaffEntryLink";
 import {CollectionUtil} from "../../Util/CollectionUtil";
 
+/**
+ * The graphical counterpart of a SourceStaffEntry
+ */
 export abstract class GraphicalStaffEntry extends GraphicalObject {
     constructor(parentMeasure: StaffMeasure, sourceStaffEntry: SourceStaffEntry = undefined, staffEntryParent: GraphicalStaffEntry = undefined) {
         super();

+ 3 - 0
src/MusicalScore/Graphical/GraphicalTie.ts

@@ -1,6 +1,9 @@
 import {Tie} from "../VoiceData/Tie";
 import {GraphicalNote} from "./GraphicalNote";
 
+/**
+ * The graphical counterpart of a Tie
+ */
 export class GraphicalTie {
     private tie: Tie;
     private startNote: GraphicalNote;

+ 3 - 0
src/MusicalScore/Graphical/MusicSheetCalculator.ts

@@ -53,6 +53,9 @@ import {Logging} from "../../Common/Logging";
 import Dictionary from "typescript-collections/dist/lib/Dictionary";
 import {CollectionUtil} from "../../Util/CollectionUtil";
 
+/**
+ * Class used to do all the calculations in a MusicSheet, which in the end populates a GraphicalMusicSheet.
+ */
 export abstract class MusicSheetCalculator {
     public static transposeCalculator: ITransposeCalculator;
     protected static textMeasurer: ITextMeasurer;

+ 3 - 0
src/MusicalScore/Graphical/MusicSheetDrawer.ts

@@ -25,6 +25,9 @@ import {MusicSymbolDrawingStyle, PhonicScoreModes} from "./DrawingMode";
 import {GraphicalOctaveShift} from "./GraphicalOctaveShift";
 import {GraphicalObject} from "./GraphicalObject";
 
+/**
+ * Class used to draw a GraphicalMusicSheet (with the .drawSheet method)
+ */
 export abstract class MusicSheetDrawer {
     public drawingParameters: DrawingParameters = new DrawingParameters();
     public splitScreenLineColor: number;

+ 3 - 0
src/MusicalScore/Graphical/MusicSystem.ts

@@ -21,6 +21,9 @@ import {SystemLine} from "./SystemLine";
 import {SystemLinePosition} from "./SystemLinePosition";
 import {Staff} from "../VoiceData/Staff";
 
+/**
+ * A MusicSystem contains the StaffLines for all instruments, until a line break
+ */
 export abstract class MusicSystem extends GraphicalObject {
     public needsToBeRedrawn: boolean = true;
     protected parent: GraphicalMusicPage;

+ 4 - 0
src/MusicalScore/Graphical/StaffLine.ts

@@ -9,6 +9,10 @@ import {MusicSystem} from "./MusicSystem";
 import {StaffLineActivitySymbol} from "./StaffLineActivitySymbol";
 import {PointF2D} from "../../Common/DataObjects/PointF2D";
 
+/**
+ * A StaffLine contains the measures in one line of the music sheet
+ * (one instrument, one line, until a line break)
+ */
 export abstract class StaffLine extends GraphicalObject {
     protected measures: StaffMeasure[] = [];
     protected staffLines: GraphicalLine[] = new Array(5);

+ 3 - 0
src/MusicalScore/Graphical/StaffMeasure.ts

@@ -15,6 +15,9 @@ import {SystemLinesEnum} from "./SystemLinesEnum";
 import {BoundingBox} from "./BoundingBox";
 import {PointF2D} from "../../Common/DataObjects/PointF2D";
 
+/**
+ * Represents a measure in the music sheet (one measure in one staff line)
+ */
 export abstract class StaffMeasure extends GraphicalObject {
     protected firstInstructionStaffEntry: GraphicalStaffEntry;
     protected lastInstructionStaffEntry: GraphicalStaffEntry;