use of blue.udo.UDOCategory in project blue by kunstmusik.
the class UDOTreePopup method removeUDOCategory.
private void removeUDOCategory() {
UDOCategory category = (UDOCategory) userObj;
instrGUI.iLibrary.removeCategory(category);
}
use of blue.udo.UDOCategory in project blue by kunstmusik.
the class UDOTreePopup method addUDO.
private void addUDO(UserDefinedOpcode udo) {
UserDefinedOpcode newUDO = new UserDefinedOpcode(udo);
UDOCategory currentCategory = (UDOCategory) userObj;
instrGUI.iLibrary.addUDO(currentCategory, newUDO);
/*
* BlueUndoManager.setUndoManager("orchestra"); BlueUndoManager.addEdit(
* new AddEdit(orchTableModel, clone, new Integer(iNum)));
*/
}
use of blue.udo.UDOCategory in project blue by kunstmusik.
the class UDOTreeDropTarget method dragEnter.
@Override
public void dragEnter(DropTargetDragEvent dtde) {
if (!dtde.isDataFlavorSupported(TransferableUDO.UDO_FLAVOR) && !dtde.isDataFlavorSupported(TransferableUDO.UDO_CAT_FLAVOR)) {
dtde.rejectDrag();
return;
}
Point p = dtde.getLocation();
DropTargetContext dtc = dtde.getDropTargetContext();
JTree tree = (JTree) dtc.getComponent();
TreePath path = tree.getClosestPathForLocation(p.x, p.y);
if (path.getLastPathComponent() instanceof UDOCategory) {
dtde.acceptDrag(dtde.getDropAction());
} else if (dtde.isDataFlavorSupported(TransferableUDO.UDO_FLAVOR)) {
dtde.acceptDrag(dtde.getDropAction());
} else {
dtde.rejectDrag();
}
}
use of blue.udo.UDOCategory in project blue by kunstmusik.
the class UDOTreeDragSource 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 UserDefinedOpcode || path.getLastPathComponent() instanceof UDOCategory) {
oldNode = path.getLastPathComponent();
Object cloneNode;
if (oldNode instanceof UserDefinedOpcode) {
cloneNode = new UserDefinedOpcode((UserDefinedOpcode) oldNode);
} else {
cloneNode = new UDOCategory((UDOCategory) oldNode);
}
transferable = new TransferableUDO(cloneNode);
source.startDrag(dge, null, transferable, this);
DragManager.setDragSource(sourceTree);
}
}
Aggregations