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
 @Override
 public boolean renderObject(Interface element, IndentedPrintWriter w, IRenderingSession context) {
   if (!context.getSettings().getBoolean(SHOW_INTERFACES)) return false;
   return super.renderObject(element, w, context);
 }