/** Get the currently requested drop action. */ protected int getDropAction(DragSourceEvent ev) { if (ev instanceof DragSourceDragEvent) { DragSourceDragEvent e = (DragSourceDragEvent)ev; return e.getDropAction(); } if (ev instanceof DragSourceDropEvent) { return ((DragSourceDropEvent)ev).getDropAction(); } return NONE; }
/** Get the currently requested drop action. * @param ev event * @return effective drop action */ protected int getDropAction(DragSourceEvent ev) { if (ev instanceof DragSourceDragEvent) { DragSourceDragEvent e = (DragSourceDragEvent)ev; return e.getDropAction(); } if (ev instanceof DragSourceDropEvent) { return ((DragSourceDropEvent)ev).getDropAction(); } return NONE; }
public void dragDropEnd(DragSourceDropEvent e) { if (e.getDropSuccess()) { int nAction = e.getDropAction(); if (nAction == DnDConstants.ACTION_MOVE) { // The dragged item (pathSource) has been inserted at the target // selected by the user. // Now it is time to delete it from its original location. System.out.println("REMOVING: " + pathSource.getLastPathComponent()); // . // .. ask your TreeModel to delete the node // . pathSource = null; } } else { repaint(); } }
@Override public void dragDropEnd(DragSourceDropEvent event) { DragSourceContext context = event.getDragSourceContext(); context.setCursor(java.awt.Cursor.getDefaultCursor()); dragSource.endDrag(dragDescendant, getDropAction(event.getDropAction())); } });
@Override public void dragDropEnd(DragSourceDropEvent event) { DragSourceContext context = event.getDragSourceContext(); context.setCursor(java.awt.Cursor.getDefaultCursor()); dragSource.endDrag(dragDescendantArgument, getDropAction(event.getDropAction())); } });
public void dragDropEnd(DragSourceDropEvent dsde) { if (dsde.getDropSuccess() && dsde.getDropAction()==DnDConstants.ACTION_MOVE && draggedNodeParent != null) { ((DefaultTreeModel)tree.getModel()).nodeStructureChanged(draggedNodeParent); tree.expandPath(new TreePath(draggedNodeParent.getPath())); tree.expandPath(new TreePath(draggedNode.getPath())); } } public final void dragEnter(DragSourceDragEvent dsde) {
public void dragDropEnd(DragSourceDropEvent dsde) { DragSourceContext dsc = dsde.getDragSourceContext(); JComponent c = (JComponent) dsc.getComponent(); SynaptixTransferHandler th = (SynaptixTransferHandler) c .getTransferHandler(); clearDropDDCs(); if (dsde.getDropSuccess()) { th.exportDone(c, dsc.getTransferable(), dsde.getDropAction()); } else { th.exportDone(c, dsc.getTransferable(), NONE); } c.setAutoscrolls(scrolls); }
/** * as the operation completes */ @Override public void dragDropEnd(DragSourceDropEvent dsde) { DragSourceContext dsc = dsde.getDragSourceContext(); JComponent c = (JComponent) dsc.getComponent(); DefaultDrawingViewTransferHandler th = (DefaultDrawingViewTransferHandler) c.getTransferHandler(); if (dsde.getDropSuccess()) { th.exportDone(c, dsc.getTransferable(), dsde.getDropAction()); } else { th.exportDone(c, dsc.getTransferable(), NONE); } c.setAutoscrolls(scrolls); }