Search in sources :

Example 66 with Element

use of electric.xml.Element in project blue by kunstmusik.

the class LiveDataTest method testSerialization.

public void testSerialization() {
    LiveData liveData = new LiveData();
    final LiveObjectBins liveObjectBins = liveData.getLiveObjectBins();
    liveObjectBins.setLiveObject(0, 0, new LiveObject(new GenericScore()));
    liveObjectBins.setLiveObject(0, 2, new LiveObject(new GenericScore()));
    liveObjectBins.setLiveObject(0, 4, new LiveObject(new GenericScore()));
    liveObjectBins.setLiveObject(0, 6, new LiveObject(new GenericScore()));
    Element elem1 = liveData.saveAsXML(null);
    Element elem2;
    try {
        elem2 = LiveData.loadFromXML(elem1, null).saveAsXML(null);
        System.out.println(elem1.toString() + "\n\n" + elem2.toString());
        assertEquals(elem1.toString(), elem2.toString());
    } catch (Exception ex) {
        ex.printStackTrace();
        fail("Did not load from xml");
    }
}
Also used : LiveObjectBins(blue.blueLive.LiveObjectBins) Element(electric.xml.Element) GenericScore(blue.soundObject.GenericScore) LiveObject(blue.blueLive.LiveObject)

Example 67 with Element

use of electric.xml.Element in project blue by kunstmusik.

the class XMLUtilities method writeDouble.

public static Element writeDouble(String nodeName, double val) {
    Element elem = new Element(nodeName);
    elem.setText(Double.toString(val));
    return elem;
}
Also used : Element(electric.xml.Element)

Example 68 with Element

use of electric.xml.Element in project blue by kunstmusik.

the class XMLUtilities method writeBoolean.

public static Element writeBoolean(String nodeName, boolean val) {
    Element elem = new Element(nodeName);
    elem.setText(Boolean.toString(val));
    return elem;
}
Also used : Element(electric.xml.Element)

Example 69 with Element

use of electric.xml.Element in project blue by kunstmusik.

the class XMLUtilities method writeInt.

public static Element writeInt(String nodeName, int val) {
    Element elem = new Element(nodeName);
    elem.setText(Integer.toString(val));
    return elem;
}
Also used : Element(electric.xml.Element)

Example 70 with Element

use of electric.xml.Element in project blue by kunstmusik.

the class Random method saveAsXML.

@Override
public Element saveAsXML() {
    Element retVal = new Element("generator");
    retVal.setAttribute("type", getClass().getName());
    retVal.addElement("min").setText(Double.toString(min));
    retVal.addElement("max").setText(Double.toString(max));
    return retVal;
}
Also used : Element(electric.xml.Element)

Aggregations

Element (electric.xml.Element)310 Elements (electric.xml.Elements)120 Document (electric.xml.Document)22 Vector (java.util.Vector)14 Iterator (java.util.Iterator)12 File (java.io.File)10 BigDecimal (java.math.BigDecimal)10 IOException (java.io.IOException)8 SoundObject (blue.soundObject.SoundObject)7 ParseException (electric.xml.ParseException)7 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)4 EffectOption (blue.tools.blueShare.effects.EffectOption)3 InstrumentOption (blue.tools.blueShare.instruments.InstrumentOption)3 SoundObjectOption (blue.tools.blueShare.soundObjects.SoundObjectOption)3 OpcodeList (blue.udo.OpcodeList)3 Test (org.junit.Test)3 ParameterList (blue.automation.ParameterList)2 LiveObject (blue.blueLive.LiveObject)2 LiveObjectBins (blue.blueLive.LiveObjectBins)2 Line (blue.components.lines.Line)2