Search in sources :

Example 21 with UserDefinedOpcode

use of blue.udo.UserDefinedOpcode in project blue by kunstmusik.

the class UDORepositoryBrowser method addUDOtoOpcodeList.

/**
 */
protected void addUDOtoOpcodeList() {
    UserDefinedOpcode udo = udoDisplayPanel.getUDO();
    if (opcodeList == null || udo == null) {
        return;
    }
    this.opcodeList.addOpcode(udo);
}
Also used : UserDefinedOpcode(blue.udo.UserDefinedOpcode)

Example 22 with UserDefinedOpcode

use of blue.udo.UserDefinedOpcode 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);
    }
}
Also used : UDOCategory(blue.udo.UDOCategory) TreePath(javax.swing.tree.TreePath) UserDefinedOpcode(blue.udo.UserDefinedOpcode)

Aggregations

UserDefinedOpcode (blue.udo.UserDefinedOpcode)22 UDOCategory (blue.udo.UDOCategory)6 Point (java.awt.Point)6 IOException (java.io.IOException)4 File (java.io.File)3 TreePath (javax.swing.tree.TreePath)3 OpcodeList (blue.udo.OpcodeList)2 UnsupportedFlavorException (java.awt.datatransfer.UnsupportedFlavorException)2 FileWriter (java.io.FileWriter)2 PrintWriter (java.io.PrintWriter)2 HashMap (java.util.HashMap)2 Arrangement (blue.Arrangement)1 Parameter (blue.automation.Parameter)1 GenericInstrument (blue.orchestra.GenericInstrument)1 BSBCompilationUnit (blue.orchestra.blueSynthBuilder.BSBCompilationUnit)1 UDOLibrary (blue.udo.UDOLibrary)1 Document (electric.xml.Document)1 Element (electric.xml.Element)1 ParseException (electric.xml.ParseException)1 Rectangle (java.awt.Rectangle)1