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


C++ UmlRelation::set_JavaAnnotations方法代码示例

本文整理汇总了C++中UmlRelation::set_JavaAnnotations方法的典型用法代码示例。如果您正苦于以下问题:C++ UmlRelation::set_JavaAnnotations方法的具体用法?C++ UmlRelation::set_JavaAnnotations怎么用?C++ UmlRelation::set_JavaAnnotations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UmlRelation的用法示例。


在下文中一共展示了UmlRelation::set_JavaAnnotations方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: set_unidir

        void UmlRelation::set_unidir()
        {
            UmlRelation * r1 = side(TRUE);
            UmlRelation * r2 = (r1 != this) ? this : side(FALSE);

            if (r1->isReadOnly() || r2->isReadOnly()) {
                UmlCom::trace(WrapperStr("<font face=helvetica>in <i>") + WrapperStr(Lex::filename().toAscii().constData())
                              + "</i> line " + WrapperStr().setNum(Lex::line_number())
                              + " <b>cannot remove relation between classes <i>"
                              + roleType()->name() + "</i> and <i>" + parent()->name()
                              + "</i> because one is read only</b></font><br>");
                throw 0;
            }

            aRelationKind k;

            switch (relationKind()) {
            case anAssociation:
                k = aDirectionalAssociation;
                break;

            case anAggregation:
                k = aDirectionalAggregation;
                break;

            default:
                k = aDirectionalAggregationByValue;
            }

            if (this == r1)
                set_rel_kind(k);
            else {
                UmlRelation * rel =
                    UmlBaseRelation::create(aDirectionalAssociation,
                                            (UmlClass *) parent(), roleType());
                WrapperStr role = roleName();

                rel->moveAfter(this);
                rel->set_Visibility(visibility());

                if (!description().isEmpty())
                    rel->set_Description(description());

                if (isReadOnly())
                    rel->set_isReadOnly(TRUE);

                if (isJavaTransient())
                    rel->set_isJavaTransient(TRUE);

                if (isVolatile())
                    rel->set_isVolatile(TRUE);

                if (isClassMember())
                    rel->set_isClassMember(TRUE);

                if (!multiplicity().isEmpty())
                    rel->set_Multiplicity(multiplicity());

                if (!defaultValue().isEmpty())
                    rel->set_DefaultValue(defaultValue());

                if (!javaAnnotations().isEmpty())
                    rel->set_JavaAnnotations(javaAnnotations());

                if (!stereotype().isEmpty())
                    rel->set_Stereotype(stereotype());

                rel->set_JavaDecl(javaDecl());

                UmlOperation * op;
                UmlOperation * oper;

                if (((op = getOperation()) != 0) &&
                    rel->addGetOperation() &&
                    ((oper = rel->getOperation()) != 0))
                    copy(op, oper);

                if (((op = setOperation()) != 0) &&
                    rel->addSetOperation() &&
                    ((oper = rel->getOperation()) != 0))
                    copy(op, oper);

                r1->deleteIt();
                r2->deleteIt();

                rel->set_RoleName(role);
            }
        }
开发者ID:jeremysalwen,项目名称:douml,代码行数:88,代码来源:UmlRelation.cpp

示例2: new_one


