本文整理汇总了C++中UmlItem::set_Stereotype方法的典型用法代码示例。如果您正苦于以下问题:C++ UmlItem::set_Stereotype方法的具体用法?C++ UmlItem::set_Stereotype怎么用?C++ UmlItem::set_Stereotype使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UmlItem
的用法示例。
在下文中一共展示了UmlItem::set_Stereotype方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: applyStereotype
void UmlPackage::applyStereotype(FileIn & in, Token & token)
{
WrapperStr prof_st;
Q3ValueList<WrapperStr> base_v;
WrapperStr s;
if (UmlClass::isAppliedStereotype(token, prof_st, base_v)) {
WrapperStr s;
Q3ValueList<WrapperStr>::Iterator it_ext;
for (it_ext = base_v.begin(); it_ext != base_v.end(); ++it_ext) {
WrapperStr s2;
if (token.valueOf(*it_ext, s2)) {
if (s.isEmpty())
s = s2;
else if (s != s2)
in.warning("doesn't refer to the same element ('" + s + "' != '" + s2 + "')");
}
}
if (s.isEmpty())
in.warning("value of 'base_...' is missing");
else {
UmlItem * elt = All[s];
if (elt == 0) {
if (!FileIn::isBypassedId(s))
in.warning("unknown reference '" + s + "'");
}
else {
elt->set_Stereotype(prof_st);
elt->UmlItem::applyStereotype(); // set properties
Q3Dict<WrapperStr> props = elt->properties();
Q3DictIterator<WrapperStr> it(props);
while (it.current()) {
WrapperStr k = it.currentKey().latin1();
if (token.valueOf(k.mid(k.findRev(':') + 1).lower(), s))
elt->set_PropertyValue(k, s);
++it;
}
}
}
if (! token.closed())
in.finish(token.what());
}
else
in.bypass(token);
}
示例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>");
}
示例3: solve
void UmlUseCase::solve(int context, Q3CString idref) {
QMap<Q3CString, UmlItem *>::Iterator it = All.find(idref);
if (it == All.end()) {
if (!FileIn::isBypassedId(idref))
UmlCom::trace("extend/include : unknown use case reference '" + idref + "'<br>");
}
else if ((*it)->kind() != anUseCase)
UmlCom::trace("'" + idref + "' is not a use case<br>");
else {
UmlItem * rel = UmlNcRelation::create(aDependency, this, *it);
if (rel == 0)
UmlCom::trace("cannot create dependency from '" + name() + "' to '" + (*it)->name() + "'");
else
rel->set_Stereotype((context) ? "extend" : "include ");
}
}