示例#1
0
文件: UmlNode.cpp 项目: SciBoy/douml
void UmlNode::html(Q3CString, unsigned int, unsigned int) {
  UmlCom::message(name());

  UmlItem::html("Node", (UmlDiagram *) associatedDiagram());

  unload(FALSE, FALSE);
}
示例#2
0
void UmlPackage::html(Q3CString pfix, unsigned int rank, unsigned int level) {
  define();
  
  if (stereotype() == "profile")
    chapter("Profile", pfix, rank, "profile", level);
  else
    chapter("Package", pfix, rank, "package", level);

  Q3CString s = description();
  
  if (!s.isEmpty()) {
    fw.write("<p>");
    writeq(s);
    fw.write("<br /></p>");
  }
  
  bool ul = FALSE;
  
  s = cppNamespace();
  
  if (!s.isEmpty()) {
    fw.write("<p></p><ul>\n");
    ul = TRUE;
    fw.write("<li>C++ namespace : ");
    writeq(s);
    fw.write("</li>\n");
  }

  s = javaPackage();
  
  if (!s.isEmpty()) {
    if (! ul)
      fw.write("<p></p><ul>");
    ul = TRUE;
    fw.write("<li>Java package : ");
    writeq(s);
    fw.write("</li>\n");
  }
    
  if (ul)
    fw.write("</ul>\n");
    
  write_dependencies();
    
  UmlDiagram * d = associatedDiagram();
  
  if (d != 0) {
    fw.write("<p>Diagram : ");
    d->write();
    fw.write("</p>\n");
  }

  write_properties();

  write_children(pfix, rank, level);

  unload(FALSE, FALSE);
}
示例#3
0
void UmlComponent::html(QCString pfix, unsigned int rank, unsigned int level) {
  UmlCom::message(name());

  UmlItem::html("Component", (UmlDiagram *) associatedDiagram());
  
  if (parent()->kind() == aComponent) {
    fw.write("<p>nested in ");
    parent()->write();
    fw.write("</p>\n");
  }

  const QVector<UmlClass> & provided = providedClasses();

  if (provided.size() != 0) {
    const char * sep = "<p>provided classes : ";
    
    for (unsigned i = 0; i != provided.size(); i += 1) {
      fw.write(sep);
      sep = ", ";
      provided[i]->write();
    }
    fw.write("</p>\n");
  }

  const QVector<UmlClass> & required = requiredClasses();

  if (required.size() != 0) {
    const char * sep = "<p>required classes : ";
    
    for (unsigned i = 0; i != required.size(); i += 1) {
      fw.write(sep);
      sep = ", ";
      required[i]->write();
    }
    fw.write("</p>\n");
  }

  const QVector<UmlClass> & realizing = realizingClasses();

  if (realizing.size() != 0) {
    const char * sep = "<p>realizing classes : ";
    
    for (unsigned i = 0; i != realizing.size(); i += 1) {
      fw.write(sep);
      sep = ", ";
      realizing[i]->write();
    }
    fw.write("</p>\n");
  }
  
  write_children(pfix, rank, level);

  unload(FALSE, FALSE);
}
示例#4
0
void UmlActivityPartition::html(Q3CString pfix, unsigned int rank, unsigned int level) {
  define();
  
  chapter("Activity partition", pfix, rank, "activitypartition", level);

  Q3CString s = description();
  
  if (!s.isEmpty()) {
    fw.write("<p>");
    writeq(s);
    fw.write("<br /></p>");
  }
  
  if (isDimension())
    fw.write((isExternal())
	     ? "<p>is dimension, is external</p>\n"
	     : "<p>is dimension</p>\n");
  else if (isExternal())
    fw.write("<p>is external</p>\n");
    
  if (represents() != 0) {
    fw.write("<p>represents ");
    represents()->write();
    fw.write("</p>");
  }
    
  write_dependencies();
    
  UmlDiagram * d = associatedDiagram();
  
  if (d != 0) {
    fw.write("<p>Diagram : ");
    d->write();
    fw.write("</p>\n");
  }

  write_properties();

  write_children(pfix, rank, level);

  unload(FALSE, FALSE);
}
示例#5
0
文件: UmlState.cpp 项目: SciBoy/douml
void UmlState::html(Q3CString pfix, unsigned int rank, unsigned int level) {
  define();

  chapter((parent()->kind() == aClassView)
	  ? "StateMachine" : "State",
	  pfix, rank, "state", level);

  Q3CString s = description();
  
  if (!s.isEmpty()) {
    fw.write("<p>");
    writeq(description());
    fw.write("<br /></p>");
  }

  UmlState * ref = reference();
  
  if (ref != 0) {
    fw.write("<p>References ");
    ref->write();
    fw.write("</p>");
  }
  else {
    if (isActive())
      fw.write("<p>Active state</p>\n");
    
    UmlOperation * beh = specification();
    
    if (beh != 0) {
      fw.write("<p>Implements ");
      beh->write();
      fw.write("</p>");
    }
    
    Q3CString scpp, sjava;
    
    s = entryBehavior();
    scpp = cppEntryBehavior();
    sjava = javaEntryBehavior();
    
    if (!s.isEmpty() || !scpp.isEmpty() || !sjava.isEmpty()) {
      fw.write("<p>Entry Behavior :</p><ul>");
      
      if (!s.isEmpty()) {
	fw.write("<li>OCL : <pre>\n");
	writeq(s);
	fw.write("</pre></li>");
      }
      
      if (!scpp.isEmpty()) {
	fw.write("<li>C++ : <pre>\n");
	writeq(scpp);
	fw.write("</pre></li>");
      }
      
      if (!sjava.isEmpty()) {
	fw.write("<li>Java : <pre>\n");
	writeq(sjava);
	fw.write("</pre></li>");
      }
      
      fw.write("</ul>");
    }
    
    s = exitBehavior();
    scpp = cppExitBehavior();
    sjava = javaExitBehavior();
    
    if (!s.isEmpty() || !scpp.isEmpty() || !sjava.isEmpty()) {
      fw.write("<p>Exit Behavior :</p><ul>");
      
      if (!s.isEmpty()) {
	fw.write("<li>OCL : <pre>\n");
	writeq(s);
	fw.write("</pre></li>");
      }
      
      if (!scpp.isEmpty()) {
	fw.write("<li>C++ : <pre>\n");
	writeq(scpp);
	fw.write("</pre></li>");
      }
      
      if (!sjava.isEmpty()) {
	fw.write("<li>Java : <pre>\n");
	writeq(sjava);
	fw.write("</pre></li>");
      }
      
      fw.write("</ul>");
    }
    
    s = doActivity();
    scpp = cppDoActivity();
    sjava = javaDoActivity();
    
    if (!s.isEmpty() || !scpp.isEmpty() || !sjava.isEmpty()) {
      fw.write("<p>Do activity :</p><ul>");
      
      if (!s.isEmpty()) {
	fw.write("<li>OCL : <pre>\n");
	writeq(s);
	fw.write("</pre></li>");
      }
      
      if (!scpp.isEmpty()) {
	fw.write("<li>C++ : <pre>\n");
	writeq(scpp);
	fw.write("</pre></li>");
      }
      
      if (!sjava.isEmpty()) {
	fw.write("<li>Java : <pre>\n");
	writeq(sjava);
	fw.write("</pre></li>");
      }
      
      fw.write("</ul>");
    }
  }
  
  UmlStateDiagram * d = associatedDiagram();
  
  if (d != 0) {
    fw.write("<p>Diagram : ");
    d->write();
    fw.write("</p>");
  }

  write_properties();

  write_children(pfix, rank, level);

  unload(FALSE, FALSE);
}
示例#6
0
void UmlClass::gen_html(QCString pfix, unsigned int rank, unsigned int level) {
  UmlCom::message(name());
  
  QCString s;
 
  s = description();
  
  if (isActive())
    fw.write("<p>Active class</p>\n");
    
  if (!s.isEmpty()) {
    fw.write("<p>");
    if (! javaDecl().isEmpty())
      gen_java_decl(s, TRUE);
    else if (! phpDecl().isEmpty())
      gen_php_decl(s, TRUE);
    else if (! pythonDecl().isEmpty())
      gen_python_decl(s, TRUE);
    else
      gen_cpp_decl(s, TRUE);
    fw.write("<br /></p>\n");
  }

  if (!cppDecl().isEmpty() ||
      !javaDecl().isEmpty() ||
      !phpDecl().isEmpty() ||
      !pythonDecl().isEmpty()) {
    fw.write("<p>Declaration :</p><ul>\n");
    
    s = cppDecl();
    
    if (!s.isEmpty()) {
      fw.write("<li>C++ : ");
      gen_cpp_decl(s, FALSE);
      fw.write("</li>");
    }
    
    s = javaDecl();
    
    if (!s.isEmpty()) {
      fw.write("<li>Java : ");
      gen_java_decl(s, FALSE);
      fw.write("</li>");
    }
    
    s = phpDecl();
    
    if (!s.isEmpty()) {
      fw.write("<li>Php : ");
      gen_php_decl(s, FALSE);
      fw.write("</li>");
    }
    
    s = pythonDecl();
    
    if (!s.isEmpty()) {
      fw.write("<li>Python : ");
      gen_python_decl(s, FALSE);
      fw.write("</li>");
    }
    
    fw.write("</ul>");
  }
  
  if (subClasses.size() != 0) {
    sort(subClasses);
    fw.write("<p>Directly inherited by : ");
    
    for (unsigned i = 0; i != subClasses.size(); i += 1) {
      subClasses.elementAt(i)->write();
      fw.write(' ');
    }
    fw.write("</p>\n");    
  }
  
  write_dependencies();

  annotation_constraint();
  
  bool p = FALSE;
  UmlItem * x;
  
  if ((x = associatedArtifact()) != 0) {
    p = TRUE;
    fw.write("<p>Artifact : ");
    x->write();
  }

  const QVector<UmlComponent> comps = associatedComponents();
  
  if (comps.size() != 0) {
    if (p) 
      fw.write(", Component(s) :");
    else {
      p = TRUE;
      fw.write("<p>Component(s) :");
    }
    
    for (unsigned i = 0; i != comps.size(); i += 1) {
      fw.write(' ');
      comps[i]->write();
    }
  }

  if ((x = associatedDiagram()) != 0) {
    if (p) 
      fw.write(", Diagram : ");
    else {
      p = TRUE;
      fw.write("<p>Diagram : ");
    }
    x->write();
  }

  if (p)
    fw.write("</p>\n");
  
  if (parent()->kind() == aClass) {
    fw.write("<p>nested in ");
    parent()->write();
    fw.write("</p>\n");
  }

  write_properties();

  //

  const QVector<UmlItem> ch = children();
  
  if (ch.size() != 0) {
    if (stereotype() == "enum_pattern") {
      p = FALSE;
            
      for (unsigned i = 0; i != ch.size(); i += 1) {
	if (ch[i]->kind() == anAttribute) {
	  if (!p) {
	    p = TRUE;
	    fw.write("<div class=\"sub\">\n<p>Items :</p><ul>\n");
	  }
	  fw.write("<li>");
	  writeq(ch[i]->name());
	  fw.write("</li>\n");
	}
      }
      if (p)
	fw.write("</ul>\n</div>\n");
    }
    else {
      fw.write("<div class=\"sub\">\n");
      
      if (stereotype() == "enum") {
	unsigned i;
	
	p = FALSE;
	
	for (i = 0; i != ch.size(); i += 1) {
	  if ((ch[i]->kind() == anAttribute) &&
	      (ch[i]->stereotype() != "attribute")) {
	    if (!p) {
	      p = TRUE;
	      fw.write("<p>Items :</p><ul>\n");
	    }
	    fw.write("<li>");
	    writeq(ch[i]->name());
	    fw.write("</li>\n");
	  }
	}
	if (p)
	  fw.write("</ul>\n");
	
	s = "";
	for (i = 0; i != ch.size(); i += 1)
	  if ((ch[i]->kind() != anAttribute) ||
	      (ch[i]->stereotype() == "attribute"))
	    ch[i]->html(s, 0, 0);
      }
      else if (flat)
	write_children(pfix, rank, level);
      else {
	// non flat
	s = "";
	for (unsigned i = 0; i != ch.size(); i += 1)
	  ch[i]->html(s, 0, 0);
      }
      
      fw.write("</div>\n");
    }
  }

  sort(*inherited_opers);
  bool already = FALSE;
  
  for (unsigned i = 0; i != inherited_opers->size(); i += 1) {
    if (already)
      fw.write(", ");
    else {
      already = TRUE;
      fw.write("<p>All public operations : ");
    }
    inherited_opers->elementAt(i)->write();
    fw.write(' ');
  }
  if (already)
    fw.write("</p>\n");
}