use of electric.xml.ParseException in project blue by kunstmusik.
the class BlueShareRemoteCaller method getSoundObject.
public static SoundObject getSoundObject(SoundObjectOption iOption) throws IOException, XmlRpcException, ParseException {
Vector v = new Vector();
String result;
v.add(new Integer(iOption.getSoundObjectId()));
result = (String) xrpc.execute("blueShare.getSoundObject", v);
SoundObject soundObject = null;
try {
Document d = new Document(result);
soundObject = (SoundObject) ObjectUtilities.loadFromXML(d.getRoot(), new HashMap<>());
} catch (Exception e) {
}
return soundObject;
}
use of electric.xml.ParseException 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.ParseException 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.ParseException 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.ParseException in project blue by kunstmusik.
the class SoundObjectImportPane method importSoundObject.
private void importSoundObject() {
SoundObjectOption iOption = iTableModel.getSoundObjectOption(instrumentTable.getSelectedRow());
if (iOption == null) {
return;
}
try {
SoundObject soundObject = BlueShareRemoteCaller.getSoundObject(iOption);
if (soundObject == null) {
String error = "Error: Could not import this SoundObject.";
JOptionPane.showMessageDialog(null, error, BlueSystem.getString("message.error"), JOptionPane.ERROR_MESSAGE);
return;
}
// data.getOrchestra().addSoundObject(instrument);
// instrumentTreeModel.reload();
Library<SoundObject> instrLib = BlueSystem.getSoundObjectLibrary();
importSoundObjectToLibrary(instrLib, soundObject);
String message = BlueSystem.getString("blueShare.importSuccess");
JOptionPane.showMessageDialog(null, message, BlueSystem.getString("common.success"), JOptionPane.PLAIN_MESSAGE);
} catch (ParseException pe) {
String error = BlueSystem.getString("blueShare.selectServer.couldNotReadResponse");
JOptionPane.showMessageDialog(null, error, BlueSystem.getString("message.error"), JOptionPane.ERROR_MESSAGE);
return;
} catch (XmlRpcException xre) {
String error = "Error: " + xre.getLocalizedMessage();
JOptionPane.showMessageDialog(null, error, BlueSystem.getString("message.error"), JOptionPane.ERROR_MESSAGE);
return;
} catch (IOException ioe) {
String error = "Error: " + ioe.getLocalizedMessage();
JOptionPane.showMessageDialog(null, error, BlueSystem.getString("message.error"), JOptionPane.ERROR_MESSAGE);
return;
}
}
Aggregations