Search in sources :

Example 1 with SimpleXMLBuilder

use of org.jwildfire.create.tina.io.SimpleXMLBuilder in project JWildfire by thargor6.

the class FACLFlameWriter method getFlameXML.

public String getFlameXML(Flame pFlame) throws Exception {
    SimpleXMLBuilder xb = new SimpleXMLBuilder();
    List<SimpleXMLBuilder.Attribute<?>> flamesAttrList = new ArrayList<>();
    flamesAttrList.add(new Attribute<String>("name", ""));
    xb.beginElement("Flames", flamesAttrList);
    // Flame
    List<SimpleXMLBuilder.Attribute<?>> attrList = createFlameAttributes(pFlame, xb);
    Layer layer = pFlame.getFirstLayer();
    xb.beginElement("flame", attrList);
    // XForm
    for (XForm xForm : layer.getXForms()) {
        xb.emptyElement("xform", createXFormAttrList(xb, layer, xForm));
    }
    // FinalXForms
    for (XForm xForm : layer.getFinalXForms()) {
        xb.emptyElement("finalxform", createXFormAttrList(xb, layer, xForm));
    }
    // Gradient
    addGradient(xb, layer);
    xb.endElement("flame");
    xb.endElement("Flames");
    return xb.buildXML();
}
Also used : Attribute(org.jwildfire.create.tina.io.SimpleXMLBuilder.Attribute) XForm(org.jwildfire.create.tina.base.XForm) SimpleXMLBuilder(org.jwildfire.create.tina.io.SimpleXMLBuilder) ArrayList(java.util.ArrayList) Layer(org.jwildfire.create.tina.base.Layer)

Aggregations

ArrayList (java.util.ArrayList)1 Layer (org.jwildfire.create.tina.base.Layer)1 XForm (org.jwildfire.create.tina.base.XForm)1 SimpleXMLBuilder (org.jwildfire.create.tina.io.SimpleXMLBuilder)1 Attribute (org.jwildfire.create.tina.io.SimpleXMLBuilder.Attribute)1