Search in sources :

Example 26 with XMLElement

use of net.n3.nanoxml.XMLElement in project freeplane by freeplane.

the class TimeWindowColumnSetting method marschall.

void marschall(final XMLElement xml) {
    final XMLElement child = new XMLElement("time_window_column_setting");
    child.setAttribute("column_sorting", Integer.toString(columnSorting));
    child.setAttribute("column_width", Integer.toString(columnWidth));
    xml.addChild(child);
}
Also used : XMLElement(org.freeplane.n3.nanoxml.XMLElement)

Example 27 with XMLElement

use of net.n3.nanoxml.XMLElement in project freeplane by freeplane.

the class NoteWriter method writeContent.

/*
	 * (non-Javadoc)
	 * @see freeplane.io.INodeWriter#saveContent(freeplane.io.ITreeWriter,
	 * java.lang.Object, java.lang.String)
	 */
public void writeContent(final ITreeWriter writer, final Object element, final IExtension note) throws IOException {
    RichTextModel note1 = (RichTextModel) note;
    if (note1.getXml() != null) {
        final XMLElement htmlElement = new XMLElement();
        htmlElement.setName(NodeTextBuilder.XML_NODE_XHTML_CONTENT_TAG);
        if (note instanceof NoteModel) {
            htmlElement.setAttribute(NodeTextBuilder.XML_NODE_XHTML_TYPE_TAG, NodeTextBuilder.XML_NODE_XHTML_TYPE_NOTE);
        } else {
            htmlElement.setAttribute(NodeTextBuilder.XML_NODE_XHTML_TYPE_TAG, "UNKNOWN");
        }
        final String content = note1.getXml().replace('\0', ' ');
        writer.addElement('\n' + content + '\n', htmlElement);
    }
    return;
}
Also used : RichTextModel(org.freeplane.features.text.RichTextModel) XMLElement(org.freeplane.n3.nanoxml.XMLElement)

Example 28 with XMLElement

use of net.n3.nanoxml.XMLElement in project freeplane by freeplane.

the class MapStyle method saveConditionalStyles.

private void saveConditionalStyles(ConditionalStyleModel conditionalStyleModel, XMLElement parent, boolean createRoot) {
    final int styleCount = conditionalStyleModel.getStyleCount();
    if (styleCount == 0) {
        return;
    }
    final XMLElement conditionalStylesRoot;
    if (createRoot) {
        conditionalStylesRoot = parent.createElement("conditional_styles");
        parent.addChild(conditionalStylesRoot);
    } else
        conditionalStylesRoot = parent;
    for (final Item item : conditionalStyleModel) {
        item.toXml(conditionalStylesRoot);
    }
}
Also used : Item(org.freeplane.features.styles.ConditionalStyleModel.Item) XMLElement(org.freeplane.n3.nanoxml.XMLElement)

Example 29 with XMLElement

use of net.n3.nanoxml.XMLElement in project freeplane by freeplane.

the class ScriptAddOnProperties method toXml.

public XMLElement toXml() {
    final XMLElement xmlElement = super.toXml();
    addScriptsAsChild(xmlElement);
    addLibAsChild(xmlElement);
    return xmlElement;
}
Also used : XMLElement(org.freeplane.n3.nanoxml.XMLElement)

Example 30 with XMLElement

use of net.n3.nanoxml.XMLElement in project freeplane by freeplane.

the class ScriptAddOnProperties method addLibAsChild.

private void addLibAsChild(XMLElement parent) {
    final XMLElement xmlElement = new XMLElement("libs");
    if (lib != null) {
        for (String l : lib) {
            final XMLElement libElement = new XMLElement("lib");
            libElement.setAttribute("name", l);
            xmlElement.addChild(libElement);
        }
    }
    parent.addChild(xmlElement);
}
Also used : XMLElement(org.freeplane.n3.nanoxml.XMLElement)

Aggregations

XMLElement (org.freeplane.n3.nanoxml.XMLElement)65 IOException (java.io.IOException)8 IXMLParser (org.freeplane.n3.nanoxml.IXMLParser)6 IXMLReader (org.freeplane.n3.nanoxml.IXMLReader)6 StdXMLReader (org.freeplane.n3.nanoxml.StdXMLReader)6 ASelectableCondition (org.freeplane.features.filter.condition.ASelectableCondition)5 NodeModel (org.freeplane.features.map.NodeModel)5 BufferedInputStream (java.io.BufferedInputStream)4 File (java.io.File)4 FileInputStream (java.io.FileInputStream)4 XMLWriter (org.freeplane.n3.nanoxml.XMLWriter)4 Color (java.awt.Color)3 FileWriter (java.io.FileWriter)3 Writer (java.io.Writer)3 IXMLElement (net.n3.nanoxml.IXMLElement)3 XMLElement (net.n3.nanoxml.XMLElement)3 Point (java.awt.Point)2 HashMap (java.util.HashMap)2 LinkedHashMap (java.util.LinkedHashMap)2 Locale (java.util.Locale)2