Преглед на файлове

Made classes abstract.
Added more graphical classes. Extended system with members.

Matthias преди 9 години
родител
ревизия
7729cf543d

+ 1 - 1
src/MusicalScore/Graphical/AbstractGraphicalInstruction.ts

@@ -1,7 +1,7 @@
 import {GraphicalStaffEntry} from "./GraphicalStaffEntry";
 import {GraphicalObject} from "./GraphicalObject";
 
-export class AbstractGraphicalInstruction extends GraphicalObject {
+export abstract class AbstractGraphicalInstruction extends GraphicalObject {
     protected parent: GraphicalStaffEntry;
     constructor(parent: GraphicalStaffEntry) {
         super();

+ 9 - 0
src/MusicalScore/Graphical/GraphicalComment.ts

@@ -0,0 +1,9 @@
+import {GraphicalLabel} from "./GraphicalLabel";
+export class GraphicalComment {
+    constructor(label: GraphicalLabel, settingsLabel: GraphicalLabel) {
+        this.label = label;
+        this.settings = settingsLabel;
+    }
+    public label: GraphicalLabel;
+    public settings: GraphicalLabel;
+}

+ 12 - 0
src/MusicalScore/Graphical/GraphicalMarkedArea.ts

@@ -0,0 +1,12 @@
+export class GraphicalMarkedArea {
+    constructor(systemRectangle: GraphicalRectangle, labelRectangle: GraphicalRectangle = null, label: GraphicalLabel = null, settingsLabel: GraphicalLabel = null) {
+        this.systemRectangle = systemRectangle;
+        this.labelRectangle = labelRectangle;
+        this.label = label;
+        this.settings = settingsLabel;
+    }
+    public systemRectangle: GraphicalRectangle;
+    public labelRectangle: GraphicalRectangle;
+    public label: GraphicalLabel;
+    public settings: GraphicalLabel;
+}

+ 1 - 1
src/MusicalScore/Graphical/GraphicalNote.ts

@@ -9,7 +9,7 @@ import {GraphicalObject} from "./GraphicalObject";
 import {MusicSheetCalculator} from "./MusicSheetCalculator";
 import {BoundingBox} from "./BoundingBox";
 
-export class GraphicalNote extends GraphicalObject {
+export abstract class GraphicalNote extends GraphicalObject {
     constructor(note: Note, parent: GraphicalStaffEntry) {
         super();
         this.sourceNote = note;

+ 1 - 1
src/MusicalScore/Graphical/GraphicalStaffEntry.ts

@@ -17,7 +17,7 @@ import {AbstractGraphicalInstruction} from "./AbstractGraphicalInstruction";
 import {GraphicalStaffEntryLink} from "./GraphicalStaffEntryLink";
 import {CollectionUtil} from "../../Util/collectionUtil";
 
-export class GraphicalStaffEntry extends GraphicalObject {
+export abstract class GraphicalStaffEntry extends GraphicalObject {
     constructor(parentMeasure: StaffMeasure, sourceStaffEntry: SourceStaffEntry = undefined, staffEntryParent: GraphicalStaffEntry = undefined) {
         super();
         this.parentMeasure = parentMeasure;

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

@@ -15,8 +15,10 @@ import {GraphicalStaffEntry} from "./GraphicalStaffEntry";
 import {SystemLinesEnum} from "./SystemLinesEnum";
 import Dictionary from "typescript-collections/dist/lib/Dictionary";
 import {CollectionUtil} from "../../Util/collectionUtil";
+import {GraphicalComment} from "./GraphicalComment";
+import {GraphicalMarkedArea} from "./GraphicalMarkedArea";
 
-export class MusicSystem extends GraphicalObject {
+export abstract class MusicSystem extends GraphicalObject {
     public needsToBeRedrawn: boolean = true;
     protected parent: GraphicalMusicPage;
     protected id: number;
@@ -26,7 +28,11 @@ export class MusicSystem extends GraphicalObject {
     protected measureNumberLabels: GraphicalLabel[] = [];
     protected maxLabelLength: number;
     protected objectsToRedraw: [Object[], Object][] = [];
-
+    protected instrumentBrackets: GraphicalObject[] = [];
+    protected groupBrackets: GraphicalObject[] = [];
+    protected graphicalMarkedAreas: GraphicalMarkedArea[] = [];
+    protected graphicalComments: GraphicalComment[] = [];
+    protected
     constructor(parent: GraphicalMusicPage, id: number) {
         super();
         this.parent = parent;
@@ -63,6 +69,22 @@ export class MusicSystem extends GraphicalObject {
         return this.objectsToRedraw;
     }
 
+    public get InstrumentBrackets(): GraphicalObject[] {
+        return this.instrumentBrackets;
+    }
+
+    public get GroupBrackets(): GraphicalObject[] {
+        return this.groupBrackets;
+    }
+
+    public get GraphicalMarkedAreas(): GraphicalMarkedArea[] {
+        return this.graphicalMarkedAreas;
+    }
+
+    public get GraphicalComments(): GraphicalComment[] {
+        return this.graphicalComments;
+    }
+
     public get Id(): number {
         return this.id;
     }

+ 1 - 1
src/MusicalScore/Graphical/StaffLine.ts

@@ -9,7 +9,7 @@ import {MusicSystem} from "./MusicSystem";
 import {StaffLineActivitySymbol} from "./StaffLineActivitySymbol";
 import {PointF2D} from "../../Common/DataObjects/PointF2D";
 
-export class StaffLine extends GraphicalObject {
+export abstract class StaffLine extends GraphicalObject {
     protected measures: StaffMeasure[] = [];
     protected staffLines: GraphicalLine[] = new Array(5);
     protected parentMusicSystem: MusicSystem;

+ 1 - 1
src/MusicalScore/Graphical/StaffMeasure.ts

@@ -15,7 +15,7 @@ import {SystemLinesEnum} from "./SystemLinesEnum";
 import {BoundingBox} from "./BoundingBox";
 import {PointF2D} from "../../Common/DataObjects/PointF2D";
 
-export class StaffMeasure extends GraphicalObject {
+export abstract class StaffMeasure extends GraphicalObject {
     protected firstInstructionStaffEntry: GraphicalStaffEntry;
     protected lastInstructionStaffEntry: GraphicalStaffEntry;
 

+ 1 - 1
src/MusicalScore/MusicSource/PartListEntry.ts

@@ -2,7 +2,7 @@ import {MusicSheet} from "../MusicSheet";
 import {Fraction} from "../../Common/DataObjects/fraction";
 import {SourceMeasure} from "../VoiceData/SourceMeasure";
 
-export class PartListEntry {
+export abstract class PartListEntry {
     constructor(musicSheet: MusicSheet) {
         this.musicSheet = musicSheet;
     }

+ 1 - 1
src/MusicalScore/VoiceData/Expressions/abstractTempoExpression.ts

@@ -1,7 +1,7 @@
 import {PlacementEnum} from "./abstractExpression";
 import {MultiTempoExpression} from "./multiTempoExpression";
 
-export class AbstractTempoExpression {
+export abstract class AbstractTempoExpression {
     constructor(label: string, placement: PlacementEnum, staffNumber: number, parentMultiTempoExpression: MultiTempoExpression) {
         this.label = label;
         this.placement = placement;

+ 1 - 1
src/MusicalScore/VoiceData/Instructions/AbstractNotationInstruction.ts

@@ -1,6 +1,6 @@
 import {SourceStaffEntry} from "../SourceStaffEntry";
 
-export class AbstractNotationInstruction {
+export abstract class AbstractNotationInstruction {
     constructor(parent: SourceStaffEntry) {
         this.parent = parent;
     }