use of blue.soundObject.External 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