当前位置: 首页>>代码示例>>C++>>正文


C++ UmlItem::set_Name方法代码示例

本文整理汇总了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);
    }
}
开发者ID:daniel7solis,项目名称:douml,代码行数:29,代码来源:UmlClass.cpp

示例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>");

}
开发者ID:daniel7solis,项目名称:douml,代码行数:42,代码来源:UmlItem.cpp


注:本文中的UmlItem::set_Name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。