Browse Source

Applying replacements (3)

Andrea Condoluci 9 years ago
parent
commit
c426821051

+ 5 - 2
extras/macrogen.py

@@ -7,7 +7,7 @@ replace = (
     ("Math\\.Sqrt\\(", "Math.sqrt("),
     ("Math\\.Sqrt\\(", "Math.sqrt("),
     ("Math\\.Abs\\(", "Math.abs("),
     ("Math\\.Abs\\(", "Math.abs("),
     ("Math\\.Pow\\(", "Math.pow("),
     ("Math\\.Pow\\(", "Math.pow("),
-    ("Math\\.Ceiling", "Math.ceiling"),
+    ("Math\\.Ceiling", "Math.ceil"),
     ("Math\\.Floor", "Math.floor"),
     ("Math\\.Floor", "Math.floor"),
 
 
     ("var ", "let "),
     ("var ", "let "),
@@ -41,7 +41,7 @@ replace = (
     ("\\.ToLower\(\)", ".toLowerCase()"),
     ("\\.ToLower\(\)", ".toLowerCase()"),
 
 
     ("Logger\\.DefaultLogger\\.LogError\(LogLevel\\.DEBUG,(?:[ ]*)", "Logging.debug("),
     ("Logger\\.DefaultLogger\\.LogError\(LogLevel\\.DEBUG,(?:[ ]*)", "Logging.debug("),
-    ("# Logger\\.DefaultLogger\\.LogError\(LogLevel\\.NORMAL,(?:[ ]*)", "Logging.log("),
+    ("Logger\\.DefaultLogger\\.LogError\(LogLevel\\.NORMAL,(?:[ ]*)", "Logging.log("),
     ("Logger\\.DefaultLogger\\.LogError\(PhonicScore\\.Common\\.Enums\\.LogLevel\\.NORMAL,(?:[ ]*)", "Logging.log("),
     ("Logger\\.DefaultLogger\\.LogError\(PhonicScore\\.Common\\.Enums\\.LogLevel\\.NORMAL,(?:[ ]*)", "Logging.log("),
 
 
     ("Fraction\\.CreateFractionFromFraction\(([a-z|0-9]+)\)", "$1.clone()"),
     ("Fraction\\.CreateFractionFromFraction\(([a-z|0-9]+)\)", "$1.clone()"),
@@ -60,6 +60,9 @@ replace = (
     ("return\\n", "return;\n"),
     ("return\\n", "return;\n"),
 
 
     ("}(\n[ ]*)else ", "} else "),
     ("}(\n[ ]*)else ", "} else "),
+
+    ("\\.IdInMusicSheet", ".idInMusicSheet"),
+    ("F_2D", "F2D"),
 )
 )
 
 
 def checkForIssues(filename, content):
 def checkForIssues(filename, content):

+ 8 - 6
src/MusicalScore/Graphical/BoundingBox.ts

@@ -475,11 +475,7 @@ export class BoundingBox {
         return undefined;
         return undefined;
     }
     }
 
 
-    public getObjectsInRegion<T>(region: BoundingBox): T[] {
-        return this.getObjectsInRegion<T>(region, true);
-    }
-
-    public getObjectsInRegion<T>(region: BoundingBox, liesInside: boolean): T[] {
+    public getObjectsInRegion<T>(region: BoundingBox, liesInside: boolean = true): T[] {
         if (this.dataObject instanceof T) {
         if (this.dataObject instanceof T) {
             if (liesInside) {
             if (liesInside) {
                 if (region.liesInsideBorders(this)) {
                 if (region.liesInsideBorders(this)) {
@@ -490,8 +486,14 @@ export class BoundingBox {
                     return [this.dataObject as T];
                     return [this.dataObject as T];
                 }
                 }
             }
             }
+            // FIXME Andrea: add here "return []"?
+        }
+        let result: T[] = [];
+        for (let child of this.childElements) {
+            result.concat(child.getObjectsInRegion<T>(region, liesInside));
         }
         }
-        return this.childElements.SelectMany(psi => psi.getObjectsInRegion<T>(region, liesInside));
+        return result;
+        //return this.childElements.SelectMany(psi => psi.getObjectsInRegion<T>(region, liesInside));
     }
     }
 
 
     protected calculateRectangle(): void {
     protected calculateRectangle(): void {

+ 104 - 104
src/MusicalScore/Graphical/FontInfo.ts

@@ -1,6 +1,6 @@
 import {MusicSymbol} from "./MusicSymbol";
 import {MusicSymbol} from "./MusicSymbol";
-import {SizeF_2D} from "../../Common/DataObjects/SizeF_2D";
-import {PointF_2D} from "../../Common/DataObjects/PointF_2D";
+import {SizeF2D} from "../../Common/DataObjects/SizeF2D";
+import {PointF2D} from "../../Common/DataObjects/PointF2D";
 import {BoundingBox} from "./BoundingBox";
 import {BoundingBox} from "./BoundingBox";
 export class FontInfo {
 export class FontInfo {
     protected static info: FontInfo = new FontInfo();
     protected static info: FontInfo = new FontInfo();
@@ -24,26 +24,26 @@ export class FontInfo {
         }
         }
 
 
     }
     }
-    public getBoundingBox(symbol: MusicSymbol): SizeF_2D {
+    public getBoundingBox(symbol: MusicSymbol): SizeF2D {
         try {
         try {
             return this.symbolMapping[symbol].boundingBox;
             return this.symbolMapping[symbol].boundingBox;
         }
         }
         catch (ex) {
         catch (ex) {
             Logging.debug("FontInfo.getBoundingBox", ex);
             Logging.debug("FontInfo.getBoundingBox", ex);
-            return new SizeF_2D();
+            return new SizeF2D();
         }
         }
 
 
     }
     }
-    public addBoundingBox(symbol: MusicSymbol, boundingBox: SizeF_2D): void {
+    public addBoundingBox(symbol: MusicSymbol, boundingBox: SizeF2D): void {
         let si: SymbolInfo = this.symbolMapping[symbol];
         let si: SymbolInfo = this.symbolMapping[symbol];
         si.boundingBox = boundingBox;
         si.boundingBox = boundingBox;
         this.symbolMapping.Remove(symbol);
         this.symbolMapping.Remove(symbol);
         this.symbolMapping.push(symbol, si);
         this.symbolMapping.push(symbol, si);
     }
     }
-    public getCenterDistance(symbol: SymbolInfo): SizeF_2D {
-        let symbolBox: SizeF_2D = symbol.boundingBox;
-        let symbolCenter: PointF_2D = symbol.center;
-        let centerDistance: SizeF_2D = new SizeF_2D(symbolBox.Width * symbolCenter.X, symbolBox.Height * symbolCenter.Y);
+    public getCenterDistance(symbol: SymbolInfo): SizeF2D {
+        let symbolBox: SizeF2D = symbol.boundingBox;
+        let symbolCenter: PointF2D = symbol.center;
+        let centerDistance: SizeF2D = new SizeF2D(symbolBox.Width * symbolCenter.X, symbolBox.Height * symbolCenter.Y);
         return centerDistance;
         return centerDistance;
     }
     }
     public fillPSI(psi: BoundingBox, symbol: MusicSymbol): void {
     public fillPSI(psi: BoundingBox, symbol: MusicSymbol): void {
@@ -51,9 +51,9 @@ export class FontInfo {
     }
     }
     public fillPSI(psi: BoundingBox, symbol: MusicSymbol, scaleFactor: number): void {
     public fillPSI(psi: BoundingBox, symbol: MusicSymbol, scaleFactor: number): void {
         let symbolInfo: SymbolInfo = this.symbolMapping[symbol];
         let symbolInfo: SymbolInfo = this.symbolMapping[symbol];
-        let symbolBox: SizeF_2D = symbolInfo.boundingBox;
-        let symbolCenter: PointF_2D = symbolInfo.center;
-        let centerDistance: SizeF_2D = new SizeF_2D(symbolBox.Width * symbolCenter.X, symbolBox.Height * symbolCenter.Y);
+        let symbolBox: SizeF2D = symbolInfo.boundingBox;
+        let symbolCenter: PointF2D = symbolInfo.center;
+        let centerDistance: SizeF2D = new SizeF2D(symbolBox.Width * symbolCenter.X, symbolBox.Height * symbolCenter.Y);
         let symbolMargins: SymbolMargins = symbolInfo.margins;
         let symbolMargins: SymbolMargins = symbolInfo.margins;
         psi.BorderLeft = -centerDistance.Width * scaleFactor;
         psi.BorderLeft = -centerDistance.Width * scaleFactor;
         psi.BorderRight = (symbolBox.Width - centerDistance.Width) * scaleFactor;
         psi.BorderRight = (symbolBox.Width - centerDistance.Width) * scaleFactor;
@@ -113,91 +113,91 @@ export class FontInfo {
                                 1, 1.7, 1.8,
                                 1, 1.7, 1.8,
                                     1.09, 0.77,
                                     1.09, 0.77,
                                         3.0;
                                         3.0;
-        let centerVector: PointF_2D[] = new PointF_2D(0.5, 0.5),
-        new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.0, 1.0),
-            new PointF_2D(0.0, 0.0),
-            new PointF_2D(0.0, 1.0),
-            new PointF_2D(0.0, 0.0),
-            new PointF_2D(0.0, 1.0),
-            new PointF_2D(0.0, 0.0),
-            new PointF_2D(0.0, 1.0),
-            new PointF_2D(0.0, 0.0),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(500.0 / 940.0, 1660.0 / 2675.0),
-            new PointF_2D(500.0 / 1830.0, 760.0 / 2680.0),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(400.0 / 925.0, 1210.0 / 2680.0),
-            new PointF_2D(400.0 / 1500.0, 360.0 / 2680.0),
-            new PointF_2D(480.0 / 1190.0, 260.0 / 2680.0),
-            new PointF_2D(510.0 / 1040.0, 190.0 / 2680.0),
-            new PointF_2D(535.0 / 960.0, 160.0 / 2680.0),
-            new PointF_2D(400.0 / 990.0, 1960.0 / 2680.0),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(785.0 / 1570.0, 1960.0 / 2680.0),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.0, 0.0),
-            new PointF_2D(0.0, 0.0),
-            new PointF_2D(0.0, 0.0),
-            new PointF_2D(0.0, 0.0),
-            new PointF_2D(0.0, 0.0),
-            new PointF_2D(0.0, 0.0),
-            new PointF_2D(0.0, 0.0),
-            new PointF_2D(0.0, 0.0),
-            new PointF_2D(0.0, 0.0),
-            new PointF_2D(0.0, 0.0),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(2880.0 / 5760.0, 2250.0 / 2680.0),
-            new PointF_2D(2850.0 / 5700.0, 1810.0 / 2680.0),
-            new PointF_2D(450.0 / 900.0, 1560.0 / 2680.0),
-            new PointF_2D(5250.0 / 10500.0, 1340.0 / 2680.0),
-            new PointF_2D(1787.0 / 3574.0, 1340.0 / 2680.0),
-            new PointF_2D(872.0 / 1744.0, 1340.0 / 2680.0),
-            new PointF_2D(872.0 / 1744.0, 1340.0 / 2680.0),
-            new PointF_2D(1500.0 / 3000.0, 1865.0 / 2680.0),
-            new PointF_2D(1100.0 / 2200.0, 1865.0 / 2680.0),
-            new PointF_2D(1000.0 / 2000.0, 2680.0 / 2680.0),
-            new PointF_2D(1250.0 / 2500.0, 2680.0 / 2680.0),
-            new PointF_2D(2330.0 / 4660.0, 2680.0 / 2680.0),
-            new PointF_2D(1430.0 / 2860.0, 2680.0 / 2680.0),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.63, 0.5448),
-            new PointF_2D(0.63, 0.667),
-            new PointF_2D(0.63, 0.5448),
-            new PointF_2D(0.63, 0.667),
-            new PointF_2D(0.2, 0.224),
-            new PointF_2D(0.2, 0.4067),
-            new PointF_2D(0.2, 0.224),
-            new PointF_2D(0.2, 0.4067),
-            new PointF_2D(0.5, 0.653),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.52, 0.925),
-            new PointF_2D(0.5, 1),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.634),
-            new PointF_2D(0.5, 0.5),
-            new PointF_2D(0.5, 0.5);
+        let centerVector: PointF2D[] = new PointF2D(0.5, 0.5),
+        new PointF2D(0.5, 0.5),
+            new PointF2D(0.0, 1.0),
+            new PointF2D(0.0, 0.0),
+            new PointF2D(0.0, 1.0),
+            new PointF2D(0.0, 0.0),
+            new PointF2D(0.0, 1.0),
+            new PointF2D(0.0, 0.0),
+            new PointF2D(0.0, 1.0),
+            new PointF2D(0.0, 0.0),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(500.0 / 940.0, 1660.0 / 2675.0),
+            new PointF2D(500.0 / 1830.0, 760.0 / 2680.0),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(400.0 / 925.0, 1210.0 / 2680.0),
+            new PointF2D(400.0 / 1500.0, 360.0 / 2680.0),
+            new PointF2D(480.0 / 1190.0, 260.0 / 2680.0),
+            new PointF2D(510.0 / 1040.0, 190.0 / 2680.0),
+            new PointF2D(535.0 / 960.0, 160.0 / 2680.0),
+            new PointF2D(400.0 / 990.0, 1960.0 / 2680.0),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(785.0 / 1570.0, 1960.0 / 2680.0),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.0, 0.0),
+            new PointF2D(0.0, 0.0),
+            new PointF2D(0.0, 0.0),
+            new PointF2D(0.0, 0.0),
+            new PointF2D(0.0, 0.0),
+            new PointF2D(0.0, 0.0),
+            new PointF2D(0.0, 0.0),
+            new PointF2D(0.0, 0.0),
+            new PointF2D(0.0, 0.0),
+            new PointF2D(0.0, 0.0),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(2880.0 / 5760.0, 2250.0 / 2680.0),
+            new PointF2D(2850.0 / 5700.0, 1810.0 / 2680.0),
+            new PointF2D(450.0 / 900.0, 1560.0 / 2680.0),
+            new PointF2D(5250.0 / 10500.0, 1340.0 / 2680.0),
+            new PointF2D(1787.0 / 3574.0, 1340.0 / 2680.0),
+            new PointF2D(872.0 / 1744.0, 1340.0 / 2680.0),
+            new PointF2D(872.0 / 1744.0, 1340.0 / 2680.0),
+            new PointF2D(1500.0 / 3000.0, 1865.0 / 2680.0),
+            new PointF2D(1100.0 / 2200.0, 1865.0 / 2680.0),
+            new PointF2D(1000.0 / 2000.0, 2680.0 / 2680.0),
+            new PointF2D(1250.0 / 2500.0, 2680.0 / 2680.0),
+            new PointF2D(2330.0 / 4660.0, 2680.0 / 2680.0),
+            new PointF2D(1430.0 / 2860.0, 2680.0 / 2680.0),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.63, 0.5448),
+            new PointF2D(0.63, 0.667),
+            new PointF2D(0.63, 0.5448),
+            new PointF2D(0.63, 0.667),
+            new PointF2D(0.2, 0.224),
+            new PointF2D(0.2, 0.4067),
+            new PointF2D(0.2, 0.224),
+            new PointF2D(0.2, 0.4067),
+            new PointF2D(0.5, 0.653),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.52, 0.925),
+            new PointF2D(0.5, 1),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.634),
+            new PointF2D(0.5, 0.5),
+            new PointF2D(0.5, 0.5);
         let marginVector: SymbolMargins[] = new SymbolMargins(0.1, 0.1, 0.1, 0.1),
         let marginVector: SymbolMargins[] = new SymbolMargins(0.1, 0.1, 0.1, 0.1),
         new SymbolMargins(0.1, 0.1),
         new SymbolMargins(0.1, 0.1),
             new SymbolMargins(0.1, 0.1),
             new SymbolMargins(0.1, 0.1),
