use of blue.soundObject.editor.ScoreObjectEditor in project blue by kunstmusik.
the class ScoreObjectEditorTopComponent method editScoreObject.
public void editScoreObject(ScoreObject sObj) {
if (currentSoundObject == sObj) {
return;
}
currentSoundObject = sObj;
cardLayout.show(editPanel, "none");
if (sObj == null) {
// JOptionPane.showMessageDialog(null, "yo");
return;
}
ScoreObject sObjToEdit = sObj;
BlueData data = BlueProjectManager.getInstance().getCurrentBlueData();
if (sObj instanceof Instance) {
sObjToEdit = ((Instance) sObj).getSoundObject();
this.setEditingLibraryObject(SelectionEvent.SELECTION_LIBRARY);
} else if (data.getSoundObjectLibrary().contains(sObjToEdit)) {
this.setEditingLibraryObject(SelectionEvent.SELECTION_LIBRARY);
} else {
this.setEditingLibraryObject(null);
}
ScoreObjectEditor editor = editors.get(sObjToEdit.getClass());
if (editor == null) {
for (Class c : sObjEditorMap.keySet()) {
if (c.isAssignableFrom(sObjToEdit.getClass())) {
LazyPlugin<ScoreObjectEditor> plugin = sObjEditorMap.get(c);
editor = plugin.getInstance();
editors.put(sObjToEdit.getClass(), editor);
editPanel.add(editor, editor.getClass().getName());
break;
}
}
}
if (editor == null) {
DialogDisplayer.getDefault().notify(new NotifyDescriptor("Could not find editor for SoundObject of type: " + sObjToEdit.getClass().getCanonicalName(), "Error", NotifyDescriptor.DEFAULT_OPTION, NotifyDescriptor.ERROR_MESSAGE, null, null));
return;
}
editor.editScoreObject(sObjToEdit);
cardLayout.show(editPanel, editor.getClass().getName());
// Logger.getLogger(ScoreObjectEditorTopComponent.class.getName()).fine("SoundObject Selected: " + className);;
}
Aggregations