本文整理汇总了C++中UmlItem::set_Name方法的典型用法代码示例。如果您正苦于以下问题:C++ UmlItem::set_Name方法的具体用法?C++ UmlItem::set_Name怎么用?C++ UmlItem::set_Name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UmlItem
的用法示例。
在下文中一共展示了UmlItem::set_Name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generalizeDependRealize
void UmlClass::generalizeDependRealize(UmlItem * target, FileIn & in, int context, WrapperStr label, WrapperStr constraint)
{
static const struct {
aRelationKind rk;
const char * err;
} r[] = {
{ aGeneralisation, "cannot create generalization from '" },
{ aDependency, "cannot create dependency from '" },
{ aRealization, "cannot create realization from '" },
{ aDependency, "cannot create usage from '" },
{ aDependency, "cannot create import from '" }
};
UmlItem * rel;
if (target->kind() == aClass)
rel = UmlRelation::create(r[context].rk, this, (UmlClass *) target);
else
rel = UmlNcRelation::create(r[context].rk, this, target);
if (rel == 0)
in.warning(r[context].err + name() + "' to '" + target->name() + "'");
else {
if (! label.isEmpty())
rel->set_Name(label);
if (! constraint.isEmpty() && (target->kind() == aClass))
((UmlRelation *) rel)->set_Constraint(constraint);
}
}
示例2: solveGeneralizationDependencyRealization
void UmlItem::solveGeneralizationDependencyRealization(int context, WrapperStr idref, WrapperStr label, WrapperStr)
{
QMap<QString, UmlItem *>::Iterator it = All.find(idref);
if (it != All.end()) {
static const struct {
aRelationKind rk;
const char * err;
} r[] = {
{ aGeneralisation, "cannot create generalization from '" },
{ aDependency, "cannot create dependency from '" },
{ aRealization, "cannot create realization from '" },
{ aDependency, "cannot create usage from '" },
{ aDependency, "cannot create import from '" }
};
UmlItem * target = *it;
UmlItem * rel = UmlNcRelation::create(r[context].rk, this, target);
if (rel == 0)
UmlCom::trace(r[context].err + name() + "' to '" + target->name() + "'<br>");
else {
if (! label.isEmpty())
rel->set_Name(label);
switch (context) {
case 3:
rel->set_Stereotype("use");
break;
case 4:
rel->set_Stereotype("import");
break;
default:
break;
}
}
}
else if (!FileIn::isBypassedId(idref))
UmlCom::trace("relation : unknown target reference '" + idref + "'<br>");
}