public XMLElement save() {
    XMLElement arrowLink = new XMLElement();
    arrowLink.setName("arrowlink");

    if (style != null) {
      arrowLink.setAttribute("STYLE", style);
    }
    if (getUniqueID() != null) {
      arrowLink.setAttribute("ID", getUniqueID());
    }
    if (color != null) {
      arrowLink.setAttribute("COLOR", Tools.colorToXml(color));
    }
    if (getDestinationLabel() != null) {
      arrowLink.setAttribute("DESTINATION", getDestinationLabel());
    }
    if (getReferenceText() != null) {
      arrowLink.setAttribute("REFERENCETEXT", getReferenceText());
    }
    if (getStartInclination() != null) {
      arrowLink.setAttribute("STARTINCLINATION", Tools.PointToXml(getStartInclination()));
    }
    if (getEndInclination() != null) {
      arrowLink.setAttribute("ENDINCLINATION", Tools.PointToXml(getEndInclination()));
    }
    if (getStartArrow() != null) arrowLink.setAttribute("STARTARROW", (getStartArrow()));
    if (getEndArrow() != null) arrowLink.setAttribute("ENDARROW", (getEndArrow()));
    return arrowLink;
  }
示例#2
0
  public XMLElement save() {
    if (style != null || color != null || width != WIDTH_PARENT) {
      XMLElement edge = new XMLElement();
      edge.setName("edge");

      if (style != null) {
        edge.setAttribute("STYLE", style);
      }
      if (color != null) {
        edge.setAttribute("COLOR", Tools.colorToXml(color));
      }
      if (width != WIDTH_PARENT) {
        if (width == WIDTH_THIN) edge.setAttribute("WIDTH", EDGE_WIDTH_THIN_STRING);
        else edge.setAttribute("WIDTH", Integer.toString(width));
      }
      return edge;
    }
    return null;
  }