use of electric.xml.Document in project blue by kunstmusik.
the class WindowSettingManager method load.
private void load() {
String userDir = BlueSystem.getUserConfigurationDirectory();
String settingsFile = userDir + File.separator + SETTINGS_FILE_NAME;
File f = new File(settingsFile);
if (!f.exists()) {
return;
}
try {
Document doc = new Document(f);
Element root = doc.getRoot();
Elements nodes = root.getElements();
while (nodes.hasMoreElements()) {
Element node = nodes.next();
String key = node.getAttributeValue("windowName");
settings.put(key, node);
}
} catch (ParseException e) {
e.printStackTrace();
}
}
use of electric.xml.Document in project blue by kunstmusik.
the class UDORepositoryBrowser method populateUDOList.
/**
* @param itemId
*/
protected void populateUDOList(int itemId) {
if (itemId >= 0) {
String result = null;
Vector<Integer> v = new Vector<>();
v.add(new Integer(itemId));
try {
result = (String) xrpc.execute("udo.getUDO", v);
} catch (XmlRpcException | IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (result == null) {
System.err.println("Null Opcode");
return;
}
Document doc = null;
try {
doc = new Document(result);
} catch (ParseException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
if (doc == null) {
return;
}
// System.out.println(doc.toString());
Element root = doc.getRoot();
udoDisplayPanel.setUDO(root);
}
}
use of electric.xml.Document in project blue by kunstmusik.
the class UDORepositoryBrowser method refreshCategoriesList.
public void refreshCategoriesList() {
String result = null;
try {
result = (String) xrpc.execute("udo.getUDOCategoryTree", new Vector<Object>());
} catch (XmlRpcException | IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (result == null) {
return;
}
Document doc = null;
try {
doc = new Document(result);
} catch (ParseException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
if (doc == null) {
return;
}
Element root = doc.getRoot();
DefaultMutableTreeNode rootNode = getCategory(root);
categories.setModel(new DefaultTreeModel(rootNode));
}
use of electric.xml.Document in project blue by kunstmusik.
the class EffectsUtil method importEffect.
public static Effect importEffect() {
List<File> retVal = FileChooserManager.getDefault().showOpenDialog(IMPORT_DIALOG, WindowManager.getDefault().getMainWindow());
Effect effect = null;
if (!retVal.isEmpty()) {
File f = retVal.get(0);
Document doc;
try {
doc = new Document(f);
Element root = doc.getRoot();
if (root.getName().equals("effect")) {
effect = Effect.loadFromXML(root);
} else {
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), "Error: File did not contain Effect", "Error", JOptionPane.ERROR_MESSAGE);
}
} catch (Exception ex) {
ex.printStackTrace();
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), "Error: Could not read Effect from file", "Error", JOptionPane.ERROR_MESSAGE);
}
}
return effect;
}
use of electric.xml.Document in project blue by kunstmusik.
the class BlueShareRemoteCaller method getInstrumentCategoryTree.
public static BlueShareInstrumentCategory[] getInstrumentCategoryTree() throws IOException, XmlRpcException, ParseException {
Vector v = new Vector();
String result;
Document doc;
result = (String) xrpc.execute("blueShare.getInstrumentCategoryTree", v);
doc = new Document(result);
Element root = doc.getRoot();
return getSubCategories(root);
}
Aggregations