Esempio n. 1
0
 public boolean renderObject(Comment element, IndentedPrintWriter out, IRenderingSession context) {
   if (!context.getSettings().getBoolean(UML2DOTPreferences.SHOW_COMMENTS)) return false;
   String commentNodeId = "comment_" + UML2DOTRenderingUtils.getXMIID(element);
   out.println('"' + commentNodeId + "\" [shape=note,label=\"" + element.getBody() + "\"]");
   for (Element commented : element.getAnnotatedElements()) {
     out.print(
         "\""
             + ((NamedElement) commented).getName()
             + "\":port"
             + " -- \""
             + commentNodeId
             + "\"");
     out.println("[");
     out.enterLevel();
     DOTRenderingUtils.addAttribute(out, "head", "none");
     DOTRenderingUtils.addAttribute(out, "tail", "none");
     DOTRenderingUtils.addAttribute(out, "constraint", Boolean.TRUE.toString());
     DOTRenderingUtils.addAttribute(out, "arrowtail", "none");
     DOTRenderingUtils.addAttribute(out, "arrowhead", "none");
     DOTRenderingUtils.addAttribute(out, "style", "solid");
     out.exitLevel();
     out.println("]");
   }
   return true;
 }
Esempio n. 2
0
 public boolean renderObject(
     Dependency dependency, IndentedPrintWriter writer, IRenderingSession context) {
   if (dependency.getSuppliers().isEmpty()) return false;
   writer.write("dependency ");
   writer.write(
       TextUMLRenderingUtils.getQualifiedNameIfNeeded(
           dependency.getSuppliers().get(0), dependency.getNamespace()));
   writer.println(";");
   return true;
 }