void JavaClassDeclarationBlock::init (JavaClassifierCodeDocument *parentDoc, const QString &comment) { setComment(new JavaCodeDocumentation(parentDoc)); getComment()->setText(comment); setEndText("}"); updateContent(); }
Ottava::Ottava(Score* s) : TextLineBase(s, ElementFlag::ON_STAFF | ElementFlag::MOVABLE) { _ottavaType = OttavaType::OTTAVA_8VA; setBeginTextPlace(PlaceText::LEFT); setContinueTextPlace(PlaceText::LEFT); setEndHookType(HookType::HOOK_90); setLineVisible(true); setBeginHookHeight(Spatium(.0)); setEndText(""); initElementStyle(&ottavaStyle); }
TextLine::TextLine(Score* s) : TextLineBase(s) { initElementStyle(&textLineStyle); setPlacement(Placement::ABOVE); setBeginText(""); setContinueText(""); setEndText(""); setBeginTextOffset(QPointF(0,0)); setContinueTextOffset(QPointF(0,0)); setEndTextOffset(QPointF(0,0)); setLineVisible(true); setBeginHookType(HookType::NONE); setEndHookType(HookType::NONE); setBeginHookHeight(Spatium(1.5)); setEndHookHeight(Spatium(1.5)); resetProperty(Pid::BEGIN_TEXT_PLACE); resetProperty(Pid::CONTINUE_TEXT_PLACE); resetProperty(Pid::END_TEXT_PLACE); }
/** * update the start and end text for this ownedhierarchicalcodeblock. */ void XMLElementCodeBlock::updateContent ( ) { QString endLine = getNewLineEndingChars(); QString nodeName = getNodeName(); // Now update START/ENDING Text QString startText = '<' + nodeName; QString endText = ""; UMLAttributeList * alist = getAttributeList(); for (UMLAttribute *at = alist->first(); at; at=alist->next()) { if(at->getInitialValue().isEmpty()) kWarning()<<" XMLElementCodeBlock : cant print out attribute that lacks an initial value"<<endl; else { startText.append(" " +at->getName()+"=\""); startText.append(at->getInitialValue()+"\""); } } // now set close of starting/ending node, the style depending on whether we have child text or not if(getTextBlockList()->count()) { startText.append(">"); endText = "</" + nodeName + '>'; } else { startText.append("/>"); endText = ""; } setStartText(startText); setEndText(endText); }
bool TextLineBase::setProperty(P_ID id, const QVariant& v) { switch (id) { case P_ID::BEGIN_TEXT_PLACE: _beginTextPlace = PlaceText(v.toInt()); break; case P_ID::BEGIN_TEXT_ALIGN: _beginTextAlign = Align(v.toInt()); break; case P_ID::CONTINUE_TEXT_ALIGN: _continueTextAlign = Align(v.toInt()); break; case P_ID::END_TEXT_ALIGN: _endTextAlign = Align(v.toInt()); break; case P_ID::CONTINUE_TEXT_PLACE: _continueTextPlace = PlaceText(v.toInt()); break; case P_ID::END_TEXT_PLACE: _endTextPlace = PlaceText(v.toInt()); break; case P_ID::BEGIN_HOOK_HEIGHT: _beginHookHeight = v.value<Spatium>(); break; case P_ID::END_HOOK_HEIGHT: _endHookHeight = v.value<Spatium>(); break; case P_ID::BEGIN_HOOK_TYPE: _beginHookType = HookType(v.toInt()); break; case P_ID::END_HOOK_TYPE: _endHookType = HookType(v.toInt()); break; case P_ID::BEGIN_TEXT: setBeginText(v.toString()); break; case P_ID::BEGIN_TEXT_OFFSET: setBeginTextOffset(v.toPointF()); break; case P_ID::CONTINUE_TEXT_OFFSET: setContinueTextOffset(v.toPointF()); break; case P_ID::END_TEXT_OFFSET: setEndTextOffset(v.toPointF()); break; case P_ID::CONTINUE_TEXT: setContinueText(v.toString()); break; case P_ID::END_TEXT: setEndText(v.toString()); break; case P_ID::LINE_VISIBLE: setLineVisible(v.toBool()); break; case P_ID::BEGIN_FONT_FACE: setBeginFontFamily(v.toString()); break; case P_ID::BEGIN_FONT_SIZE: if (v.toReal() <= 0) qDebug("font size is %f", v.toReal()); setBeginFontSize(v.toReal()); break; case P_ID::BEGIN_FONT_BOLD: setBeginFontBold(v.toBool()); break; case P_ID::BEGIN_FONT_ITALIC: setBeginFontItalic(v.toBool()); break; case P_ID::BEGIN_FONT_UNDERLINE: setBeginFontUnderline(v.toBool()); break; case P_ID::CONTINUE_FONT_FACE: setContinueFontFamily(v.toString()); break; case P_ID::CONTINUE_FONT_SIZE: setContinueFontSize(v.toReal()); break; case P_ID::CONTINUE_FONT_BOLD: setContinueFontBold(v.toBool()); break; case P_ID::CONTINUE_FONT_ITALIC: setContinueFontItalic(v.toBool()); break; case P_ID::CONTINUE_FONT_UNDERLINE: setContinueFontUnderline(v.toBool()); break; case P_ID::END_FONT_FACE: setEndFontFamily(v.toString()); break; case P_ID::END_FONT_SIZE: setEndFontSize(v.toReal()); break; case P_ID::END_FONT_BOLD: setEndFontBold(v.toBool()); break; case P_ID::END_FONT_ITALIC: setEndFontItalic(v.toBool()); break; case P_ID::END_FONT_UNDERLINE: setEndFontUnderline(v.toBool()); break; default: return SLine::setProperty(id, v); } triggerLayout(); return true; }