public void save(XMLElement element) {
   XMLElement child = new XMLElement();
   child.setName(NAME);
   super.saveAttributes(child);
   child.setAttribute(ATTRIBUTE, attribute);
   element.addChild(child);
 }
 protected void saveNameValuePairs(HashMap nameValuePairs, XMLElement xml) {
   XMLElement child = new XMLElement();
   child.setName(PARAMETERS);
   for (Iterator i = nameValuePairs.keySet().iterator(); i.hasNext(); ) {
     String key = (String) i.next();
     Object value = nameValuePairs.get(key);
     child.setAttribute(key, value);
   }
   xml.addChild(child);
 }
 protected HashMap loadNameValuePairs(XMLElement xml) {
   HashMap result = new HashMap();
   XMLElement child = (XMLElement) xml.getChildren().get(0);
   if (child != null && PARAMETERS.equals(child.getName())) {
     for (Iterator i = child.enumerateAttributeNames(); i.hasNext(); ) {
       String name = (String) i.next();
       result.put(name, child.getStringAttribute(name));
     }
   }
   return result;
 }
Пример #4
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;
  }
 static Condition load(XMLElement element) {
   return new AttributeNotExistsCondition(element.getStringAttribute(ATTRIBUTE));
 }
 /*
  * (non-Javadoc)
  *
  * @see freemind.extensions.PermanentNodeHook#save(freemind.main.XMLElement)
  */
 public void save(XMLElement xml) {
   String saveName = getName();
   // saveName=saveName.replace(File.separatorChar, '/');
   xml.setAttribute("name", saveName);
 }
Пример #7
0
  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;
  }