use of blue.soundObject.PythonObject in project blue by kunstmusik.
the class PythonEditor method editScoreObject.
@Override
public final void editScoreObject(ScoreObject sObj) {
this.pObj = null;
if (sObj == null) {
codeEditor.setText("null soundObject");
codeEditor.getJEditorPane().setEnabled(false);
processOnLoadCheckBox.setEnabled(false);
return;
}
if (!(sObj instanceof PythonObject)) {
codeEditor.setText("[ERROR] GenericEditor::editSoundObject - not instance " + "of GenericEditable");
codeEditor.getJEditorPane().setEnabled(false);
processOnLoadCheckBox.setEnabled(false);
return;
}
PythonObject tempPObj = (PythonObject) sObj;
codeEditor.setText(tempPObj.getText());
codeEditor.getJEditorPane().setEnabled(true);
codeEditor.getJEditorPane().setCaretPosition(0);
processOnLoadCheckBox.setSelected(tempPObj.isOnLoadProcessable());
processOnLoadCheckBox.setEnabled(true);
undo.discardAllEdits();
this.pObj = tempPObj;
}
use of blue.soundObject.PythonObject in project blue by kunstmusik.
the class ConvertToObjectBuilderAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
SoundObject temp = soundObjects.iterator().next();
int retVal = JOptionPane.showConfirmDialog(null, "This operation can not be undone.\nAre you sure?");
if (retVal != JOptionPane.OK_OPTION) {
return;
}
SoundLayer layer = (SoundLayer) scorePath.getGlobalLayerForY(p.y);
ObjectBuilder objBuilder = new ObjectBuilder();
if (temp instanceof PythonObject) {
PythonObject tempPython = (PythonObject) temp;
objBuilder.setName(tempPython.getName());
objBuilder.setNoteProcessorChain(tempPython.getNoteProcessorChain());
objBuilder.setTimeBehavior(tempPython.getTimeBehavior());
objBuilder.setStartTime(tempPython.getStartTime());
objBuilder.setSubjectiveDuration(tempPython.getSubjectiveDuration());
objBuilder.setCode(tempPython.getText());
objBuilder.setBackgroundColor(tempPython.getBackgroundColor());
} else if (temp instanceof External) {
External tempExt = (External) temp;
objBuilder.setName(tempExt.getName());
objBuilder.setNoteProcessorChain(tempExt.getNoteProcessorChain());
objBuilder.setTimeBehavior(tempExt.getTimeBehavior());
objBuilder.setStartTime(tempExt.getStartTime());
objBuilder.setSubjectiveDuration(tempExt.getSubjectiveDuration());
objBuilder.setCode(tempExt.getText());
objBuilder.setCommandLine(tempExt.getCommandLine());
objBuilder.setLanguageType(LanguageType.EXTERNAL);
objBuilder.setBackgroundColor(tempExt.getBackgroundColor());
} else {
return;
}
layer.remove(temp);
layer.add(objBuilder);
ScoreController.getInstance().removeSelectedScoreObject(temp);
ScoreController.getInstance().addSelectedScoreObject(objBuilder);
}
Aggregations