use of blue.soundObject.ObjectBuilder in project blue by kunstmusik.
the class ObjectBuilderEditor method editScoreObject.
@Override
public void editScoreObject(ScoreObject sObj) {
if (sObj == null || !(sObj instanceof ObjectBuilder)) {
this.objectBuilder = null;
System.err.println("[ERROR] ObjectBuilder::editSoundObject - " + "not instance of ObjectBuilder");
return;
}
if (this.objectBuilder != null) {
final ObjectBuilder temp = this.objectBuilder;
BlueFX.runOnFXThread(() -> temp.commentProperty().unbind());
}
this.objectBuilder = (ObjectBuilder) sObj;
PresetGroup presetGroup = objectBuilder.getPresetGroup();
BSBGraphicInterface graphicInterface = objectBuilder.getGraphicInterface();
this.interfaceEditor.editInterface(graphicInterface, presetGroup);
this.codeEditor.editObjectBuilder(objectBuilder);
BlueFX.runOnFXThread(() -> {
commentTextArea.setText(this.objectBuilder.getComment());
this.objectBuilder.commentProperty().bind(commentTextArea.textProperty());
});
}
use of blue.soundObject.ObjectBuilder in project blue by kunstmusik.
the class SoundObjectExportPane method jbInit.
private void jbInit() throws Exception {
this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
soundObjectListPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
categoryPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
cateogriesLabel.setText(BlueSystem.getString("common.categories"));
categoryPanel.setLayout(new BorderLayout());
this.add(namePasswordPanel, BorderLayout.NORTH);
this.add(mainSplitPane, BorderLayout.CENTER);
this.add(jPanel2, BorderLayout.SOUTH);
descriptionText.setText(BlueSystem.getString("blueShare.enterDescription"));
descriptionText.setLineWrap(true);
descriptionScrollPane.setBorder(new TitledBorder(null, BlueSystem.getString("blueShare.instrDescription")));
submitButton.setText(BlueSystem.getString("common.submit"));
soundObjectListPanel.setLayout(new BorderLayout());
iLabel.setText("SoundObjects from Library");
// soundObjectLibraryTree.setSelectionModel(TreeSelectionModel.SINGLE_TREE_SELECTION);
topSplitPane.add(soundObjectListPanel, JSplitPane.LEFT);
soundObjectListPanel.add(soundObjectListScrollPane, BorderLayout.CENTER);
soundObjectListPanel.add(iLabel, BorderLayout.NORTH);
soundObjectListScrollPane.getViewport().add(soundObjectLibraryTree, null);
descriptionScrollPane.getViewport().add(descriptionText, null);
jPanel2.add(submitButton, null);
topSplitPane.setDividerLocation(300);
mainSplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
mainSplitPane.add(topSplitPane, JSplitPane.TOP);
mainSplitPane.add(descriptionScrollPane, JSplitPane.BOTTOM);
topSplitPane.add(categoryPanel, JSplitPane.RIGHT);
categoryPanel.add(cateogriesLabel, BorderLayout.NORTH);
categoryPanel.add(categoryScrollPane, BorderLayout.CENTER);
categoryScrollPane.getViewport().add(categoryTree, null);
mainSplitPane.setDividerLocation(200);
submitButton.addActionListener((ActionEvent e) -> {
submitSoundObject();
});
soundObjectLibraryTree.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
TreePath path = soundObjectLibraryTree.getSelectionPath();
if (path == null) {
descriptionText.setText(SELECT_INSTR_TEXT);
descriptionText.setEnabled(false);
return;
}
Object userObj = path.getLastPathComponent();
TreeItem<LibraryItem<SoundObject>> node = (TreeItem<LibraryItem<SoundObject>>) userObj;
if (!node.isLeaf()) {
descriptionText.setText(SELECT_INSTR_TEXT);
descriptionText.setEnabled(false);
return;
}
SoundObject instr = node.getValue().getValue();
if (instr instanceof Sound) {
descriptionText.setText(((Sound) instr).getComment());
} else if (instr instanceof ObjectBuilder) {
descriptionText.setText(((ObjectBuilder) instr).getComment());
} else {
descriptionText.setText("");
}
descriptionText.setEnabled(true);
}
});
}
use of blue.soundObject.ObjectBuilder in project blue by kunstmusik.
the class ObjectBuilderCodeEditor method main.
public static void main(String[] args) {
GUI.setBlueLookAndFeel();
ObjectBuilderCodeEditor codeEditor = new ObjectBuilderCodeEditor();
codeEditor.editObjectBuilder(new ObjectBuilder());
GUI.showComponentAsStandalone(codeEditor, "ObjectBuilder Code Editor", true);
}
use of blue.soundObject.ObjectBuilder in project blue by kunstmusik.
the class ObjectBuilderEditor method main.
public static void main(String[] args) {
GUI.setBlueLookAndFeel();
ObjectBuilderEditor objBuilderEditor = new ObjectBuilderEditor();
objBuilderEditor.editScoreObject(new ObjectBuilder());
GUI.showComponentAsStandalone(objBuilderEditor, "ObjectBuilder Editor", true);
}
use of blue.soundObject.ObjectBuilder 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