InputEvent ie = event.getTriggerEvent();  if ((ie.getModifiers() & InputEvent.BUTTON3_MASK) != 0) return;
  public void dragGestureRecognized(DragGestureEvent event) {    if (!isEditable()) return; // if tree isn't editable, return    DefaultMutableTreeNode target = getDropTarget(event.getDragOrigin());    if (target == null) return; // Nothing to drag.    TreePath[] paths = getSelectionPaths();    boolean doMultiDrag =      paths != null && paths.length > 1 && supportsMultiDrag();    if (doMultiDrag) {      boolean targetIsSelected = false;      for (int i = 0; i < paths.length; i++) {        DefaultMutableTreeNode node =          (DefaultMutableTreeNode) paths[i].getLastPathComponent();        if (!isDraggable(node)) {          doMultiDrag = false;          break;        }        if (node == target) targetIsSelected = true;      }      if (!targetIsSelected) doMultiDrag = false;    }    if (doMultiDrag) {      dragSourceNodes = new DefaultMutableTreeNode[paths.length];      for (int i = 0; i < paths.length; i++) {        dragSourceNodes[i] =          (DefaultMutableTreeNode) paths[i].getLastPathComponent();      }//        System.out.println("Multi-drag " + dragSourceNodes.length + " nodes");      Transferable draggableObject =        makeDraggableObject(new DMTNArray(dragSourceNodes));      dragSource.startDrag(event, DragSource.DefaultMoveDrop,                            draggableObject, this);    } else {      selectNode(target);      if (isDraggable(target)) {        dragSourceNodes = new DefaultMutableTreeNode[] {target};        Transferable draggableObject = makeDraggableObject(target);        dragSource.startDrag(event, DragSource.DefaultMoveDrop,                              draggableObject, this);      }    }  }