Exemple #1
0
  /**
   * Writes the model to DOT.
   *
   * @param bw The writer
   * @throws IOException If writing fails
   */
  public void writeToDot(Writer bw) throws IOException {
    // super.writeToDot(bw);

    // Preamble of dot file
    bw.write(
        "digraph G {ranksep=\".3\"; fontsize=\"8\"; remincross=true; margin=\"0.0,0.0\"; rankdir=TB; ");
    bw.write("fontname=\"Arial\"; \n");
    bw.write("edge [arrowsize=\"0.5\"];\n");
    bw.write("node [fontname=\"Arial\",fontsize=\"8\"];\n");

    // Add the Data Element nodes
    Iterator it = getVerticeList().iterator();
    while (it.hasNext()) {
      Object object = it.next();
      if (object instanceof PDMDataElement) {
        ((PDMDataElement) object).writeToDot(bw, this);
      }
    }

    // Add all edges
    it = operations.values().iterator();
    while (it.hasNext()) {
      Object object = it.next();
      if (object instanceof PDMOperation) {
        ((PDMOperation) object).writeToDot(bw, this);
      }
    }

    bw.write("\n}\n");
  }