//.........这里部分代码省略.........
                    container->set_updated();
                }
            }
            else if (nequal(rel->description(), Lex::simplify_comment(comment))) {
                rel->set_Description(comment); // comment was set
                container->set_updated();
            }

            if (rel->isReadOnly() != constp) {
                rel->set_isReadOnly(constp);
                container->set_updated();
            }

            if (rel->isJavaTransient() != transientp) {
                rel->set_isJavaTransient(transientp);
                container->set_updated();
            }

            if (rel->isVolatile() != volatilep) {
                rel->set_isVolatile(volatilep);
                container->set_updated();
            }

            if (rel->isClassMember() != staticp) {
                rel->set_isClassMember(staticp);
                container->set_updated();
            }

            if (neq(rel->multiplicity(), array)) {
                rel->set_Multiplicity(array);
                container->set_updated();
            }

            WrapperStr v = rel->defaultValue();

            if (!v.isEmpty() && (((const char *) v)[0] == '='))
                v = v.mid(1);

            if (nequal(v, value)) {
                rel->set_DefaultValue(value);
                container->set_updated();
            }

            if (nequal(rel->javaAnnotations(), annotation)) {
                rel->set_JavaAnnotations(annotation);
                container->set_updated();
            }

            if (neq(rel->javaDecl(), decl)) {
                rel->set_JavaDecl(decl);
                container->set_updated();
            }

            rel->set_usefull();

            expected_order.append(rel);
        }
        else {
#endif
            rel->set_Visibility(visibility);

            if (!comment.isEmpty())
                rel->set_Description((decl.find("${description}") != -1)
                                     ? description : comment);

            if (constp)
                rel->set_isReadOnly(TRUE);

            if (transientp)
                rel->set_isJavaTransient(TRUE);

            if (volatilep)
                rel->set_isVolatile(TRUE);

            if (staticp)
                rel->set_isClassMember(TRUE);

            if (!array.isEmpty())
                rel->set_Multiplicity(array);

            if (! value.isEmpty())
                rel->set_DefaultValue(value);

            if (! annotation.isEmpty())
                rel->set_JavaAnnotations(annotation);

            rel->set_JavaDecl(decl);

            rel->set_RoleName(name);

#ifdef ROUNDTRIP

            if (roundtrip)
                expected_order.append(rel);
        }

#endif

        return TRUE;
    }
开发者ID:jeremysalwen,项目名称:douml,代码行数:101,代码来源:UmlRelation.cpp

示例3: new_one


//.........这里部分代码省略.........
    else if (nequal(rel->description(), Lex::simplify_comment(comment))) {
      rel->set_Description(comment); // comment was set
      container->set_updated();
    }
  
    if (rel->isReadOnly() != constp) {
      rel->set_isReadOnly(constp);
      container->set_updated();
    }
    
    if (rel->isJavaTransient() != transientp) {
      rel->set_isJavaTransient(transientp);
      container->set_updated();
    }
    
    if (rel->isVolatile() != volatilep) {
      rel->set_isVolatile(volatilep);
      container->set_updated();
    }
    
    if (rel->isClassMember() != staticp) {
      rel->set_isClassMember(staticp);
      container->set_updated();
    }
    
    if (neq(rel->multiplicity(), array)) {
      rel->set_Multiplicity(array);
      container->set_updated();
    }
    
    if (neq(rel->defaultValue(), value)) {
      rel->set_DefaultValue(value);
      container->set_updated();
    }
    
    if (nequal(rel->javaAnnotations(), annotation)) {
      rel->set_JavaAnnotations(annotation);
      container->set_updated();
    }
    
    if (neq(rel->stereotype(), st) &&
	(rel->stereotype().isEmpty() ||
	 (JavaSettings::relationAttributeStereotype(rel->stereotype()) != st))) {
      rel->set_Stereotype(st);
      container->set_updated();
    }
    
    if (neq(rel->javaDecl(), decl)) {
      rel->set_JavaDecl(decl);
      container->set_updated();
    }
    
    // role name is the right one
    
    rel->set_usefull();
    expected_order.append(rel);
  }
  else {
#endif
  rel->set_Visibility(visibility);
  
  if (!comment.isEmpty())
    rel->set_Description((decl.find("${description}") != -1)
			 ? description : Lex::simplify_comment(comment));
  
  if (constp)
    rel->set_isReadOnly(TRUE);
  
  if (transientp)
    rel->set_isJavaTransient(TRUE);
  
  if (volatilep)
    rel->set_isVolatile(TRUE);
  
  if (staticp)
    rel->set_isClassMember(TRUE);
  
  if (!array.isEmpty())
    rel->set_Multiplicity(array);
  
  if (! value.isEmpty())
    rel->set_DefaultValue(value);
  
  if (! annotation.isEmpty())
    rel->set_JavaAnnotations(annotation);
  
  rel->set_Stereotype(st);
  
  rel->set_JavaDecl(decl);

  rel->set_RoleName(name);
  
#ifdef ROUNDTRIP
  if (roundtrip)
    expected_order.append(rel);
  }
#endif
  
  return TRUE;
}
开发者ID:,项目名称:,代码行数:101,代码来源:


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