use of electric.xml.Element in project blue by kunstmusik.
the class BSBGroup method saveAsXML.
@Override
public Element saveAsXML() {
Element retVal = super.getBasicXML(this);
retVal.addElement("groupName").setText(getGroupName());
retVal.addElement("backgroundColor").setText(getBackgroundColor().toString());
retVal.addElement("borderColor").setText(getBorderColor().toString());
retVal.addElement("labelTextColor").setText(getLabelTextColor().toString());
retVal.addElement(XMLUtilities.writeBoolean("titleEnabled", isTitleEnabled()));
retVal.addElement("width").setText(Integer.toString(getWidth()));
retVal.addElement("height").setText(Integer.toString(getHeight()));
// retVal.setAttribute("editEnabled", Boolean.toString(isEditEnabled()));
for (BSBObject bsbObj : interfaceItems) {
retVal.addElement(bsbObj.saveAsXML());
}
return retVal;
}
use of electric.xml.Element in project blue by kunstmusik.
the class BSBHSlider method saveAsXML.
/*
* (non-Javadoc)
*
* @see blue.orchestra.blueSynthBuilder.BlueSynthBuilderObject#saveAsXML()
*/
@Override
public Element saveAsXML() {
Element retVal = getBasicXML(this);
retVal.setAttribute("version", "2");
retVal.addElement("minimum").setText(Double.toString(getMinimum()));
retVal.addElement("maximum").setText(Double.toString(getMaximum()));
retVal.addElement("bdresolution").setText(getResolution().toString());
retVal.addElement("value").setText(Double.toString(getValue()));
retVal.addElement("sliderWidth").setText(Integer.toString(getSliderWidth()));
retVal.addElement(XMLUtilities.writeBoolean("randomizable", isRandomizable()));
retVal.addElement(XMLUtilities.writeBoolean("valueDisplayEnabled", isValueDisplayEnabled()));
return retVal;
}
use of electric.xml.Element in project blue by kunstmusik.
the class BSBHSlider method loadFromXML.
public static BSBObject loadFromXML(Element data) {
BSBHSlider slider = new BSBHSlider();
double minVal = 0.0;
double maxVal = 1.0;
double val = 0.0;
BigDecimal res = new BigDecimal("0.1");
initBasicFromXML(data, slider);
String verString = data.getAttributeValue("version");
int version = (verString == null) ? 1 : Integer.parseInt(verString);
Elements nodes = data.getElements();
while (nodes.hasMoreElements()) {
Element node = nodes.next();
String nodeName = node.getName();
final String nodeText = node.getTextString();
switch(nodeName) {
case "minimum":
minVal = Double.parseDouble(nodeText);
break;
case "maximum":
maxVal = Double.parseDouble(nodeText);
break;
case "resolution":
res = new BigDecimal(Double.parseDouble(nodeText)).setScale(5, RoundingMode.HALF_UP).stripTrailingZeros();
break;
case "bdresolution":
res = new BigDecimal(nodeText);
break;
case "value":
val = Double.parseDouble(nodeText);
break;
case "sliderWidth":
slider.setSliderWidth(Integer.parseInt(nodeText));
break;
case "randomizable":
slider.setRandomizable(XMLUtilities.readBoolean(node));
break;
case "valueDisplayEnabled":
slider.setValueDisplayEnabled(XMLUtilities.readBoolean(node));
break;
}
}
slider.setValueProperty(new ClampedValue(minVal, maxVal, val, res));
return slider;
}
use of electric.xml.Element in project blue by kunstmusik.
the class BlueSynthBuilder method saveAsXML.
@Override
public Element saveAsXML() {
Element retVal = InstrumentUtilities.getBasicXML(this);
retVal.setAttribute("editEnabled", Boolean.toString(editEnabled));
retVal.addElement("globalOrc").setText(this.getGlobalOrc());
retVal.addElement("globalSco").setText(this.getGlobalSco());
retVal.addElement("instrumentText").setText(this.getInstrumentText());
retVal.addElement("alwaysOnInstrumentText").setText(this.getAlwaysOnInstrumentText());
retVal.addElement(graphicInterface.saveAsXML());
retVal.addElement(parameterList.saveAsXML());
retVal.addElement(presetGroup.saveAsXML());
retVal.addElement(opcodeList.saveAsXML());
return retVal;
}
use of electric.xml.Element in project blue by kunstmusik.
the class GenericInstrument method saveAsXML.
/*
* (non-Javadoc)
*
* @see blue.orchestra.Instrument#saveAsXML()
*/
@Override
public Element saveAsXML() {
Element retVal = InstrumentUtilities.getBasicXML(this);
retVal.addElement("globalOrc").setText(this.getGlobalOrc());
retVal.addElement("globalSco").setText(this.getGlobalSco());
retVal.addElement("instrumentText").setText(this.getText());
retVal.addElement(opcodeList.saveAsXML());
return retVal;
}
Aggregations