import { StaffLine } from "./StaffLine" ; import { GraphicalLabel } from "./GraphicalLabel" ; import { AbstractGraphicalExpression } from "./AbstractGraphicalExpression" ; import { PlacementEnum , AbstractExpression } from "../VoiceData/Expressions/AbstractExpression" ; import { MultiExpression } from "../VoiceData/Expressions/MultiExpression" ; import { SkyBottomLineCalculator } from "./SkyBottomLineCalculator" ; import log from "loglevel" ; import { SourceMeasure } from "../VoiceData/SourceMeasure" ; export class GraphicalUnknownExpression extends AbstractGraphicalExpression { public sourceMultiExpression : MultiExpression ; constructor ( staffLine , label , placement , measure , sourceMultiExpression = undefined ) { super ( staffLine , new AbstractExpression ( placement ) , measure ) ; this . label = label ; this . sourceMultiExpression = sourceMultiExpression ; } public updateSkyBottomLine ( ) { const skyBottomLineCalculator = this . parentStaffLine . SkyBottomLineCalculator ; const left = this . label . PositionAndShape . RelativePosition . x + this . label . PositionAndShape . BorderMarginLeft ; const right = this . label . PositionAndShape . RelativePosition . x + this . label . PositionAndShape . BorderMarginRight ; switch ( this . Placement ) { case PlacementEnum . Above : const yValueAbove = this . label . PositionAndShape . BorderMarginTop + this . label . PositionAndShape . RelativePosition . y ; skyBottomLineCalculator . updateSkyLineInRange ( left , right , yValueAbove ) ; break ; case PlacementEnum . Below : const yValueBelow = this . label . PositionAndShape . BorderMarginBottom + this . label . PositionAndShape . RelativePosition . y ; skyBottomLineCalculator . updateBottomLineInRange ( left , right , yValueBelow ) ; break ; default : log . error ( "Placement for GraphicalUnknownExpression is unknown" ) ; } } }