Exemple #1
0
void UmlNcRelation::write(FileOut & out, bool inside)
{
    if (relationKind() == aGeneralisation) {
        if (inside)
            write_generalization(out);
    }
    else {
        if (inside)
            parent()->memo_relation(this);
        else
            write_dependency(out);
    }
}
Exemple #2
0
void UmlRelation::write(FileOut & out, bool inside) {
  switch (relationKind()) {
  case aGeneralisation:
    if (inside)
      write_generalization(out);
    break;
  case aRealization:
    if (inside)
      parent()->memo_relation(this);
    else
      write_realization(out);
    break;
  case aDependency:
    if (inside)
      parent()->memo_relation(this);
    else
      write_dependency(out);
    break;
  default:
    // don't generate them for actors
    {
      UmlItem * p = parent();
      
      if (p->stereotype() == "actor")
	return;
      do {
	p = p->parent();
      } while (p->kind() == aClass);
      
      UmlItem * op = roleType();
      
      if (op->stereotype() == "actor")
	return;
      do {
	op = op->parent();
      } while (op->kind() == aClass);
      
      if ((p->kind() == aClassView) && (op->kind() == aClassView)) {
	if (inside)
	  write_relation_as_attribute(out);
	else
	  // note : it is the first side
	  write_relation(out);
      }
    }
    break;
  }
}