/** User exits the dragging */ public void dragExit(DropTargetEvent dte) { dropIndex = -1; ExplorerDnDManager.getDefault().setMaybeExternalDragAndDrop( false ); stopDragging(); }
/** User exits the dragging */ public void dragExit(DropTargetEvent dte) { ExplorerDnDManager.getDefault().setMaybeExternalDragAndDrop( false ); dropIndex = -1; stopDragging(); }
/** User exits the dragging */ public void dragExit(DropTargetEvent dte) { ExplorerDnDManager.getDefault().setMaybeExternalDragAndDrop( false ); if (lastIndex >= 0) { NodeRenderer.dragExit(); list.repaint(list.getCellBounds(lastIndex, lastIndex)); } }
/** User is starting to drag over us */ public void dragEnter(DropTargetDragEvent dtde) { ExplorerDnDManager.getDefault().setMaybeExternalDragAndDrop( true ); int dropAction = ExplorerDnDManager.getDefault().getAdjustedDropAction( dtde.getDropAction(), view.getAllowedDropActions() ); lastIndex = indexWithCheck(dtde); if (lastIndex < 0) { dtde.rejectDrag(); } else { dtde.acceptDrag(dropAction); NodeRenderer.dragEnter(list.getModel().getElementAt(lastIndex)); list.repaint(list.getCellBounds(lastIndex, lastIndex)); } }
/** User drags over us */ public void dragOver(DropTargetDragEvent dtde) { ExplorerDnDManager.getDefault().setMaybeExternalDragAndDrop( true ); int dropAction = ExplorerDnDManager.getDefault().getAdjustedDropAction( dtde.getDropAction(), view.getAllowedDropActions() ); int index = indexWithCheck(dtde); if (index < 0) { dtde.rejectDrag(); if (lastIndex >= 0) { NodeRenderer.dragExit(); list.repaint(list.getCellBounds(lastIndex, lastIndex)); lastIndex = -1; } } else { dtde.acceptDrag(dropAction); if (lastIndex != index) { if (lastIndex < 0) { lastIndex = index; } NodeRenderer.dragExit(); NodeRenderer.dragEnter(list.getModel().getElementAt(index)); list.repaint(list.getCellBounds(lastIndex, index)); lastIndex = index; } } }
); ExplorerDnDManager.getDefault().setMaybeExternalDragAndDrop( false );
); ExplorerDnDManager.getDefault().setMaybeExternalDragAndDrop( false );
ExplorerDnDManager.getDefault().setMaybeExternalDragAndDrop( true );
ExplorerDnDManager.getDefault().setMaybeExternalDragAndDrop( true );