use of electric.xml.ParseException in project blue by kunstmusik.
the class UDORepositoryBrowser method populateUDOList.
/**
* @param tempCat
*/
protected void populateUDOList(UDOItem tempCat) {
if (tempCat.itemId >= 0) {
String result = null;
Vector<Integer> v = new Vector<>();
v.add(tempCat.itemId);
try {
result = (String) xrpc.execute("udo.getUDOList", v);
} catch (XmlRpcException | IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (result == null) {
System.out.println("Null List");
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();
DefaultListModel<UDOItem> listItems = new DefaultListModel<>();
Elements nodes = root.getElements();
while (nodes.hasMoreElements()) {
Element node = nodes.next();
UDOItem item = new UDOItem();
item.itemId = Integer.parseInt(node.getAttributeValue("udoId"));
item.itemName = node.getAttributeValue("name");
listItems.addElement(item);
}
udoList.setModel(listItems);
}
}
use of electric.xml.ParseException in project blue by kunstmusik.
the class CodeRepositoryMenu method reinitialize.
public static void reinitialize() {
menu = new JMenu("Custom");
try {
TreeNode root = CodeRepositoryManager.getCodeRepositoryTreeNode(true);
handleOpcodeDocCategory(menu, root);
} catch (ParseException ex) {
Exceptions.printStackTrace(ex);
}
}
use of electric.xml.ParseException in project blue by kunstmusik.
the class InstrumentImportPane method importInstrument.
private void importInstrument() {
InstrumentOption iOption = iTableModel.getInstrumentOption(instrumentTable.getSelectedRow());
if (iOption == null) {
return;
}
try {
Instrument instrument = BlueShareRemoteCaller.getInstrument(iOption);
if (instrument == null) {
String error = BlueSystem.getString("blueShare.importError");
JOptionPane.showMessageDialog(null, error, BlueSystem.getString("message.error"), JOptionPane.ERROR_MESSAGE);
return;
}
// data.getOrchestra().addInstrument(instrument);
// instrumentTreeModel.reload();
InstrumentLibrary instrLib = BlueSystem.getUserInstrumentLibrary();
instrLib.importInstrument(instrument);
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;
}
}
use of electric.xml.ParseException in project blue by kunstmusik.
the class EffectsLibrary method getInstance.
public static EffectsLibrary getInstance() {
if (library == null) {
String effectLibFileName = BlueSystem.getUserConfigurationDirectory() + File.separator + "effectsLibrary.xml";
File f = new File(effectLibFileName);
if (f.exists()) {
boolean error = false;
try {
Document doc = new Document(f);
library = EffectsLibrary.loadFromXML(doc.getRoot());
} catch (ParseException e1) {
e1.printStackTrace();
error = true;
} catch (Exception e) {
e.printStackTrace();
error = true;
}
if (error) {
JOptionPane.showMessageDialog(null, "There was an error loading " + f.getAbsolutePath() + "\nPlease fix this file or remove it and restart blue.", "Error", JOptionPane.ERROR_MESSAGE);
System.exit(0);
}
}
if (library == null) {
library = new EffectsLibrary();
System.out.println("Creating new Effects Library");
}
}
return library;
}
use of electric.xml.ParseException in project blue by kunstmusik.
the class AddToCodeRepositoryDialog method initTree.
public void initTree() {
TreeNode rootNode;
try {
rootNode = CodeRepositoryManager.getCodeRepositoryTreeNode(false);
categoryTree.setModel(new DefaultTreeModel(rootNode));
} catch (ParseException e) {
JOptionPane.showMessageDialog(this, "Error: There was an error trying to open or parse codeRepository.xml");
e.printStackTrace();
}
}
Aggregations