import { Label } from "../Label" ; import { GraphicalLabel } from "./GraphicalLabel" ; import { ChordSymbolContainer } from "../VoiceData/ChordSymbolContainer" ; import { BoundingBox } from "./BoundingBox" ; import { GraphicalObject } from "./GraphicalObject" ; import { PointF2D } from "../../Common/DataObjects/PointF2D" ; import { EngravingRules } from "./EngravingRules" ; import { KeyInstruction } from "../VoiceData/Instructions/KeyInstruction" ; export class GraphicalChordSymbolContainer extends GraphicalObject { private chordSymbolContainer : ChordSymbolContainer ; private graphicalLabel : GraphicalLabel ; private rules : EngravingRules ; constructor ( chordSymbolContainer , parent , textHeight , keyInstruction , transposeHalftones , rules ) { super ( ) ; this . chordSymbolContainer = chordSymbolContainer ; this . boundingBox = new BoundingBox ( this , parent ) ; this . rules = rules ; this . calculateLabel ( textHeight , transposeHalftones , keyInstruction ) ; } public get GetChordSymbolContainer ( ) : ChordSymbolContainer { return this . chordSymbolContainer ; } public get GraphicalLabel ( ) : GraphicalLabel { return this . graphicalLabel ; } private calculateLabel ( textHeight , transposeHalftones , keyInstruction ) { const text = ChordSymbolContainer . calculateChordText ( this . chordSymbolContainer , transposeHalftones , keyInstruction ) ; this . graphicalLabel = new GraphicalLabel ( new Label ( text ) , textHeight , this . rules . ChordSymbolTextAlignment , this . rules , this . boundingBox ) ; this . graphicalLabel . PositionAndShape . RelativePosition = new PointF2D ( this . rules . ChordSymbolRelativeXOffset , 0.0 ) ; this . graphicalLabel . Label . colorDefault = this . rules . DefaultColorChordSymbol ; } }