use of blue.orchestra.Instrument in project blue by kunstmusik.
the class UserInstrumentTreePopup method copyNode.
protected void copyNode() {
if (userObj == instrGUI.iLibrary.getRoot()) {
return;
}
Object bufferedObj;
if (userObj instanceof Instrument) {
bufferedObj = ((Instrument) userObj).deepCopy();
} else {
bufferedObj = new InstrumentCategory((InstrumentCategory) userObj);
}
CopyBuffer.setBufferedObject(CopyBuffer.INSTRUMENT, userObj);
}
use of blue.orchestra.Instrument in project blue by kunstmusik.
the class InstrumentTreeDragSource method dragGestureRecognized.
@Override
public void dragGestureRecognized(DragGestureEvent dge) {
TreePath path = sourceTree.getSelectionPath();
if ((path == null) || (path.getPathCount() <= 1)) {
// We can't really move the root node (or an empty selection).
return;
}
if (path.getLastPathComponent() instanceof Instrument || path.getLastPathComponent() instanceof InstrumentCategory) {
oldNode = path.getLastPathComponent();
Object cloneNode = null;
if (oldNode instanceof Instrument) {
cloneNode = ((Instrument) oldNode).deepCopy();
} else if (oldNode instanceof InstrumentCategory) {
cloneNode = new InstrumentCategory((InstrumentCategory) oldNode);
}
transferable = new TransferableInstrument(cloneNode);
source.startDrag(dge, null, transferable, this);
DragManager.setDragSource(sourceTree);
}
}
use of blue.orchestra.Instrument in project blue by kunstmusik.
the class UserInstrumentTreePopup method addInstrument.
private void addInstrument(Instrument instr) {
Instrument newInstrument = (Instrument) instr.deepCopy();
InstrumentCategory currentCategory = (InstrumentCategory) userObj;
instrGUI.iLibrary.addInstrument(currentCategory, newInstrument);
/*
* BlueUndoManager.setUndoManager("orchestra"); BlueUndoManager.addEdit(
* new AddEdit(orchTableModel, clone, new Integer(iNum)));
*/
}
use of blue.orchestra.Instrument in project blue by kunstmusik.
the class UserInstrumentTreePopup method removeInstrument.
private void removeInstrument() {
Instrument instrument = (Instrument) userObj;
instrGUI.removeInstrument(instrument);
}
use of blue.orchestra.Instrument in project blue by kunstmusik.
the class ArrangementEditPanel method pasteInstrument.
public void pasteInstrument() {
Object obj = CopyBuffer.getBufferedObject(CopyBuffer.INSTRUMENT);
if (obj == null || !(obj instanceof Instrument)) {
return;
}
Instrument instr = (Instrument) obj;
Instrument clone = (Instrument) instr.deepCopy();
if (clone instanceof BlueSynthBuilder) {
((BlueSynthBuilder) clone).clearParameters();
}
addInstrument(clone);
}
Aggregations