private void addChannel(Document doc, Element root, Integer channel, HashSet<Integer> values) { Element el = doc.createElement(_channel); Attr attr = doc.createAttribute(_number); attr.setValue(Integer.toString(channel + 1)); el.setAttributeNode(attr); Text txt; for (Integer x : values) { txt = doc.createTextNode(x.toString()); el.appendChild(txt); } root.appendChild(el); }
private void addFade(Document doc, Element root, FadeData fade) { Element el = doc.createElement(_cue); Attr attr; attr = doc.createAttribute(_number); attr.setValue(Integer.toString(fade.getCueNumber())); el.setAttributeNode(attr); attr = doc.createAttribute(_uptime); attr.setValue(Integer.toString(fade.getUpTime())); el.setAttributeNode(attr); attr = doc.createAttribute(_downTime); attr.setValue(Integer.toString(fade.getDownTime())); el.setAttributeNode(attr); attr = doc.createAttribute(_upTimeDelay); attr.setValue(Integer.toString(fade.getDelayUpTime())); el.setAttributeNode(attr); attr = doc.createAttribute(_downTimeDelay); attr.setValue(Integer.toString(fade.getDelayDownTime())); el.setAttributeNode(attr); if (fade.getFollowTime() >= 0) { attr = doc.createAttribute(_followtime); attr.setValue(Integer.toString(fade.getFollowTime())); el.setAttributeNode(attr); } if (fade.getNextCue() > 0) { attr = doc.createAttribute(_nextCue); attr.setValue(Integer.toString(fade.getNextCue())); el.setAttributeNode(attr); } CueData cue = fade.getCue(); attr = doc.createAttribute(_discription); attr.setValue(cue.getDescription()); el.setAttributeNode(attr); for (Integer chan : cue.keySet()) addChannel(doc, el, chan, cue.get(chan)); root.appendChild(el); }
private void addMagicChannel(Document doc, Element root, int channel, double x, double y) { Element el = doc.createElement(_channel); // Element xel = doc.createElement(_x); // Element yel = doc.createElement(_y); Attr attr = doc.createAttribute(_number); attr.setValue(Integer.toString(channel + 1)); el.setAttributeNode(attr); attr = doc.createAttribute(_x); attr.setValue(Double.toString(x)); el.setAttributeNode(attr); attr = doc.createAttribute(_y); attr.setValue(Double.toString(y)); el.setAttributeNode(attr); // xel.appendChild(doc.createTextNode(Integer.toString(x))); // yel.appendChild(doc.createTextNode(Integer.toString(y))); // el.appendChild(xel); // el.appendChild(yel); root.appendChild(el); }