public override double width(DrawCFGraph.TextMeasurer textMeasurer) { double width = this.ifTrueStatement.width(textMeasurer) + gap * 6, currWidth, conditionWidth = textMeasurer(this.codeString, fontHeight) + gap * 4; this.textMeasurer = textMeasurer; if (width < (currWidth = textMeasurer("true", fontHeight) + gap * 2)) { width = currWidth; } if (this.elseStatement != null) { double elseWidth = this.elseStatement.width(textMeasurer) + gap * 6; if (elseWidth < (currWidth = textMeasurer("false", fontHeight) + gap * 4)) { elseWidth = currWidth; } width = width > elseWidth ? width * 2 : elseWidth * 2; } else { width *= 2; } return(width > conditionWidth ? width : conditionWidth); }
public double width(DrawCFGraph.TextMeasurer textMeasurer) { double functionBodyWidth = this.functionBody.width(textMeasurer), textWidth = textMeasurer("function: " + this.functionName, CStatement.fontHeight); this.textMeasurer = textMeasurer; return(functionBodyWidth > textWidth ? functionBodyWidth : textWidth); }
public override double width(DrawCFGraph.TextMeasurer textMeasurer) { double conditionWidth = textMeasurer(this.codeString, fontHeight) + gap * 16, statementWidth = this.switchStatement.width(textMeasurer); this.textMeasurer = textMeasurer; return(conditionWidth > statementWidth ? conditionWidth : statementWidth); }
public override double width(DrawCFGraph.TextMeasurer textMeasurer) { double labelWidth = textMeasurer(this.codeString, fontHeight) + gap * 6, labeledWidth = this.labeledStatement.width(textMeasurer); this.textMeasurer = textMeasurer; return(labelWidth > labeledWidth ? labelWidth : labeledWidth); }
public override double width(DrawCFGraph.TextMeasurer textMeasurer) { double maxWidth = 0; this.textMeasurer = textMeasurer; foreach (CStatement statement in this.statementList) { if (statement != null) { double currWidth = statement.width(textMeasurer); if (currWidth > maxWidth) { maxWidth = currWidth; } } } return(maxWidth + gap * 6); }
public override double width(DrawCFGraph.TextMeasurer textMeasurer) { this.textMeasurer = textMeasurer; return(textMeasurer(this.codeString, fontHeight) + gap * 10); }
public abstract double width(DrawCFGraph.TextMeasurer textMeasurer);