@@ -296,10 +296,10 @@ export class SymbolInfo {
     public symbol: string;
     public symbol: string;
     public id: number;
     public id: number;
     public scaleFactor: number;
     public scaleFactor: number;
-    public boundingBox: SizeF_2D;
-    public center: PointF_2D;
+    public boundingBox: SizeF2D;
+    public center: PointF2D;
     public margins: SymbolMargins;
     public margins: SymbolMargins;
-    constructor(symbol: string, id: number, scaleFactor: number, center: PointF_2D, margins: SymbolMargins) {
+    constructor(symbol: string, id: number, scaleFactor: number, center: PointF2D, margins: SymbolMargins) {
         this();
         this();
         this.symbol = symbol;
         this.symbol = symbol;
         this.id = id;
         this.id = id;
@@ -313,16 +313,16 @@ export class SymbolInfo {
     public set ScaleFactor(value: number) {
     public set ScaleFactor(value: number) {
         this.scaleFactor = value;
         this.scaleFactor = value;
     }
     }
-    public get BoundingBox(): SizeF_2D {
+    public get BoundingBox(): SizeF2D {
         return this.boundingBox;
         return this.boundingBox;
     }
     }
-    public set BoundingBox(value: SizeF_2D) {
+    public set BoundingBox(value: SizeF2D) {
         this.boundingBox = value;
         this.boundingBox = value;
     }
     }
-    public get Center(): PointF_2D {
+    public get Center(): PointF2D {
         return this.center;
         return this.center;
     }
     }
-    public set Center(value: PointF_2D) {
+    public set Center(value: PointF2D) {
         this.center = value;
         this.center = value;
     }
     }
     public get Margins(): SymbolMargins {
     public get Margins(): SymbolMargins {

+ 2 - 2
src/MusicalScore/Graphical/GraphicalChordSymbolContainer.ts

@@ -4,7 +4,7 @@ import {GraphicalLabel} from "./GraphicalLabel";
 import {ChordSymbolContainer} from "../VoiceData/ChordSymbolContainer";
 import {ChordSymbolContainer} from "../VoiceData/ChordSymbolContainer";
 import {BoundingBox} from "./BoundingBox";
 import {BoundingBox} from "./BoundingBox";
 import {GraphicalObject} from "./GraphicalObject";
 import {GraphicalObject} from "./GraphicalObject";
-import {PointF_2D} from "../../Common/DataObjects/PointF_2D";
+import {PointF2D} from "../../Common/DataObjects/PointF2D";
 export class GraphicalChordSymbolContainer extends GraphicalObject {
 export class GraphicalChordSymbolContainer extends GraphicalObject {
     private chordSymbolContainer: ChordSymbolContainer;
     private chordSymbolContainer: ChordSymbolContainer;
     private graphicalLabel: GraphicalLabel;
     private graphicalLabel: GraphicalLabel;
@@ -22,7 +22,7 @@ export class GraphicalChordSymbolContainer extends GraphicalObject {
     private calculateLabel(textHeight: number, transposeHalftones: number): void {
     private calculateLabel(textHeight: number, transposeHalftones: number): void {
         let text: string = ChordSymbolContainer.calculateChordText(this.chordSymbolContainer, transposeHalftones);
         let text: string = ChordSymbolContainer.calculateChordText(this.chordSymbolContainer, transposeHalftones);
         this.graphicalLabel = new GraphicalLabel(new Label(text), textHeight, TextAlignment.CenterBottom, this.boundingBox);
         this.graphicalLabel = new GraphicalLabel(new Label(text), textHeight, TextAlignment.CenterBottom, this.boundingBox);
-        this.graphicalLabel.PositionAndShape.RelativePosition = new PointF_2D(0.0, 0.0);
+        this.graphicalLabel.PositionAndShape.RelativePosition = new PointF2D(0.0, 0.0);
         this.boundingBox.ChildElements.push(this.graphicalLabel.PositionAndShape);
         this.boundingBox.ChildElements.push(this.graphicalLabel.PositionAndShape);
     }
     }
 }
 }

+ 8 - 8
src/MusicalScore/Graphical/GraphicalLine.ts

@@ -1,26 +1,26 @@
 import {OutlineAndFillStyleEnum} from "./DrawingEnums";
 import {OutlineAndFillStyleEnum} from "./DrawingEnums";
-import {PointF_2D} from "../../Common/DataObjects/PointF_2D";
+import {PointF2D} from "../../Common/DataObjects/PointF2D";
 export class GraphicalLine {
 export class GraphicalLine {
-    private start: PointF_2D;
-    private end: PointF_2D;
+    private start: PointF2D;
+    private end: PointF2D;
     private width: number;
     private width: number;
-    constructor(start: PointF_2D, end: PointF_2D, width: number = 0, styleEnum: OutlineAndFillStyleEnum = OutlineAndFillStyleEnum.BaseWritingColor) {
+    constructor(start: PointF2D, end: PointF2D, width: number = 0, styleEnum: OutlineAndFillStyleEnum = OutlineAndFillStyleEnum.BaseWritingColor) {
         this.start = start;
         this.start = start;
         this.end = end;
         this.end = end;
         this.width = width;
         this.width = width;
         this.StyleId = <number>styleEnum;
         this.StyleId = <number>styleEnum;
     }
     }
     public StyleId: number;
     public StyleId: number;
-    public get Start(): PointF_2D {
+    public get Start(): PointF2D {
         return this.start;
         return this.start;
     }
     }
-    public set Start(value: PointF_2D) {
+    public set Start(value: PointF2D) {
         this.start = value;
         this.start = value;
     }
     }
-    public get End(): PointF_2D {
+    public get End(): PointF2D {
         return this.end;
         return this.end;
     }
     }
-    public set End(value: PointF_2D) {
+    public set End(value: PointF2D) {
         this.end = value;
         this.end = value;
     }
     }
     public get Width(): number {
     public get Width(): number {

+ 2 - 2
src/MusicalScore/Graphical/GraphicalLyricEntry.ts

@@ -4,7 +4,7 @@ import {GraphicalLabel} from "./GraphicalLabel";
 import {GraphicalStaffEntry} from "./GraphicalStaffEntry";
 import {GraphicalStaffEntry} from "./GraphicalStaffEntry";
 import {Label} from "../Label";
 import {Label} from "../Label";
 import {TextAlignment} from "../../Common/Enums/TextAlignment";
 import {TextAlignment} from "../../Common/Enums/TextAlignment";
-import {PointF_2D} from "../../Common/DataObjects/PointF_2D";
+import {PointF2D} from "../../Common/DataObjects/PointF2D";
 export class GraphicalLyricEntry {
 export class GraphicalLyricEntry {
     private lyricsEntry: LyricsEntry;
     private lyricsEntry: LyricsEntry;
     private graphicalLyricWord: GraphicalLyricWord;
     private graphicalLyricWord: GraphicalLyricWord;
@@ -16,7 +16,7 @@ export class GraphicalLyricEntry {
         this.graphicalLabel = new GraphicalLabel(new Label(lyricsEntry.Text), lyricsHeight,
         this.graphicalLabel = new GraphicalLabel(new Label(lyricsEntry.Text), lyricsHeight,
             TextAlignment.CenterBottom,
             TextAlignment.CenterBottom,
             graphicalStaffEntry.PositionAndShape);
             graphicalStaffEntry.PositionAndShape);
-        this.graphicalLabel.PositionAndShape.RelativePosition = new PointF_2D(0.0, staffHeight);
+        this.graphicalLabel.PositionAndShape.RelativePosition = new PointF2D(0.0, staffHeight);
     }
     }
     public get GetLyricsEntry(): LyricsEntry {
     public get GetLyricsEntry(): LyricsEntry {
         return this.lyricsEntry;
         return this.lyricsEntry;

+ 8 - 8
src/MusicalScore/Graphical/GraphicalMusicPage.ts

@@ -3,7 +3,7 @@ import {GraphicalObject} from "./GraphicalObject";
 import {GraphicalLabel} from "./GraphicalLabel";
 import {GraphicalLabel} from "./GraphicalLabel";
 import {MusicSystem} from "./MusicSystem";
 import {MusicSystem} from "./MusicSystem";
 import {EngravingRules} from "./EngravingRules";
 import {EngravingRules} from "./EngravingRules";
-import {PointF_2D} from "../../Common/DataObjects/PointF_2D";
+import {PointF2D} from "../../Common/DataObjects/PointF2D";
 import {GraphicalMusicSheet} from "./GraphicalMusicSheet";
 import {GraphicalMusicSheet} from "./GraphicalMusicSheet";
 export class GraphicalMusicPage extends GraphicalObject {
 export class GraphicalMusicPage extends GraphicalObject {
     private musicSystems: MusicSystem[] = [];
     private musicSystems: MusicSystem[] = [];
@@ -31,20 +31,20 @@ export class GraphicalMusicPage extends GraphicalObject {
     public set Parent(value: GraphicalMusicSheet) {
     public set Parent(value: GraphicalMusicSheet) {
         this.parent = value;
         this.parent = value;
     }
     }
-    public setMusicPageAbsolutePosition(pageIndex: number, rules: EngravingRules): PointF_2D {
+    public setMusicPageAbsolutePosition(pageIndex: number, rules: EngravingRules): PointF2D {
         if (rules.PagePlacement === PagePlacementEnum.Down)
         if (rules.PagePlacement === PagePlacementEnum.Down)
-            return new PointF_2D(0.0, pageIndex * rules.PageHeight);
+            return new PointF2D(0.0, pageIndex * rules.PageHeight);
         else if (rules.PagePlacement === PagePlacementEnum.Right)
         else if (rules.PagePlacement === PagePlacementEnum.Right)
-            return new PointF_2D(pageIndex * this.parent.ParentMusicSheet.PageWidth, 0.0);
+            return new PointF2D(pageIndex * this.parent.ParentMusicSheet.PageWidth, 0.0);
         else {
         else {
             if (pageIndex % 2 === 0) {
             if (pageIndex % 2 === 0) {
                 if (pageIndex === 0)
                 if (pageIndex === 0)
-                    return new PointF_2D(0.0, pageIndex * rules.PageHeight);
-                else return new PointF_2D(0.0, (pageIndex - 1) * rules.PageHeight);
+                    return new PointF2D(0.0, pageIndex * rules.PageHeight);
+                else return new PointF2D(0.0, (pageIndex - 1) * rules.PageHeight);
             } else {
             } else {
                 if (pageIndex === 1)
                 if (pageIndex === 1)
-                    return new PointF_2D(this.parent.ParentMusicSheet.PageWidth, (pageIndex - 1) * rules.PageHeight);
-                else return new PointF_2D(this.parent.ParentMusicSheet.PageWidth, (pageIndex - 2) * rules.PageHeight);
+                    return new PointF2D(this.parent.ParentMusicSheet.PageWidth, (pageIndex - 1) * rules.PageHeight);
+                else return new PointF2D(this.parent.ParentMusicSheet.PageWidth, (pageIndex - 2) * rules.PageHeight);
             }
             }
         }
         }
     }
     }

+ 218 - 109
src/MusicalScore/Graphical/GraphicalMusicSheet.ts

@@ -9,7 +9,7 @@ import {GraphicalLine} from "./GraphicalLine";
 import {MusicSystem} from "./MusicSystem";
 import {MusicSystem} from "./MusicSystem";
 import {GraphicalStaffEntry} from "./GraphicalStaffEntry";
 import {GraphicalStaffEntry} from "./GraphicalStaffEntry";
 import {SourceStaffEntry} from "../VoiceData/SourceStaffEntry";
 import {SourceStaffEntry} from "../VoiceData/SourceStaffEntry";
-import {PointF_2D} from "../../Common/DataObjects/PointF_2D";
+import {PointF2D} from "../../Common/DataObjects/PointF2D";
 import {ClefInstruction} from "../VoiceData/Instructions/ClefInstruction";
 import {ClefInstruction} from "../VoiceData/Instructions/ClefInstruction";
 import {AbstractNotationInstruction} from "../VoiceData/Instructions/AbstractNotationInstruction";
 import {AbstractNotationInstruction} from "../VoiceData/Instructions/AbstractNotationInstruction";
 import {KeyInstruction} from "../VoiceData/Instructions/KeyInstruction";
 import {KeyInstruction} from "../VoiceData/Instructions/KeyInstruction";
@@ -20,6 +20,8 @@ import {BoundingBox} from "./BoundingBox";
 import {VoiceEntry} from "../VoiceData/VoiceEntry";
 import {VoiceEntry} from "../VoiceData/VoiceEntry";
 import {Note} from "../VoiceData/Note";
 import {Note} from "../VoiceData/Note";
 import {MusicSheetCalculator} from "./MusicSheetCalculator";
 import {MusicSheetCalculator} from "./MusicSheetCalculator";
+import {Logging} from "../../Common/logging";
+
 export class GraphicalMusicSheet {
 export class GraphicalMusicSheet {
     constructor(musicSheet: MusicSheet, calculator: MusicSheetCalculator) {
     constructor(musicSheet: MusicSheet, calculator: MusicSheetCalculator) {
         this.musicSheet = musicSheet;
         this.musicSheet = musicSheet;
@@ -28,8 +30,9 @@ export class GraphicalMusicSheet {
         this.SourceToGraphicalMeasureLinks = new Dictionary<SourceMeasure, StaffMeasure[]>();
         this.SourceToGraphicalMeasureLinks = new Dictionary<SourceMeasure, StaffMeasure[]>();
         this.calculator.initialize(this);
         this.calculator.initialize(this);
     }
     }
+
     private musicSheet: MusicSheet;
     private musicSheet: MusicSheet;
-    private fontInfo: FontInfo = this.FontInfo.Info;
+    private fontInfo: FontInfo = FontInfo.Info;
     private calculator: MusicSheetCalculator;
     private calculator: MusicSheetCalculator;
     private musicPages: GraphicalMusicPage[] = [];
     private musicPages: GraphicalMusicPage[] = [];
     private measureList: StaffMeasure[][] = [];
     private measureList: StaffMeasure[][] = [];
@@ -43,97 +46,127 @@ export class GraphicalMusicSheet {
     private systemImages: Dictionary<MusicSystem, SystemImageProperties> = new Dictionary<MusicSystem, SystemImageProperties>();
     private systemImages: Dictionary<MusicSystem, SystemImageProperties> = new Dictionary<MusicSystem, SystemImageProperties>();
     private numberOfStaves: number;
     private numberOfStaves: number;
     private leadSheet: boolean = false;
     private leadSheet: boolean = false;
+
     public get ParentMusicSheet(): MusicSheet {
     public get ParentMusicSheet(): MusicSheet {
         return this.musicSheet;
         return this.musicSheet;
     }
     }
+
     public get GetCalculator(): MusicSheetCalculator {
     public get GetCalculator(): MusicSheetCalculator {
         return this.calculator;
         return this.calculator;
     }
     }
+
     public get MusicPages(): GraphicalMusicPage[] {
     public get MusicPages(): GraphicalMusicPage[] {
         return this.musicPages;
         return this.musicPages;
     }
     }
+
     public set MusicPages(value: GraphicalMusicPage[]) {
     public set MusicPages(value: GraphicalMusicPage[]) {
         this.musicPages = value;
         this.musicPages = value;
     }
     }
+
     public get FontInfo(): FontInfo {
     public get FontInfo(): FontInfo {
         return this.fontInfo;
         return this.fontInfo;
     }
     }
+
     public get MeasureList(): StaffMeasure[][] {
     public get MeasureList(): StaffMeasure[][] {
         return this.measureList;
         return this.measureList;
     }
     }
+
     public set MeasureList(value: StaffMeasure[][]) {
     public set MeasureList(value: StaffMeasure[][]) {
         this.measureList = value;
         this.measureList = value;
     }
     }
+
     public get VerticalGraphicalStaffEntryContainers(): VerticalGraphicalStaffEntryContainer[] {
     public get VerticalGraphicalStaffEntryContainers(): VerticalGraphicalStaffEntryContainer[] {
         return this.verticalGraphicalStaffEntryContainers;
         return this.verticalGraphicalStaffEntryContainers;
     }
     }
+
     public set VerticalGraphicalStaffEntryContainers(value: VerticalGraphicalStaffEntryContainer[]) {
     public set VerticalGraphicalStaffEntryContainers(value: VerticalGraphicalStaffEntryContainer[]) {
         this.verticalGraphicalStaffEntryContainers = value;
         this.verticalGraphicalStaffEntryContainers = value;
     }
     }
+
     public get Title(): GraphicalLabel {
     public get Title(): GraphicalLabel {
         return this.title;
         return this.title;
     }
     }
+
     public set Title(value: GraphicalLabel) {
     public set Title(value: GraphicalLabel) {
         this.title = value;
         this.title = value;
     }
     }
+
     public get Subtitle(): GraphicalLabel {
     public get Subtitle(): GraphicalLabel {
         return this.subtitle;
         return this.subtitle;
     }
     }
+
     public set Subtitle(value: GraphicalLabel) {
     public set Subtitle(value: GraphicalLabel) {
         this.subtitle = value;
         this.subtitle = value;
     }
     }
+
     public get Composer(): GraphicalLabel {
     public get Composer(): GraphicalLabel {
         return this.composer;
         return this.composer;
     }
     }
+
     public set Composer(value: GraphicalLabel) {
     public set Composer(value: GraphicalLabel) {
         this.composer = value;
         this.composer = value;
     }
     }
+
     public get Lyricist(): GraphicalLabel {
     public get Lyricist(): GraphicalLabel {
         return this.lyricist;
         return this.lyricist;
     }
     }
+
     public set Lyricist(value: GraphicalLabel) {
     public set Lyricist(value: GraphicalLabel) {
         this.lyricist = value;
         this.lyricist = value;
     }
     }
+
     public get ScoreFollowingLines(): GraphicalLine[] {
     public get ScoreFollowingLines(): GraphicalLine[] {
         return this.scoreFollowingLines;
         return this.scoreFollowingLines;
     }
     }
+
     public get MaxAllowedSystemWidth(): number {
     public get MaxAllowedSystemWidth(): number {
         return this.maxAllowedSystemWidth;
         return this.maxAllowedSystemWidth;
     }
     }
+
     public set MaxAllowedSystemWidth(value: number) {
     public set MaxAllowedSystemWidth(value: number) {
         this.maxAllowedSystemWidth = value;
         this.maxAllowedSystemWidth = value;
     }
     }
+
     public get SystemImages(): Dictionary<MusicSystem, SystemImageProperties> {
     public get SystemImages(): Dictionary<MusicSystem, SystemImageProperties> {
         return this.systemImages;
         return this.systemImages;
     }
     }
-    public SourceToGraphicalMeasureLinks: Dictionary<SourceMeasure, StaffMeasure[]>;
+
+    //public SourceToGraphicalMeasureLinks: Dictionary<SourceMeasure, StaffMeasure[]>;
+
     public get NumberOfStaves(): number {
     public get NumberOfStaves(): number {
         return this.numberOfStaves;
         return this.numberOfStaves;
     }
     }
+
     public get LeadSheet(): boolean {
     public get LeadSheet(): boolean {
         return this.leadSheet;
         return this.leadSheet;
     }
     }
+
     public set LeadSheet(value: boolean) {
     public set LeadSheet(value: boolean) {
         this.leadSheet = value;
         this.leadSheet = value;
     }
     }
+
     public static transformRelativeToAbsolutePosition(graphicalMusicSheet: GraphicalMusicSheet): void {
     public static transformRelativeToAbsolutePosition(graphicalMusicSheet: GraphicalMusicSheet): void {
         for (let i: number = 0; i < graphicalMusicSheet.MusicPages.length; i++) {
         for (let i: number = 0; i < graphicalMusicSheet.MusicPages.length; i++) {
-            let pageAbsolute: PointF_2D = graphicalMusicSheet.MusicPages[i].setMusicPageAbsolutePosition(i, graphicalMusicSheet.ParentMusicSheet.Rules);
+            let pageAbsolute: PointF2D = graphicalMusicSheet.MusicPages[i].setMusicPageAbsolutePosition(i, graphicalMusicSheet.ParentMusicSheet.rules);
             let page: GraphicalMusicPage = graphicalMusicSheet.MusicPages[i];
             let page: GraphicalMusicPage = graphicalMusicSheet.MusicPages[i];
-            page.PositionAndShape.calculateAbsolutePositionsRecursive(pageAbsolute.X, pageAbsolute.Y);
+            page.PositionAndShape.calculateAbsolutePositionsRecursive(pageAbsolute.x, pageAbsolute.y);
         }
         }
     }
     }
+
     public Initialize(): void {
     public Initialize(): void {
         this.verticalGraphicalStaffEntryContainers = [];
         this.verticalGraphicalStaffEntryContainers = [];
         this.musicPages = [];
         this.musicPages = [];
         this.measureList = [];
         this.measureList = [];
     }
     }
+
     public reCalculate(): void {
     public reCalculate(): void {
         this.calculator.calculate();
         this.calculator.calculate();
     }
     }
+
     public prepare(): void {
     public prepare(): void {
         this.calculator.prepareGraphicalMusicSheet();
         this.calculator.prepareGraphicalMusicSheet();
     }
     }
+
     public EnforceRedrawOfMusicSystems(): void {
     public EnforceRedrawOfMusicSystems(): void {
         for (let idx: number = 0, len: number = this.musicPages.length; idx < len; ++idx) {
         for (let idx: number = 0, len: number = this.musicPages.length; idx < len; ++idx) {
             let graphicalMusicPage: GraphicalMusicPage = this.musicPages[idx];
             let graphicalMusicPage: GraphicalMusicPage = this.musicPages[idx];
@@ -143,62 +176,70 @@ export class GraphicalMusicSheet {
             }
             }
         }
         }
     }
     }
-    public getClickedObject<T>(positionOnMusicSheet: PointF_2D): T {
+
+    public getClickedObject<T>(positionOnMusicSheet: PointF2D): T {
         for (let idx: number = 0, len: number = this.MusicPages.length; idx < len; ++idx) {
         for (let idx: number = 0, len: number = this.MusicPages.length; idx < len; ++idx) {
             let graphicalMusicPage: GraphicalMusicPage = this.MusicPages[idx];
             let graphicalMusicPage: GraphicalMusicPage = this.MusicPages[idx];
             return graphicalMusicPage.PositionAndShape.getClickedObjectOfType<T>(positionOnMusicSheet);
             return graphicalMusicPage.PositionAndShape.getClickedObjectOfType<T>(positionOnMusicSheet);
         }
         }
         return undefined;
         return undefined;
     }
     }
-    public findGraphicalStaffEntryFromMeasureList(staffIndex: number, measureIndex: number,
-        sourceStaffEntry: SourceStaffEntry): GraphicalStaffEntry {
+
+    public findGraphicalStaffEntryFromMeasureList(staffIndex: number, measureIndex: number, sourceStaffEntry: SourceStaffEntry): GraphicalStaffEntry {
         for (let i: number = measureIndex; i < this.measureList.length; i++) {
         for (let i: number = measureIndex; i < this.measureList.length; i++) {
             let graphicalMeasure: StaffMeasure = this.measureList[i][staffIndex];
             let graphicalMeasure: StaffMeasure = this.measureList[i][staffIndex];
             for (let idx: number = 0, len: number = graphicalMeasure.StaffEntries.length; idx < len; ++idx) {
             for (let idx: number = 0, len: number = graphicalMeasure.StaffEntries.length; idx < len; ++idx) {
                 let graphicalStaffEntry: GraphicalStaffEntry = graphicalMeasure.StaffEntries[idx];
                 let graphicalStaffEntry: GraphicalStaffEntry = graphicalMeasure.StaffEntries[idx];
-                if (graphicalStaffEntry.SourceStaffEntry === sourceStaffEntry)
+                if (graphicalStaffEntry.SourceStaffEntry === sourceStaffEntry) {
                     return graphicalStaffEntry;
                     return graphicalStaffEntry;
+                }
             }
             }
         }
         }
         return undefined;
         return undefined;
     }
     }
-    public findNextGraphicalStaffEntry(staffIndex: number, measureIndex: number,
-        graphicalStaffEntry: GraphicalStaffEntry): GraphicalStaffEntry {
+
+    public findNextGraphicalStaffEntry(staffIndex: number, measureIndex: number, graphicalStaffEntry: GraphicalStaffEntry): GraphicalStaffEntry {
         let graphicalMeasure: StaffMeasure = graphicalStaffEntry.ParentMeasure;
         let graphicalMeasure: StaffMeasure = graphicalStaffEntry.ParentMeasure;
         let graphicalStaffEntryIndex: number = graphicalMeasure.StaffEntries.indexOf(graphicalStaffEntry);
         let graphicalStaffEntryIndex: number = graphicalMeasure.StaffEntries.indexOf(graphicalStaffEntry);
         if (graphicalStaffEntryIndex < graphicalMeasure.StaffEntries.length - 1) {
         if (graphicalStaffEntryIndex < graphicalMeasure.StaffEntries.length - 1) {
             return graphicalMeasure.StaffEntries[graphicalStaffEntryIndex + 1];
             return graphicalMeasure.StaffEntries[graphicalStaffEntryIndex + 1];
         } else if (measureIndex < this.measureList.length - 1) {
         } else if (measureIndex < this.measureList.length - 1) {
             let nextMeasure: StaffMeasure = this.measureList[measureIndex + 1][staffIndex];
             let nextMeasure: StaffMeasure = this.measureList[measureIndex + 1][staffIndex];
-            if (nextMeasure.StaffEntries.length > 0)
+            if (nextMeasure.StaffEntries.length > 0) {
                 return nextMeasure.StaffEntries[0];
                 return nextMeasure.StaffEntries[0];
+            }
         }
         }
         return undefined;
         return undefined;
     }
     }
+
     public getFirstVisibleMeasuresListFromIndeces(start: number, end: number): StaffMeasure[] {
     public getFirstVisibleMeasuresListFromIndeces(start: number, end: number): StaffMeasure[] {
         let graphicalMeasures: StaffMeasure[] = [];
         let graphicalMeasures: StaffMeasure[] = [];
         let numberOfStaves: number = this.measureList[0].length;
         let numberOfStaves: number = this.measureList[0].length;
-        for (let i: number = start; i <= end; i++)
-            for (let j: number = 0; j < numberOfStaves; j++)
+        for (let i: number = start; i <= end; i++) {
+            for (let j: number = 0; j < numberOfStaves; j++) {
                 if (this.measureList[i][j].isVisible()) {
                 if (this.measureList[i][j].isVisible()) {
                     graphicalMeasures.push(this.measureList[i][j]);
                     graphicalMeasures.push(this.measureList[i][j]);
                     break;
                     break;
                 }
                 }
+            }
+        }
         return graphicalMeasures;
         return graphicalMeasures;
     }
     }
+
     public orderMeasuresByStaffLine(measures: StaffMeasure[]): StaffMeasure[][] {
     public orderMeasuresByStaffLine(measures: StaffMeasure[]): StaffMeasure[][] {
         let orderedMeasures: StaffMeasure[][] = [];
         let orderedMeasures: StaffMeasure[][] = [];
         let mList: StaffMeasure[] = [];
         let mList: StaffMeasure[] = [];
         orderedMeasures.push(mList);
         orderedMeasures.push(mList);
         for (let i: number = 0; i < measures.length; i++) {
         for (let i: number = 0; i < measures.length; i++) {
-            if (i === 0)
+            if (i === 0) {
                 mList.push(measures[0]);
                 mList.push(measures[0]);
-            else {
-                if (measures[i].ParentStaffLine === measures[i - 1].ParentStaffLine)
+            } else {
+                if (measures[i].ParentStaffLine === measures[i - 1].ParentStaffLine) {
                     mList.push(measures[i]);
                     mList.push(measures[i]);
-                else {
-                    if (!orderedMeasures.indexOf(mList) !== -1)
+                } else {
+                    if (orderedMeasures.indexOf(mList) === -1) {
                         orderedMeasures.push(mList);
                         orderedMeasures.push(mList);
+                    }
                     mList = [];
                     mList = [];
                     orderedMeasures.push(mList);
                     orderedMeasures.push(mList);
                     mList.push(measures[i]);
                     mList.push(measures[i]);
@@ -207,6 +248,7 @@ export class GraphicalMusicSheet {
         }
         }
         return orderedMeasures;
         return orderedMeasures;
     }
     }
+
     public initializeActiveClefs(): ClefInstruction[] {
     public initializeActiveClefs(): ClefInstruction[] {
         let activeClefs: ClefInstruction[] = [];
         let activeClefs: ClefInstruction[] = [];
         let firstSourceMeasure: SourceMeasure = this.musicSheet.getFirstSourceMeasure();
         let firstSourceMeasure: SourceMeasure = this.musicSheet.getFirstSourceMeasure();
@@ -222,6 +264,7 @@ export class GraphicalMusicSheet {
         }
         }
         return activeClefs;
         return activeClefs;
     }
     }
+
     public GetMainKey(): KeyInstruction {
     public GetMainKey(): KeyInstruction {
         let firstSourceMeasure: SourceMeasure = this.musicSheet.getFirstSourceMeasure();
         let firstSourceMeasure: SourceMeasure = this.musicSheet.getFirstSourceMeasure();
         if (firstSourceMeasure !== undefined) {
         if (firstSourceMeasure !== undefined) {
@@ -236,6 +279,7 @@ export class GraphicalMusicSheet {
         }
         }
         return undefined;
         return undefined;
     }
     }
+
     public getOrCreateVerticalContainer(timestamp: Fraction): VerticalGraphicalStaffEntryContainer {
     public getOrCreateVerticalContainer(timestamp: Fraction): VerticalGraphicalStaffEntryContainer {
         if (this.verticalGraphicalStaffEntryContainers.length === 0 || timestamp > this.verticalGraphicalStaffEntryContainers.Last().AbsoluteTimestamp) {
         if (this.verticalGraphicalStaffEntryContainers.length === 0 || timestamp > this.verticalGraphicalStaffEntryContainers.Last().AbsoluteTimestamp) {
             let verticalGraphicalStaffEntryContainer: VerticalGraphicalStaffEntryContainer = new VerticalGraphicalStaffEntryContainer(this.numberOfStaves, timestamp);
             let verticalGraphicalStaffEntryContainer: VerticalGraphicalStaffEntryContainer = new VerticalGraphicalStaffEntryContainer(this.numberOfStaves, timestamp);
@@ -249,28 +293,34 @@ export class GraphicalMusicSheet {
                 this.verticalGraphicalStaffEntryContainers.splice(i + 1, 0, verticalGraphicalStaffEntryContainer);
                 this.verticalGraphicalStaffEntryContainers.splice(i + 1, 0, verticalGraphicalStaffEntryContainer);
                 return verticalGraphicalStaffEntryContainer;
                 return verticalGraphicalStaffEntryContainer;
             }
             }
-            if (this.verticalGraphicalStaffEntryContainers[i].AbsoluteTimestamp === timestamp)
+            if (this.verticalGraphicalStaffEntryContainers[i].AbsoluteTimestamp === timestamp) {
                 return this.verticalGraphicalStaffEntryContainers[i];
                 return this.verticalGraphicalStaffEntryContainers[i];
+            }
         }
         }
         return undefined;
         return undefined;
     }
     }
+
     public GetVerticalContainerFromTimestamp(timestamp: Fraction, startIndex: number): VerticalGraphicalStaffEntryContainer {
     public GetVerticalContainerFromTimestamp(timestamp: Fraction, startIndex: number): VerticalGraphicalStaffEntryContainer {
         let index: number = this.verticalGraphicalStaffEntryContainers.BinarySearch(startIndex,
         let index: number = this.verticalGraphicalStaffEntryContainers.BinarySearch(startIndex,
             this.verticalGraphicalStaffEntryContainers.length - startIndex,
             this.verticalGraphicalStaffEntryContainers.length - startIndex,
             new VerticalGraphicalStaffEntryContainer(0,
             new VerticalGraphicalStaffEntryContainer(0,
                 timestamp),
                 timestamp),
             new VerticalGraphicalStaffEntryContainer.VgseContainerTimestampComparer());
             new VerticalGraphicalStaffEntryContainer.VgseContainerTimestampComparer());
-        if (index >= 0)
+        if (index >= 0) {
             return this.verticalGraphicalStaffEntryContainers[index];
             return this.verticalGraphicalStaffEntryContainers[index];
+        }
         return undefined;
         return undefined;
     }
     }
+
     public GetVerticalContainerFromTimestamp(timestamp: Fraction): VerticalGraphicalStaffEntryContainer {
     public GetVerticalContainerFromTimestamp(timestamp: Fraction): VerticalGraphicalStaffEntryContainer {
         let index: number = this.verticalGraphicalStaffEntryContainers.BinarySearch(new VerticalGraphicalStaffEntryContainer(0, timestamp),
         let index: number = this.verticalGraphicalStaffEntryContainers.BinarySearch(new VerticalGraphicalStaffEntryContainer(0, timestamp),
             new VerticalGraphicalStaffEntryContainer.VgseContainerTimestampComparer());
             new VerticalGraphicalStaffEntryContainer.VgseContainerTimestampComparer());
-        if (index >= 0)
+        if (index >= 0) {
             return this.verticalGraphicalStaffEntryContainers[index];
             return this.verticalGraphicalStaffEntryContainers[index];
+        }
         return undefined;
         return undefined;
     }
     }
+
     public GetInterpolatedIndexInVerticalContainers(musicTimestamp: Fraction): number {
     public GetInterpolatedIndexInVerticalContainers(musicTimestamp: Fraction): number {
         let containers: VerticalGraphicalStaffEntryContainer[] = this.verticalGraphicalStaffEntryContainers;
         let containers: VerticalGraphicalStaffEntryContainer[] = this.verticalGraphicalStaffEntryContainers;
         let leftIndex: number = 0;
         let leftIndex: number = 0;
@@ -278,7 +328,7 @@ export class GraphicalMusicSheet {
         let foundIndex: number;
         let foundIndex: number;
         let leftTS: Fraction = undefined;
         let leftTS: Fraction = undefined;
         let rightTS: Fraction = undefined;
         let rightTS: Fraction = undefined;
-        if (musicTimestamp <= containers.Last().AbsoluteTimestamp) {
+        if (musicTimestamp <= containers[containers.length - 1].AbsoluteTimestamp) {
             while (rightIndex - leftIndex > 1) {
             while (rightIndex - leftIndex > 1) {
                 let middleIndex: number = (rightIndex + leftIndex) / 2;
                 let middleIndex: number = (rightIndex + leftIndex) / 2;
                 if (containers[leftIndex].AbsoluteTimestamp === musicTimestamp) {
                 if (containers[leftIndex].AbsoluteTimestamp === musicTimestamp) {
@@ -295,13 +345,14 @@ export class GraphicalMusicSheet {
                     leftIndex = middleIndex;
                     leftIndex = middleIndex;
                 }
                 }
             }
             }
-            if (leftIndex === rightIndex)
+            if (leftIndex === rightIndex) {
                 return this.verticalGraphicalStaffEntryContainers.indexOf(containers[leftIndex]);
                 return this.verticalGraphicalStaffEntryContainers.indexOf(containers[leftIndex]);
+            }
             leftTS = containers[leftIndex].AbsoluteTimestamp;
             leftTS = containers[leftIndex].AbsoluteTimestamp;
             rightTS = containers[rightIndex].AbsoluteTimestamp;
             rightTS = containers[rightIndex].AbsoluteTimestamp;
         } else {
         } else {
-            leftTS = containers.Last().AbsoluteTimestamp;
-            rightTS = new Fraction(getLongestStaffEntryDuration(containers.length - 1) + leftTS);
+            leftTS = containers[containers.length - 1].AbsoluteTimestamp;
+            rightTS = new Fraction(this.getLongestStaffEntryDuration(containers.length - 1) + leftTS);
             rightIndex = containers.length;
             rightIndex = containers.length;
         }
         }
         let diff: number = rightTS.RealValue - leftTS.RealValue;
         let diff: number = rightTS.RealValue - leftTS.RealValue;
@@ -309,112 +360,129 @@ export class GraphicalMusicSheet {
         foundIndex = rightIndex - (diffTS / diff);
         foundIndex = rightIndex - (diffTS / diff);
         return Math.min(foundIndex, this.verticalGraphicalStaffEntryContainers.length);
         return Math.min(foundIndex, this.verticalGraphicalStaffEntryContainers.length);
     }
     }
+
     private getLongestStaffEntryDuration(index: number): Fraction {
     private getLongestStaffEntryDuration(index: number): Fraction {
         let maxLength: Fraction = new Fraction(0, 1);
         let maxLength: Fraction = new Fraction(0, 1);
         for (let idx: number = 0, len: number = this.verticalGraphicalStaffEntryContainers[index].StaffEntries.length; idx < len; ++idx) {
         for (let idx: number = 0, len: number = this.verticalGraphicalStaffEntryContainers[index].StaffEntries.length; idx < len; ++idx) {
             let graphicalStaffEntry: GraphicalStaffEntry = this.verticalGraphicalStaffEntryContainers[index].StaffEntries[idx];
             let graphicalStaffEntry: GraphicalStaffEntry = this.verticalGraphicalStaffEntryContainers[index].StaffEntries[idx];
-            if (graphicalStaffEntry === undefined)
+            if (graphicalStaffEntry === undefined) {
                 continue;
                 continue;
+            }
             for (let idx2: number = 0, len2: number = graphicalStaffEntry.Notes.length; idx2 < len2; ++idx2) {
             for (let idx2: number = 0, len2: number = graphicalStaffEntry.Notes.length; idx2 < len2; ++idx2) {
                 let graphicalNotes: GraphicalNote[] = graphicalStaffEntry.Notes[idx2];
                 let graphicalNotes: GraphicalNote[] = graphicalStaffEntry.Notes[idx2];
                 for (let idx3: number = 0, len3: number = graphicalNotes.length; idx3 < len3; ++idx3) {
                 for (let idx3: number = 0, len3: number = graphicalNotes.length; idx3 < len3; ++idx3) {
                     let note: GraphicalNote = graphicalNotes[idx3];
                     let note: GraphicalNote = graphicalNotes[idx3];
-                    if (note.GraphicalNoteLength > maxLength)
+                    if (note.GraphicalNoteLength > maxLength) {
                         maxLength = note.GraphicalNoteLength;
                         maxLength = note.GraphicalNoteLength;
+                    }
                 }
                 }
             }
             }
         }
         }
         return maxLength;
         return maxLength;
     }
     }
+
     public getVisibleStavesIndecesFromSourceMeasure(visibleMeasures: StaffMeasure[]): number[] {
     public getVisibleStavesIndecesFromSourceMeasure(visibleMeasures: StaffMeasure[]): number[] {
         let visibleInstruments: Instrument[] = [];
         let visibleInstruments: Instrument[] = [];
         let visibleStavesIndeces: number[] = [];
         let visibleStavesIndeces: number[] = [];
         for (let idx: number = 0, len: number = visibleMeasures.length; idx < len; ++idx) {
         for (let idx: number = 0, len: number = visibleMeasures.length; idx < len; ++idx) {
             let graphicalMeasure: StaffMeasure = visibleMeasures[idx];
             let graphicalMeasure: StaffMeasure = visibleMeasures[idx];
             let instrument: Instrument = graphicalMeasure.ParentStaff.ParentInstrument;
             let instrument: Instrument = graphicalMeasure.ParentStaff.ParentInstrument;
-            if (!visibleInstruments.indexOf(instrument) !== -1)
+            if (!visibleInstruments.indexOf(instrument) !== -1) {
                 visibleInstruments.push(instrument);
                 visibleInstruments.push(instrument);
+            }
         }
         }
         for (let idx: number = 0, len: number = visibleInstruments.length; idx < len; ++idx) {
         for (let idx: number = 0, len: number = visibleInstruments.length; idx < len; ++idx) {
             let instrument: Instrument = visibleInstruments[idx];
             let instrument: Instrument = visibleInstruments[idx];
             let index: number = this.musicSheet.GetGlobalStaffIndexOfFirstStaff(instrument);
             let index: number = this.musicSheet.GetGlobalStaffIndexOfFirstStaff(instrument);
-            for (let j: number = 0; j < instrument.Staves.length; j++)
+            for (let j: number = 0; j < instrument.Staves.length; j++) {
                 visibleStavesIndeces.push(index + j);
                 visibleStavesIndeces.push(index + j);
+            }
         }
         }
         return visibleStavesIndeces;
         return visibleStavesIndeces;
     }
     }
+
     public getGraphicalMeasureFromSourceMeasureAndIndex(sourceMeasure: SourceMeasure, index: number): StaffMeasure {
     public getGraphicalMeasureFromSourceMeasureAndIndex(sourceMeasure: SourceMeasure, index: number): StaffMeasure {
         for (let i: number = 0; i < this.measureList.length; i++) {
         for (let i: number = 0; i < this.measureList.length; i++) {
-            if (this.measureList[i][0].ParentSourceMeasure === sourceMeasure)
+            if (this.measureList[i][0].ParentSourceMeasure === sourceMeasure) {
                 return this.measureList[i][index];
                 return this.measureList[i][index];
+            }
         }
         }
         return undefined;
         return undefined;
     }
     }
+
     public getMeasureIndex(graphicalMeasure: StaffMeasure, measureIndex: number, inListIndex: number): boolean {
     public getMeasureIndex(graphicalMeasure: StaffMeasure, measureIndex: number, inListIndex: number): boolean {
         measureIndex = 0;
         measureIndex = 0;
         inListIndex = 0;
         inListIndex = 0;
         for (; measureIndex < this.measureList.length; measureIndex++) {
         for (; measureIndex < this.measureList.length; measureIndex++) {
             for (let idx: number = 0, len: number = this.measureList[measureIndex].length; idx < len; ++idx) {
             for (let idx: number = 0, len: number = this.measureList[measureIndex].length; idx < len; ++idx) {
                 let measure: StaffMeasure = this.measureList[measureIndex][idx];
                 let measure: StaffMeasure = this.measureList[measureIndex][idx];
-                if (measure === graphicalMeasure)
+                if (measure === graphicalMeasure) {
                     return true;
                     return true;
+                }
             }
             }
         }
         }
         return false;
         return false;
     }
     }
+
     public getMeasureIndex(entry: GraphicalStaffEntry, measureIndex: number, inListIndex: number): boolean {
     public getMeasureIndex(entry: GraphicalStaffEntry, measureIndex: number, inListIndex: number): boolean {
         return this.getMeasureIndex(entry.ParentMeasure, measureIndex, inListIndex);
         return this.getMeasureIndex(entry.ParentMeasure, measureIndex, inListIndex);
     }
     }
-    public GetNearesNote(clickPosition: PointF_2D, maxClickDist: PointF_2D): GraphicalNote {
+
+    public GetNearesNote(clickPosition: PointF2D, maxClickDist: PointF2D): GraphicalNote {
         let initialSearchArea: number = 10;
         let initialSearchArea: number = 10;
         let foundNotes: GraphicalNote[] = [];
         let foundNotes: GraphicalNote[] = [];
         let region: BoundingBox = new BoundingBox(undefined);
         let region: BoundingBox = new BoundingBox(undefined);
-        region.BorderLeft = clickPosition.X - initialSearchArea;
-        region.BorderTop = clickPosition.Y - initialSearchArea;
-        region.BorderRight = clickPosition.X + initialSearchArea;
-        region.BorderBottom = clickPosition.Y + initialSearchArea;
-        region.AbsolutePosition = new PointF_2D(0, 0);
+        region.BorderLeft = clickPosition.x - initialSearchArea;
+        region.BorderTop = clickPosition.y - initialSearchArea;
+        region.BorderRight = clickPosition.x + initialSearchArea;
+        region.BorderBottom = clickPosition.y + initialSearchArea;
+        region.AbsolutePosition = new PointF2D(0, 0);
         for (let idx: number = 0, len: number = this.MusicPages.length; idx < len; ++idx) {
         for (let idx: number = 0, len: number = this.MusicPages.length; idx < len; ++idx) {
             let graphicalMusicPage: GraphicalMusicPage = this.MusicPages[idx];
             let graphicalMusicPage: GraphicalMusicPage = this.MusicPages[idx];
             let entries: GraphicalNote[] = graphicalMusicPage.PositionAndShape.getObjectsInRegion<GraphicalNote>(region);
             let entries: GraphicalNote[] = graphicalMusicPage.PositionAndShape.getObjectsInRegion<GraphicalNote>(region);
-            let entriesArr: GraphicalNote[] = __as__<GraphicalNote[]>(entries, GraphicalNote[]) ?? entries;
+            let entriesArr: GraphicalNote[] = __as__<GraphicalNote[]>(entries, GraphicalNote[]) ? ? entries;
             if (entries === undefined) {
             if (entries === undefined) {
                 continue;
                 continue;
             } else {
             } else {
                 for (let idx2: number = 0, len2: number = entriesArr.length; idx2 < len2; ++idx2) {
                 for (let idx2: number = 0, len2: number = entriesArr.length; idx2 < len2; ++idx2) {
                     let note: GraphicalNote = entriesArr[idx2];
                     let note: GraphicalNote = entriesArr[idx2];
-                    if (Math.abs(note.PositionAndShape.AbsolutePosition.X - clickPosition.X) < maxClickDist.X && Math.abs(note.PositionAndShape.AbsolutePosition.Y - clickPosition.Y) < maxClickDist.Y)
+                    if (Math.abs(note.PositionAndShape.AbsolutePosition.x - clickPosition.x) < maxClickDist.x && Math.abs(note.PositionAndShape.AbsolutePosition.y - clickPosition.y) < maxClickDist.y) {
                         foundNotes.push(note);
                         foundNotes.push(note);
+                    }
                 }
                 }
             }
             }
         }
         }
         let closest: GraphicalNote = undefined;
         let closest: GraphicalNote = undefined;
         for (let idx: number = 0, len: number = foundNotes.length; idx < len; ++idx) {
         for (let idx: number = 0, len: number = foundNotes.length; idx < len; ++idx) {
             let note: GraphicalNote = foundNotes[idx];
             let note: GraphicalNote = foundNotes[idx];
-            if (closest === undefined)
+            if (closest === undefined) {
                 closest = note;
                 closest = note;
-            else {
-                if (note.ParentStaffEntry.RelInMeasureTimestamp === undefined)
+            } else {
+                if (note.ParentStaffEntry.RelInMeasureTimestamp === undefined) {
                     continue;
                     continue;
+                }
                 let deltaNew: number = this.CalculateDistance(note.PositionAndShape.AbsolutePosition, clickPosition);
                 let deltaNew: number = this.CalculateDistance(note.PositionAndShape.AbsolutePosition, clickPosition);
                 let deltaOld: number = this.CalculateDistance(closest.PositionAndShape.AbsolutePosition, clickPosition);
                 let deltaOld: number = this.CalculateDistance(closest.PositionAndShape.AbsolutePosition, clickPosition);
-                if (deltaNew < deltaOld)
+                if (deltaNew < deltaOld) {
                     closest = note;
                     closest = note;
+                }
             }
             }
         }
         }
-        if (closest !== undefined)
+        if (closest !== undefined) {
             return closest;
             return closest;
+        }
         return undefined;
         return undefined;
     }
     }
-    public GetClickableLabel(clickPosition: PointF_2D): GraphicalLabel {
+
+    public GetClickableLabel(clickPosition: PointF2D): GraphicalLabel {
         let initialSearchAreaX: number = 4;
         let initialSearchAreaX: number = 4;
         let initialSearchAreaY: number = 4;
         let initialSearchAreaY: number = 4;
         let region: BoundingBox = new BoundingBox(undefined);
         let region: BoundingBox = new BoundingBox(undefined);
-        region.BorderLeft = clickPosition.X - initialSearchAreaX;
-        region.BorderTop = clickPosition.Y - initialSearchAreaY;
-        region.BorderRight = clickPosition.X + initialSearchAreaX;
-        region.BorderBottom = clickPosition.Y + initialSearchAreaY;
-        region.AbsolutePosition = new PointF_2D(0, 0);
+        region.BorderLeft = clickPosition.x - initialSearchAreaX;
+        region.BorderTop = clickPosition.y - initialSearchAreaY;
+        region.BorderRight = clickPosition.x + initialSearchAreaX;
+        region.BorderBottom = clickPosition.y + initialSearchAreaY;
+        region.AbsolutePosition = new PointF2D(0, 0);
         for (let idx: number = 0, len: number = this.MusicPages.length; idx < len; ++idx) {
         for (let idx: number = 0, len: number = this.MusicPages.length; idx < len; ++idx) {
             let graphicalMusicPage: GraphicalMusicPage = this.MusicPages[idx];
             let graphicalMusicPage: GraphicalMusicPage = this.MusicPages[idx];
             let entries: GraphicalLabel[] = graphicalMusicPage.PositionAndShape.getObjectsInRegion<GraphicalLabel>(region);
             let entries: GraphicalLabel[] = graphicalMusicPage.PositionAndShape.getObjectsInRegion<GraphicalLabel>(region);
@@ -429,15 +497,16 @@ export class GraphicalMusicSheet {
         }
         }
         return undefined;
         return undefined;
     }
     }
-    public GetNearestStaffEntry(clickPosition: PointF_2D): GraphicalStaffEntry {
+
+    public GetNearestStaffEntry(clickPosition: PointF2D): GraphicalStaffEntry {
         let initialSearchArea: number = 10;
         let initialSearchArea: number = 10;
         let foundEntries: GraphicalStaffEntry[] = [];
         let foundEntries: GraphicalStaffEntry[] = [];
         let region: BoundingBox = new BoundingBox(undefined);
         let region: BoundingBox = new BoundingBox(undefined);
-        region.BorderLeft = clickPosition.X - initialSearchArea;
-        region.BorderTop = clickPosition.Y - initialSearchArea;
-        region.BorderRight = clickPosition.X + initialSearchArea;
-        region.BorderBottom = clickPosition.Y + initialSearchArea;
-        region.AbsolutePosition = new PointF_2D(0, 0);
+        region.BorderLeft = clickPosition.x - initialSearchArea;
+        region.BorderTop = clickPosition.y - initialSearchArea;
+        region.BorderRight = clickPosition.x + initialSearchArea;
+        region.BorderBottom = clickPosition.y + initialSearchArea;
+        region.AbsolutePosition = new PointF2D(0, 0);
         for (let idx: number = 0, len: number = this.MusicPages.length; idx < len; ++idx) {
         for (let idx: number = 0, len: number = this.MusicPages.length; idx < len; ++idx) {
             let graphicalMusicPage: GraphicalMusicPage = this.MusicPages[idx];
             let graphicalMusicPage: GraphicalMusicPage = this.MusicPages[idx];
             let entries: GraphicalStaffEntry[] = graphicalMusicPage.PositionAndShape.getObjectsInRegion<GraphicalStaffEntry>(region, false);
             let entries: GraphicalStaffEntry[] = graphicalMusicPage.PositionAndShape.getObjectsInRegion<GraphicalStaffEntry>(region, false);
@@ -453,118 +522,137 @@ export class GraphicalMusicSheet {
         let closest: GraphicalStaffEntry = undefined;
         let closest: GraphicalStaffEntry = undefined;
         for (let idx: number = 0, len: number = foundEntries.length; idx < len; ++idx) {
         for (let idx: number = 0, len: number = foundEntries.length; idx < len; ++idx) {
             let gse: GraphicalStaffEntry = foundEntries[idx];
             let gse: GraphicalStaffEntry = foundEntries[idx];
-            if (closest === undefined)
+            if (closest === undefined) {
                 closest = gse;
                 closest = gse;
-            else {
-                if (gse.RelInMeasureTimestamp === undefined)
+            } else {
+                if (gse.RelInMeasureTimestamp === undefined) {
                     continue;
                     continue;
+                }
                 let deltaNew: number = this.CalculateDistance(gse.PositionAndShape.AbsolutePosition, clickPosition);
                 let deltaNew: number = this.CalculateDistance(gse.PositionAndShape.AbsolutePosition, clickPosition);
                 let deltaOld: number = this.CalculateDistance(closest.PositionAndShape.AbsolutePosition, clickPosition);
                 let deltaOld: number = this.CalculateDistance(closest.PositionAndShape.AbsolutePosition, clickPosition);
-                if (deltaNew < deltaOld)
+                if (deltaNew < deltaOld) {
                     closest = gse;
                     closest = gse;
+                }
             }
             }
         }
         }
-        if (closest !== undefined)
+        if (closest !== undefined) {
             return closest;
             return closest;
+        }
         return undefined;
         return undefined;
     }
     }
-    public GetPossibleCommentAnchor(clickPosition: PointF_2D): SourceStaffEntry {
+
+    public GetPossibleCommentAnchor(clickPosition: PointF2D): SourceStaffEntry {
         let entry: GraphicalStaffEntry = this.GetNearestStaffEntry(clickPosition);
         let entry: GraphicalStaffEntry = this.GetNearestStaffEntry(clickPosition);
-        if (entry === undefined)
+        if (entry === undefined) {
             return undefined;
             return undefined;
+        }
         return entry.SourceStaffEntry;
         return entry.SourceStaffEntry;
     }
     }
-    public getClickedObjectOfType<T>(positionOnMusicSheet: PointF_2D): T {
+
+    public getClickedObjectOfType<T>(positionOnMusicSheet: PointF2D): T {
         for (let idx: number = 0, len: number = this.musicPages.length; idx < len; ++idx) {
         for (let idx: number = 0, len: number = this.musicPages.length; idx < len; ++idx) {
             let page: GraphicalMusicPage = this.musicPages[idx];
             let page: GraphicalMusicPage = this.musicPages[idx];
             let o: Object = page.PositionAndShape.getClickedObjectOfType<T>(positionOnMusicSheet);
             let o: Object = page.PositionAndShape.getClickedObjectOfType<T>(positionOnMusicSheet);
-            if (o !== undefined)
+            if (o !== undefined) {
                 return (o as T);
                 return (o as T);
+            }
         }
         }
         return undefined;
         return undefined;
     }
     }
-    public tryGetTimestampFromPosition(positionOnMusicSheet: PointF_2D): Fraction {
+
+    public tryGetTimestampFromPosition(positionOnMusicSheet: PointF2D): Fraction {
         let entry: GraphicalStaffEntry = this.getClickedObjectOfType<GraphicalStaffEntry>(positionOnMusicSheet);
         let entry: GraphicalStaffEntry = this.getClickedObjectOfType<GraphicalStaffEntry>(positionOnMusicSheet);
-        if (entry === undefined)
+        if (entry === undefined) {
             return undefined;
             return undefined;
+        }
         return entry.getAbsoluteTimestamp();
         return entry.getAbsoluteTimestamp();
     }
     }
-    public tryGetClickableLabel(positionOnMusicSheet: PointF_2D): GraphicalLabel {
+
+    public tryGetClickableLabel(positionOnMusicSheet: PointF2D): GraphicalLabel {
         try {
         try {
             return this.GetClickableLabel(positionOnMusicSheet);
             return this.GetClickableLabel(positionOnMusicSheet);
         }
         }
         catch (ex) {
         catch (ex) {
-            Logger.DefaultLogger.LogError(LogLevel.NORMAL, "GraphicalMusicSheet.tryGetClickableObject",
-                "positionOnMusicSheet: " + positionOnMusicSheet, ex);
+            Logging.log("GraphicalMusicSheet.tryGetClickableObject", "positionOnMusicSheet: " + positionOnMusicSheet, ex);
         }
         }
 
 
         return undefined;
         return undefined;
     }
     }
-    public tryGetTimeStampFromPosition(positionOnMusicSheet: PointF_2D): Fraction {
+
+    public tryGetTimeStampFromPosition(positionOnMusicSheet: PointF2D): Fraction {
         try {
         try {
             let entry: GraphicalStaffEntry = this.GetNearestStaffEntry(positionOnMusicSheet);
             let entry: GraphicalStaffEntry = this.GetNearestStaffEntry(positionOnMusicSheet);
-            if (entry === undefined)
+            if (entry === undefined) {
                 return undefined;
                 return undefined;
+            }
             return entry.getAbsoluteTimestamp();
             return entry.getAbsoluteTimestamp();
-        }
-        catch (ex) {
-            Logger.DefaultLogger.LogError(LogLevel.NORMAL, "GraphicalMusicSheet.tryGetTimeStampFromPosition",
+        } catch (ex) {
+            Logging.log("GraphicalMusicSheet.tryGetTimeStampFromPosition",
                 "positionOnMusicSheet: " + positionOnMusicSheet, ex);
                 "positionOnMusicSheet: " + positionOnMusicSheet, ex);
         }
         }
 
 
         return undefined;
         return undefined;
     }
     }
-    private CalculateDistance(pt1: PointF_2D, pt2: PointF_2D): number {
-        let deltaX: number = pt1.X - pt2.X;
-        let deltaY: number = pt1.Y - pt2.Y;
+
+    private CalculateDistance(pt1: PointF2D, pt2: PointF2D): number {
+        let deltaX: number = pt1.x - pt2.x;
+        let deltaY: number = pt1.y - pt2.y;
         return (deltaX * deltaX) + (deltaY * deltaY);
         return (deltaX * deltaX) + (deltaY * deltaY);
     }
     }
+
     public getStaffEntry(index: number): GraphicalStaffEntry {
     public getStaffEntry(index: number): GraphicalStaffEntry {
         return this.getStaffEntry(this.VerticalGraphicalStaffEntryContainers[index]);
         return this.getStaffEntry(this.VerticalGraphicalStaffEntryContainers[index]);
     }
     }
+
     public getStaffEntry(container: VerticalGraphicalStaffEntryContainer): GraphicalStaffEntry {
     public getStaffEntry(container: VerticalGraphicalStaffEntryContainer): GraphicalStaffEntry {
         let staffEntry: GraphicalStaffEntry = undefined;
         let staffEntry: GraphicalStaffEntry = undefined;
         try {
         try {
             for (let idx: number = 0, len: number = container.StaffEntries.length; idx < len; ++idx) {
             for (let idx: number = 0, len: number = container.StaffEntries.length; idx < len; ++idx) {
                 let entry: GraphicalStaffEntry = container.StaffEntries[idx];
                 let entry: GraphicalStaffEntry = container.StaffEntries[idx];
-                if (entry === undefined || !entry.SourceStaffEntry.ParentStaff.ParentInstrument.Visible)
+                if (entry === undefined || !entry.SourceStaffEntry.ParentStaff.ParentInstrument.Visible) {
                     continue;
                     continue;
+                }
                 if (staffEntry === undefined) {
                 if (staffEntry === undefined) {
                     staffEntry = entry;
                     staffEntry = entry;
                 } else if (entry.PositionAndShape !== undefined && staffEntry.PositionAndShape !== undefined) {
                 } else if (entry.PositionAndShape !== undefined && staffEntry.PositionAndShape !== undefined) {
-                    if (staffEntry.PositionAndShape.RelativePosition.X > entry.PositionAndShape.RelativePosition.X)
+                    if (staffEntry.PositionAndShape.RelativePosition.x > entry.PositionAndShape.RelativePosition.x) {
                         staffEntry = entry;
                         staffEntry = entry;
+                    }
                 }
                 }
             }
             }
-        }
-        catch (ex) {
-            Logger.DefaultLogger.LogError(LogLevel.NORMAL, "GraphicalMusicSheet.getStaffEntry", ex);
+        } catch (ex) {
+            Logging.log("GraphicalMusicSheet.getStaffEntry", ex);
         }
         }
 
 
         return staffEntry;
         return staffEntry;
     }
     }
+
     public GetPreviousVisibleContainerIndex(index: number): number {
     public GetPreviousVisibleContainerIndex(index: number): number {
         for (let i: number = index - 1; i >= 0; i--) {
         for (let i: number = index - 1; i >= 0; i--) {
             let entries: GraphicalStaffEntry[] = this.verticalGraphicalStaffEntryContainers[i].StaffEntries;
             let entries: GraphicalStaffEntry[] = this.verticalGraphicalStaffEntryContainers[i].StaffEntries;
             for (let idx: number = 0, len: number = entries.length; idx < len; ++idx) {
             for (let idx: number = 0, len: number = entries.length; idx < len; ++idx) {
                 let entry: GraphicalStaffEntry = entries[idx];
                 let entry: GraphicalStaffEntry = entries[idx];
-                if (entry !== undefined && entry.SourceStaffEntry.ParentStaff.ParentInstrument.Visible)
+                if (entry !== undefined && entry.SourceStaffEntry.ParentStaff.ParentInstrument.Visible) {
                     return i;
                     return i;
+                }
             }
             }
         }
         }
         return -1;
         return -1;
     }
     }
+
     public GetNextVisibleContainerIndex(index: number): number {
     public GetNextVisibleContainerIndex(index: number): number {
         for (let i: number = index + 1; i < this.verticalGraphicalStaffEntryContainers.length; ++i) {
         for (let i: number = index + 1; i < this.verticalGraphicalStaffEntryContainers.length; ++i) {
             let entries: GraphicalStaffEntry[] = this.verticalGraphicalStaffEntryContainers[i].StaffEntries;
             let entries: GraphicalStaffEntry[] = this.verticalGraphicalStaffEntryContainers[i].StaffEntries;
             for (let idx: number = 0, len: number = entries.length; idx < len; ++idx) {
             for (let idx: number = 0, len: number = entries.length; idx < len; ++idx) {
                 let entry: GraphicalStaffEntry = entries[idx];
                 let entry: GraphicalStaffEntry = entries[idx];
-                if (entry !== undefined && entry.SourceStaffEntry.ParentStaff.ParentInstrument.Visible)
+                if (entry !== undefined && entry.SourceStaffEntry.ParentStaff.ParentInstrument.Visible) {
                     return i;
                     return i;
+                }
             }
             }
         }
         }
         return -1;
         return -1;
     }
     }
+
     public findClosestLeftStaffEntry(fractionalIndex: number, searchOnlyVisibleEntries: boolean): GraphicalStaffEntry {
     public findClosestLeftStaffEntry(fractionalIndex: number, searchOnlyVisibleEntries: boolean): GraphicalStaffEntry {
         let foundEntry: GraphicalStaffEntry = undefined;
         let foundEntry: GraphicalStaffEntry = undefined;
         let leftIndex: number = <number>Math.floor(fractionalIndex);
         let leftIndex: number = <number>Math.floor(fractionalIndex);
@@ -573,27 +661,35 @@ export class GraphicalMusicSheet {
             foundEntry = this.getStaffEntry(i);
             foundEntry = this.getStaffEntry(i);
             if (foundEntry !== undefined) {
             if (foundEntry !== undefined) {
                 if (searchOnlyVisibleEntries) {
                 if (searchOnlyVisibleEntries) {
-                    if (foundEntry.SourceStaffEntry.ParentStaff.ParentInstrument.Visible)
+                    if (foundEntry.SourceStaffEntry.ParentStaff.ParentInstrument.Visible) {
                         return foundEntry;
                         return foundEntry;
-                } else return foundEntry;
+                    }
+                } else {
+                    return foundEntry;
+                }
             }
             }
         }
         }
         return undefined;
         return undefined;
     }
     }
+
     public findClosestRightStaffEntry(fractionalIndex: number, returnOnlyVisibleEntries: boolean): GraphicalStaffEntry {
     public findClosestRightStaffEntry(fractionalIndex: number, returnOnlyVisibleEntries: boolean): GraphicalStaffEntry {
         let foundEntry: GraphicalStaffEntry = undefined;
         let foundEntry: GraphicalStaffEntry = undefined;
-        let rightIndex: number = <number>Math.max(0, Math.ceiling(fractionalIndex));
+        let rightIndex: number = <number>Math.max(0, Math.ceil(fractionalIndex));
         for (let i: number = rightIndex; i < this.VerticalGraphicalStaffEntryContainers.length; i++) {
         for (let i: number = rightIndex; i < this.VerticalGraphicalStaffEntryContainers.length; i++) {
             foundEntry = this.getStaffEntry(i);
             foundEntry = this.getStaffEntry(i);
             if (foundEntry !== undefined) {
             if (foundEntry !== undefined) {
                 if (returnOnlyVisibleEntries) {
                 if (returnOnlyVisibleEntries) {
-                    if (foundEntry.SourceStaffEntry.ParentStaff.ParentInstrument.Visible)
+                    if (foundEntry.SourceStaffEntry.ParentStaff.ParentInstrument.Visible) {
                         return foundEntry;
                         return foundEntry;
-                } else return foundEntry;
+                    }
+                } else {
+                    return foundEntry;
+                }
             }
             }
         }
         }
         return undefined;
         return undefined;
     }
     }
+
     public calculateXPositionFromTimestamp(timeStamp: Fraction, currentMusicSystem: MusicSystem): number {
     public calculateXPositionFromTimestamp(timeStamp: Fraction, currentMusicSystem: MusicSystem): number {
         let fractionalIndex: number = this.GetInterpolatedIndexInVerticalContainers(timeStamp);
         let fractionalIndex: number = this.GetInterpolatedIndexInVerticalContainers(timeStamp);
         let previousStaffEntry: GraphicalStaffEntry = this.findClosestLeftStaffEntry(fractionalIndex, true);
         let previousStaffEntry: GraphicalStaffEntry = this.findClosestLeftStaffEntry(fractionalIndex, true);
@@ -621,18 +717,20 @@ export class GraphicalMusicSheet {
             let previousStaffEntryPositionX: number;
             let previousStaffEntryPositionX: number;
             let nextStaffEntryPositionX: number;
             let nextStaffEntryPositionX: number;
             if (previousStaffEntry === undefined) {
             if (previousStaffEntry === undefined) {
-                previousStaffEntryPositionX = nextStaffEntryPositionX = nextStaffEntry.PositionAndShape.AbsolutePosition.X;
+                previousStaffEntryPositionX = nextStaffEntryPositionX = nextStaffEntry.PositionAndShape.AbsolutePosition.x;
                 fraction = 0;
                 fraction = 0;
             } else if (nextStaffEntry === undefined) {
             } else if (nextStaffEntry === undefined) {
-                previousStaffEntryPositionX = previousStaffEntry.PositionAndShape.AbsolutePosition.X;
+                previousStaffEntryPositionX = previousStaffEntry.PositionAndShape.AbsolutePosition.x;
                 nextStaffEntryPositionX = currentMusicSystem.GetRightBorderAbsoluteXPosition();
                 nextStaffEntryPositionX = currentMusicSystem.GetRightBorderAbsoluteXPosition();
                 fraction = (currentTimeStamp - previousStaffEntry.getAbsoluteTimestamp().RealValue) / ((previousStaffEntry.ParentMeasure.ParentSourceMeasure.AbsoluteTimestamp + previousStaffEntry.ParentMeasure.ParentSourceMeasure.Duration).RealValue - previousStaffEntry.getAbsoluteTimestamp().RealValue);
                 fraction = (currentTimeStamp - previousStaffEntry.getAbsoluteTimestamp().RealValue) / ((previousStaffEntry.ParentMeasure.ParentSourceMeasure.AbsoluteTimestamp + previousStaffEntry.ParentMeasure.ParentSourceMeasure.Duration).RealValue - previousStaffEntry.getAbsoluteTimestamp().RealValue);
             } else {
             } else {
-                previousStaffEntryPositionX = previousStaffEntry.PositionAndShape.AbsolutePosition.X;
-                nextStaffEntryPositionX = nextStaffEntry.PositionAndShape.AbsolutePosition.X;
-                if (previousStaffEntry === nextStaffEntry)
+                previousStaffEntryPositionX = previousStaffEntry.PositionAndShape.AbsolutePosition.x;
+                nextStaffEntryPositionX = nextStaffEntry.PositionAndShape.AbsolutePosition.x;
+                if (previousStaffEntry === nextStaffEntry) {
                     fraction = 0;
                     fraction = 0;
-                else fraction = (currentTimeStamp - previousStaffEntry.getAbsoluteTimestamp().RealValue) / (nextStaffEntry.getAbsoluteTimestamp().RealValue - previousStaffEntry.getAbsoluteTimestamp().RealValue);
+                } else {
+                    fraction = (currentTimeStamp - previousStaffEntry.getAbsoluteTimestamp().RealValue) / (nextStaffEntry.getAbsoluteTimestamp().RealValue - previousStaffEntry.getAbsoluteTimestamp().RealValue);
+                }
             }
             }
             fraction = Math.min(1, Math.max(0, fraction));
             fraction = Math.min(1, Math.max(0, fraction));
             let interpolatedXPosition: number = previousStaffEntryPositionX + fraction * (nextStaffEntryPositionX - previousStaffEntryPositionX);
             let interpolatedXPosition: number = previousStaffEntryPositionX + fraction * (nextStaffEntryPositionX - previousStaffEntryPositionX);
@@ -643,14 +741,14 @@ export class GraphicalMusicSheet {
             let interpolatedXPosition: number;
             let interpolatedXPosition: number;
             if (currentTimeStamp < nextSystemLeftBorderTimeStamp) {
             if (currentTimeStamp < nextSystemLeftBorderTimeStamp) {
                 currentMusicSystem = previousStaffEntryMusicSystem;
                 currentMusicSystem = previousStaffEntryMusicSystem;
-                let previousStaffEntryPositionX: number = previousStaffEntry.PositionAndShape.AbsolutePosition.X;
+                let previousStaffEntryPositionX: number = previousStaffEntry.PositionAndShape.AbsolutePosition.x;
                 let previousSystemRightBorderX: number = currentMusicSystem.GetRightBorderAbsoluteXPosition();
                 let previousSystemRightBorderX: number = currentMusicSystem.GetRightBorderAbsoluteXPosition();
                 fraction = (currentTimeStamp - previousStaffEntry.getAbsoluteTimestamp().RealValue) / (nextSystemLeftBorderTimeStamp - previousStaffEntry.getAbsoluteTimestamp().RealValue);
                 fraction = (currentTimeStamp - previousStaffEntry.getAbsoluteTimestamp().RealValue) / (nextSystemLeftBorderTimeStamp - previousStaffEntry.getAbsoluteTimestamp().RealValue);
                 fraction = Math.min(1, Math.max(0, fraction));
                 fraction = Math.min(1, Math.max(0, fraction));
                 interpolatedXPosition = previousStaffEntryPositionX + fraction * (previousSystemRightBorderX - previousStaffEntryPositionX);
                 interpolatedXPosition = previousStaffEntryPositionX + fraction * (previousSystemRightBorderX - previousStaffEntryPositionX);
             } else {
             } else {
                 currentMusicSystem = nextStaffEntryMusicSystem;
                 currentMusicSystem = nextStaffEntryMusicSystem;
-                let nextStaffEntryPositionX: number = nextStaffEntry.PositionAndShape.AbsolutePosition.X;
+                let nextStaffEntryPositionX: number = nextStaffEntry.PositionAndShape.AbsolutePosition.x;
                 let nextSystemLeftBorderX: number = currentMusicSystem.GetLeftBorderAbsoluteXPosition();
                 let nextSystemLeftBorderX: number = currentMusicSystem.GetLeftBorderAbsoluteXPosition();
                 fraction = (currentTimeStamp - nextSystemLeftBorderTimeStamp) / (nextStaffEntry.getAbsoluteTimestamp().RealValue - nextSystemLeftBorderTimeStamp);
                 fraction = (currentTimeStamp - nextSystemLeftBorderTimeStamp) / (nextStaffEntry.getAbsoluteTimestamp().RealValue - nextSystemLeftBorderTimeStamp);
                 fraction = Math.min(1, Math.max(0, fraction));
                 fraction = Math.min(1, Math.max(0, fraction));
@@ -659,52 +757,63 @@ export class GraphicalMusicSheet {
             return interpolatedXPosition;
             return interpolatedXPosition;
         }
         }
     }
     }
+
     public GetNumberOfVisibleInstruments(): number {
     public GetNumberOfVisibleInstruments(): number {
         let visibleInstrumentCount: number = 0;
         let visibleInstrumentCount: number = 0;
         for (let idx: number = 0, len: number = this.musicSheet.Instruments.length; idx < len; ++idx) {
         for (let idx: number = 0, len: number = this.musicSheet.Instruments.length; idx < len; ++idx) {
             let instrument: Instrument = this.musicSheet.Instruments[idx];
             let instrument: Instrument = this.musicSheet.Instruments[idx];
-            if (instrument.Visible === true)
+            if (instrument.Visible === true) {
                 visibleInstrumentCount++;
                 visibleInstrumentCount++;
+            }
         }
         }
         return visibleInstrumentCount;
         return visibleInstrumentCount;
     }
     }
+
     public GetNumberOfFollowedInstruments(): number {
     public GetNumberOfFollowedInstruments(): number {
         let followedInstrumentCount: number = 0;
         let followedInstrumentCount: number = 0;
         for (let idx: number = 0, len: number = this.musicSheet.Instruments.length; idx < len; ++idx) {
         for (let idx: number = 0, len: number = this.musicSheet.Instruments.length; idx < len; ++idx) {
             let instrument: Instrument = this.musicSheet.Instruments[idx];
             let instrument: Instrument = this.musicSheet.Instruments[idx];
-            if (instrument.Following === true)
+            if (instrument.Following === true) {
                 followedInstrumentCount++;
                 followedInstrumentCount++;
+            }
         }
         }
         return followedInstrumentCount;
         return followedInstrumentCount;
     }
     }
+
     public GetGraphicalFromSourceMeasure(sourceMeasure: SourceMeasure): StaffMeasure[] {
     public GetGraphicalFromSourceMeasure(sourceMeasure: SourceMeasure): StaffMeasure[] {
         return this.SourceToGraphicalMeasureLinks[sourceMeasure];
         return this.SourceToGraphicalMeasureLinks[sourceMeasure];
     }
     }
+
     public GetGraphicalFromSourceStaffEntry(sourceStaffEntry: SourceStaffEntry): GraphicalStaffEntry {
     public GetGraphicalFromSourceStaffEntry(sourceStaffEntry: SourceStaffEntry): GraphicalStaffEntry {
-        let graphicalMeasure: StaffMeasure = this.SourceToGraphicalMeasureLinks[sourceStaffEntry.VerticalContainerParent.ParentMeasure][sourceStaffEntry.ParentStaff.IdInMusicSheet];
+        let graphicalMeasure: StaffMeasure = this.SourceToGraphicalMeasureLinks
+            [sourceStaffEntry.VerticalContainerParent.ParentMeasure][sourceStaffEntry.ParentStaff.idInMusicSheet];
         return graphicalMeasure.findGraphicalStaffEntryFromTimestamp(sourceStaffEntry.Timestamp);
         return graphicalMeasure.findGraphicalStaffEntryFromTimestamp(sourceStaffEntry.Timestamp);
     }
     }
+
     public GetGraphicalFromSourceStaffEntry(voiceEntries: VoiceEntry[]): GraphicalStaffEntry {
     public GetGraphicalFromSourceStaffEntry(voiceEntries: VoiceEntry[]): GraphicalStaffEntry {
-        if (voiceEntries.length === 0)
+        if (voiceEntries.length === 0) {
             return undefined;
             return undefined;
+        }
         let sse: SourceStaffEntry = voiceEntries[0].ParentSourceStaffEntry;
         let sse: SourceStaffEntry = voiceEntries[0].ParentSourceStaffEntry;
-        let graphicalMeasure: StaffMeasure = this.SourceToGraphicalMeasureLinks[sse.VerticalContainerParent.ParentMeasure][sse.ParentStaff.IdInMusicSheet];
+        let graphicalMeasure: StaffMeasure = this.SourceToGraphicalMeasureLinks[sse.VerticalContainerParent.ParentMeasure][sse.ParentStaff.idInMusicSheet];
         return graphicalMeasure.findGraphicalStaffEntryFromTimestamp(sse.Timestamp);
         return graphicalMeasure.findGraphicalStaffEntryFromTimestamp(sse.Timestamp);
     }
     }
+
     public GetGraphicalNoteFromSourceNote(note: Note, containingGse: GraphicalStaffEntry): GraphicalNote {
     public GetGraphicalNoteFromSourceNote(note: Note, containingGse: GraphicalStaffEntry): GraphicalNote {
         for (let idx: number = 0, len: number = containingGse.Notes.length; idx < len; ++idx) {
         for (let idx: number = 0, len: number = containingGse.Notes.length; idx < len; ++idx) {
             let graphicalNotes: GraphicalNote[] = containingGse.Notes[idx];
             let graphicalNotes: GraphicalNote[] = containingGse.Notes[idx];
             for (let idx2: number = 0, len2: number = graphicalNotes.length; idx2 < len2; ++idx2) {
             for (let idx2: number = 0, len2: number = graphicalNotes.length; idx2 < len2; ++idx2) {
                 let graphicalNote: GraphicalNote = graphicalNotes[idx2];
                 let graphicalNote: GraphicalNote = graphicalNotes[idx2];
-                if (graphicalNote.SourceNote === note)
+                if (graphicalNote.SourceNote === note) {
                     return graphicalNote;
                     return graphicalNote;
+                }
             }
             }
         }
         }
         return undefined;
         return undefined;
     }
     }
 }
 }
 export class SystemImageProperties {
 export class SystemImageProperties {
-    public PositionInPixels: PointF_2D;
-    public SystemImageId: number;
-    public System: MusicSystem;
-}
+    public positionInPixels: PointF2D;
+    public systemImageId: number;
+    public system: MusicSystem;
+}

+ 17 - 17
src/MusicalScore/Graphical/MusicSheetCalculator.ts

@@ -27,7 +27,7 @@ import {StaffEntryLink} from "../VoiceData/StaffEntryLink";
 import {MusicSystemBuilder} from "./MusicSystemBuilder";
 import {MusicSystemBuilder} from "./MusicSystemBuilder";
 import {MultiTempoExpression} from "../VoiceData/Expressions/multiTempoExpression";
 import {MultiTempoExpression} from "../VoiceData/Expressions/multiTempoExpression";
 import {Repetition} from "../MusicSource/Repetition";
 import {Repetition} from "../MusicSource/Repetition";
-import {PointF_2D} from "../../Common/DataObjects/PointF_2D";
+import {PointF2D} from "../../Common/DataObjects/PointF2D";
 import {SourceStaffEntry} from "../VoiceData/SourceStaffEntry";
 import {SourceStaffEntry} from "../VoiceData/SourceStaffEntry";
 import {BoundingBox} from "./BoundingBox";
 import {BoundingBox} from "./BoundingBox";
 import {Instrument} from "../Instrument";
 import {Instrument} from "../Instrument";
@@ -255,7 +255,7 @@ export class MusicSheetCalculator {
                 let distance: number = graphicalMusicPage.MusicSystems[0].PositionAndShape.BorderTop;
                 let distance: number = graphicalMusicPage.MusicSystems[0].PositionAndShape.BorderTop;
                 for (let idx2: number = 0, len2: number = graphicalMusicPage.MusicSystems.length; idx2 < len2; ++idx2) {
                 for (let idx2: number = 0, len2: number = graphicalMusicPage.MusicSystems.length; idx2 < len2; ++idx2) {
                     let musicSystem: MusicSystem = graphicalMusicPage.MusicSystems[idx2];
                     let musicSystem: MusicSystem = graphicalMusicPage.MusicSystems[idx2];
-                    let newPosition: PointF_2D = new PointF_2D(musicSystem.PositionAndShape.RelativePosition.X, musicSystem.PositionAndShape.RelativePosition.Y - distance);
+                    let newPosition: PointF2D = new PointF2D(musicSystem.PositionAndShape.RelativePosition.X, musicSystem.PositionAndShape.RelativePosition.Y - distance);
                     musicSystem.PositionAndShape.RelativePosition = newPosition;
                     musicSystem.PositionAndShape.RelativePosition = newPosition;
                 }
                 }
                 if (graphicalMusicPage === this.graphicalMusicSheet.MusicPages[0])
                 if (graphicalMusicPage === this.graphicalMusicSheet.MusicPages[0])
@@ -310,7 +310,7 @@ export class MusicSheetCalculator {
 
 
     }
     }
     protected layoutFingering(staffLine: StaffLine, skyBottomLineCalculator: SkyBottomLineCalculator,
     protected layoutFingering(staffLine: StaffLine, skyBottomLineCalculator: SkyBottomLineCalculator,
-        staffEntry: GraphicalStaffEntry, measureRelativePosition: PointF_2D): void {
+        staffEntry: GraphicalStaffEntry, measureRelativePosition: PointF2D): void {
 
 
     }
     }
     protected calculateDynamicExpressionsForSingleMultiExpression(multiExpression: MultiExpression, measureIndex: number, staffIndex: number): void {
     protected calculateDynamicExpressionsForSingleMultiExpression(multiExpression: MultiExpression, measureIndex: number, staffIndex: number): void {
@@ -469,11 +469,11 @@ export class MusicSheetCalculator {
     }
     }
     protected resetYPositionForLeadSheet(psi: BoundingBox): void {
     protected resetYPositionForLeadSheet(psi: BoundingBox): void {
         if (this.leadSheet) {
         if (this.leadSheet) {
-            psi.RelativePosition = new PointF_2D(psi.RelativePosition.X, 0.0);
+            psi.RelativePosition = new PointF2D(psi.RelativePosition.X, 0.0);
         }
         }
     }
     }
     protected layoutVoiceEntries(graphicalStaffEntry: GraphicalStaffEntry): void {
     protected layoutVoiceEntries(graphicalStaffEntry: GraphicalStaffEntry): void {
-        graphicalStaffEntry.PositionAndShape.RelativePosition = new PointF_2D(0.0, 0.0);
+        graphicalStaffEntry.PositionAndShape.RelativePosition = new PointF2D(0.0, 0.0);
         let isGraceStaffEntry: boolean = graphicalStaffEntry.StaffEntryParent !== undefined;
         let isGraceStaffEntry: boolean = graphicalStaffEntry.StaffEntryParent !== undefined;
         if (!this.leadSheet) {
         if (!this.leadSheet) {
             let graphicalStaffEntryNotes: GraphicalNote[][] = graphicalStaffEntry.Notes.Where(n => n.length > 0);
             let graphicalStaffEntryNotes: GraphicalNote[][] = graphicalStaffEntry.Notes.Where(n => n.length > 0);
@@ -582,8 +582,8 @@ export class MusicSheetCalculator {
         }
         }
     }
     }
     protected getRelativePositionInStaffLineFromTimestamp(timestamp: Fraction, verticalIndex: number, staffLine: StaffLine,
     protected getRelativePositionInStaffLineFromTimestamp(timestamp: Fraction, verticalIndex: number, staffLine: StaffLine,
-        multiStaffInstrument: boolean, firstVisibleMeasureRelativeX: number = 0.0): PointF_2D {
-        let relative: PointF_2D = new PointF_2D();
+        multiStaffInstrument: boolean, firstVisibleMeasureRelativeX: number = 0.0): PointF2D {
+        let relative: PointF2D = new PointF2D();
         let leftStaffEntry: GraphicalStaffEntry = undefined;
         let leftStaffEntry: GraphicalStaffEntry = undefined;
         let rightStaffEntry: GraphicalStaffEntry = undefined;
         let rightStaffEntry: GraphicalStaffEntry = undefined;
         let numEntries: number = this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length;
         let numEntries: number = this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length;
@@ -614,7 +614,7 @@ export class MusicSheetCalculator {
                     rightX = staffLine.PositionAndShape.Size.Width;
                     rightX = staffLine.PositionAndShape.Size.Width;
                 else leftX = staffLine.PositionAndShape.RelativePosition.X;
                 else leftX = staffLine.PositionAndShape.RelativePosition.X;
             }
             }
-            relative = new PointF_2D(leftX + (rightX - leftX) * timestampQuotient, 0.0);
+            relative = new PointF2D(leftX + (rightX - leftX) * timestampQuotient, 0.0);
         }
         }
         return relative;
         return relative;
     }
     }
@@ -794,7 +794,7 @@ export class MusicSheetCalculator {
         return measure;
         return measure;
     }
     }
     private calculatePageLabels(page: GraphicalMusicPage): void {
     private calculatePageLabels(page: GraphicalMusicPage): void {
-        let relative: PointF_2D = new PointF_2D();
+        let relative: PointF2D = new PointF2D();
         let firstSystemAbsoluteTopMargin: number = 10;
         let firstSystemAbsoluteTopMargin: number = 10;
         if (page.MusicSystems.length > 0) {
         if (page.MusicSystems.length > 0) {
             let firstMusicSystem: MusicSystem = page.MusicSystems[0];
             let firstMusicSystem: MusicSystem = page.MusicSystems[0];
@@ -1019,11 +1019,11 @@ export class MusicSheetCalculator {
     private calculateTwoRestNotesPlacementWithCollisionDetection(graphicalStaffEntry: GraphicalStaffEntry): void {
     private calculateTwoRestNotesPlacementWithCollisionDetection(graphicalStaffEntry: GraphicalStaffEntry): void {
         let firstRestNote: GraphicalNote = graphicalStaffEntry.Notes[0][0];
         let firstRestNote: GraphicalNote = graphicalStaffEntry.Notes[0][0];
         let secondRestNote: GraphicalNote = graphicalStaffEntry.Notes[1][0];
         let secondRestNote: GraphicalNote = graphicalStaffEntry.Notes[1][0];
-        secondRestNote.PositionAndShape.RelativePosition = new PointF_2D(0.0, 2.5);
+        secondRestNote.PositionAndShape.RelativePosition = new PointF2D(0.0, 2.5);
         graphicalStaffEntry.PositionAndShape.calculateAbsolutePositionsRecursiveWithoutTopelement();
         graphicalStaffEntry.PositionAndShape.calculateAbsolutePositionsRecursiveWithoutTopelement();
         firstRestNote.PositionAndShape.computeNonOverlappingPositionWithMargin(graphicalStaffEntry.PositionAndShape, ColDirEnum.Up,
         firstRestNote.PositionAndShape.computeNonOverlappingPositionWithMargin(graphicalStaffEntry.PositionAndShape, ColDirEnum.Up,
-            new PointF_2D(0.0, secondRestNote.PositionAndShape.RelativePosition.Y));
-        let relative: PointF_2D = firstRestNote.PositionAndShape.RelativePosition;
+            new PointF2D(0.0, secondRestNote.PositionAndShape.RelativePosition.Y));
+        let relative: PointF2D = firstRestNote.PositionAndShape.RelativePosition;
         relative.Y -= 1.0;
         relative.Y -= 1.0;
         firstRestNote.PositionAndShape.RelativePosition = relative;
         firstRestNote.PositionAndShape.RelativePosition = relative;
         graphicalStaffEntry.PositionAndShape.calculateBoundingBox();
         graphicalStaffEntry.PositionAndShape.calculateBoundingBox();
@@ -1050,17 +1050,17 @@ export class MusicSheetCalculator {
         if (collision) {
         if (collision) {
             if (restNote.SourceNote.ParentVoiceEntry.ParentVoice instanceof LinkedVoice) {
             if (restNote.SourceNote.ParentVoiceEntry.ParentVoice instanceof LinkedVoice) {
                 let bottomBorder: number = graphicalNotes[0].PositionAndShape.BorderMarginBottom + graphicalNotes[0].PositionAndShape.RelativePosition.Y;
                 let bottomBorder: number = graphicalNotes[0].PositionAndShape.BorderMarginBottom + graphicalNotes[0].PositionAndShape.RelativePosition.Y;
-                restNote.PositionAndShape.RelativePosition = new PointF_2D(0.0, bottomBorder - restNote.PositionAndShape.BorderMarginTop + 0.5);
+                restNote.PositionAndShape.RelativePosition = new PointF2D(0.0, bottomBorder - restNote.PositionAndShape.BorderMarginTop + 0.5);
             } else {
             } else {
                 if (graphicalNotes[0].SourceNote.ParentVoiceEntry.ParentVoice instanceof LinkedVoice) {
                 if (graphicalNotes[0].SourceNote.ParentVoiceEntry.ParentVoice instanceof LinkedVoice) {
                     let topBorder: number = graphicalNotes.Last().PositionAndShape.BorderMarginTop + graphicalNotes.Last().PositionAndShape.RelativePosition.Y;
                     let topBorder: number = graphicalNotes.Last().PositionAndShape.BorderMarginTop + graphicalNotes.Last().PositionAndShape.RelativePosition.Y;
-                    restNote.PositionAndShape.RelativePosition = new PointF_2D(0.0, topBorder - restNote.PositionAndShape.BorderMarginBottom - 0.5);
+                    restNote.PositionAndShape.RelativePosition = new PointF2D(0.0, topBorder - restNote.PositionAndShape.BorderMarginBottom - 0.5);
                 } else {
                 } else {
                     let topBorder: number = graphicalNotes.Last().PositionAndShape.BorderMarginTop + graphicalNotes.Last().PositionAndShape.RelativePosition.Y;
                     let topBorder: number = graphicalNotes.Last().PositionAndShape.BorderMarginTop + graphicalNotes.Last().PositionAndShape.RelativePosition.Y;
                     let bottomBorder: number = graphicalNotes[0].PositionAndShape.BorderMarginBottom + graphicalNotes[0].PositionAndShape.RelativePosition.Y;
                     let bottomBorder: number = graphicalNotes[0].PositionAndShape.BorderMarginBottom + graphicalNotes[0].PositionAndShape.RelativePosition.Y;
                     if (bottomBorder < 2.0)
                     if (bottomBorder < 2.0)
-                    restNote.PositionAndShape.RelativePosition = new PointF_2D(0.0, bottomBorder - restNote.PositionAndShape.BorderMarginTop + 0.5);
- else restNote.PositionAndShape.RelativePosition = new PointF_2D(0.0, topBorder - restNote.PositionAndShape.BorderMarginBottom - 0.0);
+                    restNote.PositionAndShape.RelativePosition = new PointF2D(0.0, bottomBorder - restNote.PositionAndShape.BorderMarginTop + 0.5);
+ else restNote.PositionAndShape.RelativePosition = new PointF2D(0.0, topBorder - restNote.PositionAndShape.BorderMarginBottom - 0.0);
                 }
                 }
             }
             }
         }
         }
@@ -1101,7 +1101,7 @@ export class MusicSheetCalculator {
                     let skyBottomLineCalculator: SkyBottomLineCalculator = new SkyBottomLineCalculator(this.rules);
                     let skyBottomLineCalculator: SkyBottomLineCalculator = new SkyBottomLineCalculator(this.rules);
                     for (let idx4: number = 0, len4: number = staffLine.Measures.length; idx4 < len4; ++idx4) {
                     for (let idx4: number = 0, len4: number = staffLine.Measures.length; idx4 < len4; ++idx4) {
                         let measure: StaffMeasure = staffLine.Measures[idx4];
                         let measure: StaffMeasure = staffLine.Measures[idx4];
-                        let measureRelativePosition: PointF_2D = measure.PositionAndShape.RelativePosition;
+                        let measureRelativePosition: PointF2D = measure.PositionAndShape.RelativePosition;
                         for (let idx5: number = 0, len5: number = measure.StaffEntries.length; idx5 < len5; ++idx5) {
                         for (let idx5: number = 0, len5: number = measure.StaffEntries.length; idx5 < len5; ++idx5) {
                             let staffEntry: GraphicalStaffEntry = measure.StaffEntries[idx5];
                             let staffEntry: GraphicalStaffEntry = measure.StaffEntries[idx5];
                             let hasTechnicalInstruction: boolean = false;
                             let hasTechnicalInstruction: boolean = false;

+ 25 - 24
src/MusicalScore/Graphical/MusicSystem.ts

@@ -10,8 +10,9 @@ import {GraphicalLabel} from "./GraphicalLabel";
 import {StaffMeasure} from "./StaffMeasure";
 import {StaffMeasure} from "./StaffMeasure";
 import {GraphicalObject} from "./GraphicalObject";
 import {GraphicalObject} from "./GraphicalObject";
 import {EngravingRules} from "./EngravingRules";
 import {EngravingRules} from "./EngravingRules";
-import {PointF_2D} from "../../Common/DataObjects/PointF_2D";
+import {PointF2D} from "../../Common/DataObjects/PointF2D";
 import {GraphicalStaffEntry} from "./GraphicalStaffEntry";
 import {GraphicalStaffEntry} from "./GraphicalStaffEntry";
+
 export class MusicSystem extends GraphicalObject {
 export class MusicSystem extends GraphicalObject {
     public NeedsToBeRedrawn: boolean = true;
     public NeedsToBeRedrawn: boolean = true;
     protected parent: GraphicalMusicPage;
     protected parent: GraphicalMusicPage;
@@ -63,10 +64,10 @@ export class MusicSystem extends GraphicalObject {
 
 
     }
     }
     public GetLeftBorderAbsoluteXPosition(): number {
     public GetLeftBorderAbsoluteXPosition(): number {
-        return this.StaffLines[0].PositionAndShape.AbsolutePosition.X + this.StaffLines[0].Measures[0].BeginInstructionsWidth;
+        return this.StaffLines[0].PositionAndShape.AbsolutePosition.x + this.StaffLines[0].Measures[0].BeginInstructionsWidth;
     }
     }
     public GetRightBorderAbsoluteXPosition(): number {
     public GetRightBorderAbsoluteXPosition(): number {
-        return this.StaffLines[0].PositionAndShape.AbsolutePosition.X + this.StaffLines[0].StaffLines[0].End.X;
+        return this.StaffLines[0].PositionAndShape.AbsolutePosition.x + this.StaffLines[0].StaffLines[0].End.x;
     }
     }
     public AddStaffMeasures(graphicalMeasures: StaffMeasure[]): void {
     public AddStaffMeasures(graphicalMeasures: StaffMeasure[]): void {
         for (let idx: number = 0, len: number = graphicalMeasures.length; idx < len; ++idx) {
         for (let idx: number = 0, len: number = graphicalMeasures.length; idx < len; ++idx) {
@@ -95,10 +96,10 @@ export class MusicSystem extends GraphicalObject {
                         lastStaffLine = staffLine;
                         lastStaffLine = staffLine;
                 }
                 }
                 if (firstStaffLine !== undefined && lastStaffLine !== undefined) {
                 if (firstStaffLine !== undefined && lastStaffLine !== undefined) {
-                    let rightUpper: PointF_2D = new PointF_2D(firstStaffLine.PositionAndShape.RelativePosition.X,
-                        firstStaffLine.PositionAndShape.RelativePosition.Y);
-                    let rightLower: PointF_2D = new PointF_2D(lastStaffLine.PositionAndShape.RelativePosition.X,
-                        lastStaffLine.PositionAndShape.RelativePosition.Y + staffHeight);
+                    let rightUpper: PointF2D = new PointF2D(firstStaffLine.PositionAndShape.RelativePosition.x,
+                        firstStaffLine.PositionAndShape.RelativePosition.y);
+                    let rightLower: PointF2D = new PointF2D(lastStaffLine.PositionAndShape.RelativePosition.x,
+                        lastStaffLine.PositionAndShape.RelativePosition.y + staffHeight);
                     this.createInstrumentBracket(rightUpper, rightLower);
                     this.createInstrumentBracket(rightUpper, rightLower);
                 }
                 }
             }
             }
@@ -122,10 +123,10 @@ export class MusicSystem extends GraphicalObject {
                     lastStaffLine = staffLine;
                     lastStaffLine = staffLine;
             }
             }
             if (firstStaffLine !== undefined && lastStaffLine !== undefined) {
             if (firstStaffLine !== undefined && lastStaffLine !== undefined) {
-                let rightUpper: PointF_2D = new PointF_2D(firstStaffLine.PositionAndShape.RelativePosition.X,
-                    firstStaffLine.PositionAndShape.RelativePosition.Y);
-                let rightLower: PointF_2D = new PointF_2D(lastStaffLine.PositionAndShape.RelativePosition.X,
-                    lastStaffLine.PositionAndShape.RelativePosition.Y + staffHeight);
+                let rightUpper: PointF2D = new PointF2D(firstStaffLine.PositionAndShape.RelativePosition.x,
+                    firstStaffLine.PositionAndShape.RelativePosition.y);
+                let rightLower: PointF2D = new PointF2D(lastStaffLine.PositionAndShape.RelativePosition.x,
+                    lastStaffLine.PositionAndShape.RelativePosition.y + staffHeight);
                 this.createGroupBracket(rightUpper, rightLower, staffHeight, recursionDepth);
                 this.createGroupBracket(rightUpper, rightLower, staffHeight, recursionDepth);
             }
             }
             if (instrumentGroup.InstrumentalGroups.length < 1)
             if (instrumentGroup.InstrumentalGroups.length < 1)
@@ -142,14 +143,14 @@ export class MusicSystem extends GraphicalObject {
                 graphicalLabel.setLabelPositionAndShapeBorders();
                 graphicalLabel.setLabelPositionAndShapeBorders();
                 this.labels.push(graphicalLabel, instrument);
                 this.labels.push(graphicalLabel, instrument);
                 this.boundingBox.ChildElements.push(graphicalLabel.PositionAndShape);
                 this.boundingBox.ChildElements.push(graphicalLabel.PositionAndShape);
-                graphicalLabel.PositionAndShape.RelativePosition = new PointF_2D(0.0, 0.0);
+                graphicalLabel.PositionAndShape.RelativePosition = new PointF2D(0.0, 0.0);
             }
             }
             this.maxLabelLength = 0.0;
             this.maxLabelLength = 0.0;
             let labels: GraphicalLabel[] = this.labels.Keys;
             let labels: GraphicalLabel[] = this.labels.Keys;
             for (let idx: number = 0, len: number = labels.length; idx < len; ++idx) {
             for (let idx: number = 0, len: number = labels.length; idx < len; ++idx) {
                 let label: GraphicalLabel = labels[idx];
                 let label: GraphicalLabel = labels[idx];
-                if (label.PositionAndShape.Size.Width > this.maxLabelLength)
-                    this.maxLabelLength = label.PositionAndShape.Size.Width;
+                if (label.PositionAndShape.Size.width > this.maxLabelLength)
+                    this.maxLabelLength = label.PositionAndShape.Size.width;
             }
             }
             this.updateMusicSystemStaffLineXPosition(systemLabelsRightMargin);
             this.updateMusicSystemStaffLineXPosition(systemLabelsRightMargin);
         }
         }
@@ -167,14 +168,14 @@ export class MusicSystem extends GraphicalObject {
                             let staffLine: StaffLine = this.staffLines[j];
                             let staffLine: StaffLine = this.staffLines[j];
                             if (staffLine.ParentStaff.ParentInstrument !== entry.Value)
                             if (staffLine.ParentStaff.ParentInstrument !== entry.Value)
                                 break;
                                 break;
-                            ypositionSum += staffLine.PositionAndShape.RelativePosition.Y;
+                            ypositionSum += staffLine.PositionAndShape.RelativePosition.y;
                             staffCounter++;
                             staffCounter++;
                         }
                         }
                         break;
                         break;
                     }
                     }
                 }
                 }
                 if (staffCounter > 0)
                 if (staffCounter > 0)
-                    entry.Key.PositionAndShape.RelativePosition = new PointF_2D(0.0, ypositionSum / staffCounter + 2.0);
+                    entry.Key.PositionAndShape.RelativePosition = new PointF2D(0.0, ypositionSum / staffCounter + 2.0);
             }
             }
         }
         }
     }
     }
@@ -204,8 +205,8 @@ export class MusicSystem extends GraphicalObject {
         return false;
         return false;
     }
     }
     protected calcInstrumentsBracketsWidth(): number { throw new Error('not implemented'); }
     protected calcInstrumentsBracketsWidth(): number { throw new Error('not implemented'); }
-    protected createInstrumentBracket(rightUpper: PointF_2D, rightLower: PointF_2D): void { throw new Error('not implemented'); }
-    protected createGroupBracket(rightUpper: PointF_2D, rightLower: PointF_2D, staffHeight: number,
+    protected createInstrumentBracket(rightUpper: PointF2D, rightLower: PointF2D): void { throw new Error('not implemented'); }
+    protected createGroupBracket(rightUpper: PointF2D, rightLower: PointF2D, staffHeight: number,
         recursionDepth: number): void { throw new Error('not implemented'); }
         recursionDepth: number): void { throw new Error('not implemented'); }
     private findFirstVisibleInstrumentInInstrumentalGroup(instrumentalGroup: InstrumentalGroup): Instrument {
     private findFirstVisibleInstrumentInInstrumentalGroup(instrumentalGroup: InstrumentalGroup): Instrument {
         for (let idx: number = 0, len: number = instrumentalGroup.InstrumentalGroups.length; idx < len; ++idx) {
         for (let idx: number = 0, len: number = instrumentalGroup.InstrumentalGroups.length; idx < len; ++idx) {
@@ -235,14 +236,14 @@ export class MusicSystem extends GraphicalObject {
     private updateMusicSystemStaffLineXPosition(systemLabelsRightMargin: number): void {
     private updateMusicSystemStaffLineXPosition(systemLabelsRightMargin: number): void {
         for (let idx: number = 0, len: number = this.StaffLines.length; idx < len; ++idx) {
         for (let idx: number = 0, len: number = this.StaffLines.length; idx < len; ++idx) {
             let staffLine: StaffLine = this.StaffLines[idx];
             let staffLine: StaffLine = this.StaffLines[idx];
-            let relative: PointF_2D = staffLine.PositionAndShape.RelativePosition;
-            relative.X = this.maxLabelLength + systemLabelsRightMargin;
+            let relative: PointF2D = staffLine.PositionAndShape.RelativePosition;
+            relative.x = this.maxLabelLength + systemLabelsRightMargin;
             staffLine.PositionAndShape.RelativePosition = relative;
             staffLine.PositionAndShape.RelativePosition = relative;
-            staffLine.PositionAndShape.BorderRight = this.boundingBox.Size.Width - this.maxLabelLength - systemLabelsRightMargin;
-            for (let i: number = 0; i < staffLine.StaffLines.Length; i++) {
-                let lineEnd: PointF_2D = new PointF_2D(staffLine.PositionAndShape.Size.Width, staffLine.StaffLines[i].End.Y);
+            staffLine.PositionAndShape.BorderRight = this.boundingBox.Size.width - this.maxLabelLength - systemLabelsRightMargin;
+            for (let i: number = 0; i < staffLine.StaffLines.length; i++) {
+                let lineEnd: PointF2D = new PointF2D(staffLine.PositionAndShape.Size.width, staffLine.StaffLines[i].End.y);
                 staffLine.StaffLines[i].End = lineEnd;
                 staffLine.StaffLines[i].End = lineEnd;
             }
             }
         }
         }
     }
     }
-}
+}

+ 7 - 7
src/MusicalScore/Graphical/MusicSystemBuilder.ts

@@ -10,7 +10,7 @@ import {BoundingBox} from "./BoundingBox";
 import {Staff} from "../VoiceData/Staff";
 import {Staff} from "../VoiceData/Staff";
 import {MusicSheet} from "../MusicSheet";
 import {MusicSheet} from "../MusicSheet";
 import {Instrument} from "../Instrument";
 import {Instrument} from "../Instrument";
-import {PointF_2D} from "../../Common/DataObjects/PointF_2D";
+import {PointF2D} from "../../Common/DataObjects/PointF2D";
 import {StaffLine} from "./StaffLine";
 import {StaffLine} from "./StaffLine";
 import {GraphicalLine} from "./GraphicalLine";
 import {GraphicalLine} from "./GraphicalLine";
 import {SourceStaffEntry} from "../VoiceData/SourceStaffEntry";
 import {SourceStaffEntry} from "../VoiceData/SourceStaffEntry";
@@ -167,7 +167,7 @@ export class MusicSystemBuilder {
         page.PositionAndShape.BorderRight = this.graphicalMusicSheet.ParentMusicSheet.PageWidth;
         page.PositionAndShape.BorderRight = this.graphicalMusicSheet.ParentMusicSheet.PageWidth;
         page.PositionAndShape.BorderTop = 0.0;
         page.PositionAndShape.BorderTop = 0.0;
         page.PositionAndShape.BorderBottom = this.rules.PageHeight;
         page.PositionAndShape.BorderBottom = this.rules.PageHeight;
-        page.PositionAndShape.RelativePosition = new PointF_2D(0.0, 0.0);
+        page.PositionAndShape.RelativePosition = new PointF2D(0.0, 0.0);
         return page;
         return page;
     }
     }
     private initMusicSystem(): MusicSystem {
     private initMusicSystem(): MusicSystem {
@@ -231,7 +231,7 @@ export class MusicSystemBuilder {
             musicSystem.StaffLines.push(staffLine);
             musicSystem.StaffLines.push(staffLine);
             let boundingBox: BoundingBox = staffLine.PositionAndShape;
             let boundingBox: BoundingBox = staffLine.PositionAndShape;
             musicSystem.PositionAndShape.ChildElements.push(boundingBox);
             musicSystem.PositionAndShape.ChildElements.push(boundingBox);
-            let relativePosition: PointF_2D = new PointF_2D();
+            let relativePosition: PointF2D = new PointF2D();
             if (musicSystem.Parent.MusicSystems[0] === musicSystem && musicSystem.Parent === musicSystem.Parent.Parent.MusicPages[0])
             if (musicSystem.Parent.MusicSystems[0] === musicSystem && musicSystem.Parent === musicSystem.Parent.Parent.MusicPages[0])
                 relativePosition.X = this.rules.FirstSystemMargin;
                 relativePosition.X = this.rules.FirstSystemMargin;
             else relativePosition.X = 0.0;
             else relativePosition.X = 0.0;
@@ -244,10 +244,10 @@ export class MusicSystemBuilder {
             boundingBox.BorderTop = 0.0;
             boundingBox.BorderTop = 0.0;
             boundingBox.BorderBottom = this.rules.StaffHeight;
             boundingBox.BorderBottom = this.rules.StaffHeight;
             for (let i: number = 0; i < 5; i++) {
             for (let i: number = 0; i < 5; i++) {
-                let start: PointF_2D = new PointF_2D();
+                let start: PointF2D = new PointF2D();
                 start.X = 0.0;
                 start.X = 0.0;
                 start.Y = i * this.rules.StaffHeight / 4;
                 start.Y = i * this.rules.StaffHeight / 4;
-                let end: PointF_2D = new PointF_2D();
+                let end: PointF2D = new PointF2D();
                 end.X = staffLine.PositionAndShape.Size.Width;
                 end.X = staffLine.PositionAndShape.Size.Width;
                 end.Y = i * this.rules.StaffHeight / 4;
                 end.Y = i * this.rules.StaffHeight / 4;
                 if (this.leadSheet)
                 if (this.leadSheet)
@@ -421,7 +421,7 @@ export class MusicSystemBuilder {
         let visibleInstructionEntries: SourceStaffEntry[] = [];
         let visibleInstructionEntries: SourceStaffEntry[] = [];
         for (let idx: number = 0, len: number = measures.length; idx < len; ++idx) {
         for (let idx: number = 0, len: number = measures.length; idx < len; ++idx) {
             let measure: StaffMeasure = measures[idx];
             let measure: StaffMeasure = measures[idx];
-            visibleInstructionEntries.push(firstStaffEntries[measure.ParentStaff.IdInMusicSheet]);
+            visibleInstructionEntries.push(firstStaffEntries[measure.ParentStaff.idInMusicSheet]);
         }
         }
         let maxMeasureWidth: number = 0;
         let maxMeasureWidth: number = 0;
         for (let visStaffIdx: number = 0, len: number = visibleInstructionEntries.length; visStaffIdx < len; ++visStaffIdx) {
         for (let visStaffIdx: number = 0, len: number = visibleInstructionEntries.length; visStaffIdx < len; ++visStaffIdx) {
@@ -657,7 +657,7 @@ export class MusicSystemBuilder {
             staffLine.PositionAndShape.BorderRight = width;
             staffLine.PositionAndShape.BorderRight = width;
             for (let idx2: number = 0, len2: number = staffLine.StaffLines.Length; idx2 < len2; ++idx2) {
             for (let idx2: number = 0, len2: number = staffLine.StaffLines.Length; idx2 < len2; ++idx2) {
                 let graphicalLine: GraphicalLine = staffLine.StaffLines[idx2];
                 let graphicalLine: GraphicalLine = staffLine.StaffLines[idx2];
-                graphicalLine.End = new PointF_2D(width, graphicalLine.End.Y);
+                graphicalLine.End = new PointF2D(width, graphicalLine.End.Y);
             }
             }
         }
         }
         currentSystem.PositionAndShape.BorderRight = width + this.currentSystemParams.MaxLabelLength + this.rules.SystemLabelsRightMargin;
         currentSystem.PositionAndShape.BorderRight = width + this.currentSystemParams.MaxLabelLength + this.rules.SystemLabelsRightMargin;

+ 3 - 5
src/MusicalScore/MusicSheet.ts

@@ -12,6 +12,7 @@ import {VerticalSourceStaffEntryContainer} from "./VoiceData/VerticalSourceStaff
 import {Voice} from "./VoiceData/Voice";
 import {Voice} from "./VoiceData/Voice";
 import {MusicSheetErrors} from "../Common/DataObjects/MusicSheetErrors";
 import {MusicSheetErrors} from "../Common/DataObjects/MusicSheetErrors";
 import {MultiTempoExpression} from "./VoiceData/Expressions/multiTempoExpression";
 import {MultiTempoExpression} from "./VoiceData/Expressions/multiTempoExpression";
+import {EngravingRules} from "./Graphical/EngravingRules";
 
 
 // FIXME
 // FIXME
 //type MusicSheetParameters = any;
 //type MusicSheetParameters = any;
@@ -34,11 +35,7 @@ export class PlaybackSettings {
 
 
 export class MusicSheet /*implements ISettableMusicSheet, IComparable<MusicSheet>*/ {
 export class MusicSheet /*implements ISettableMusicSheet, IComparable<MusicSheet>*/ {
     constructor() {
     constructor() {
-        // (*) try {
-        //    this.Rules = EngravingRules.Rules;
-        // } catch (ex) {
-        //     console.log("MusicSheet Error: EngravingRules");
-        // }
+        this.rules = EngravingRules.Rules;
         // (*) this.playbackSettings = new PlaybackSettings(new Fraction(4, 4, false), 100);
         // (*) this.playbackSettings = new PlaybackSettings(new Fraction(4, 4, false), 100);
         this.userStartTempoInBPM = 100;
         this.userStartTempoInBPM = 100;
         this.pageWidth = 120;
         this.pageWidth = 120;
@@ -48,6 +45,7 @@ export class MusicSheet /*implements ISettableMusicSheet, IComparable<MusicSheet
 
 
     public userStartTempoInBPM: number;
     public userStartTempoInBPM: number;
     public pageWidth: number;
     public pageWidth: number;
+    public rules: EngravingRules;
 
 
     //private idString: string = "kjgdfuilhsda�oihfsvjh";
     //private idString: string = "kjgdfuilhsda�oihfsvjh";
     private sourceMeasures: SourceMeasure[] = [];
     private sourceMeasures: SourceMeasure[] = [];