List of usage examples for java.awt.dnd DropTargetDragEvent getLocation
public Point getLocation()
From source file:org.pentaho.reporting.designer.core.util.dnd.GenericDNDHandler.java
/** * Called when a drag operation is ongoing, while the mouse pointer is still over the operable part of the drop site * for the <code>DropTarget</code> registered with this listener. * * @param dtde the <code>DropTargetDragEvent</code> *///from w ww .j ava 2s .c o m public void dragOver(final DropTargetDragEvent dtde) { final Transferable transferable = dtde.getTransferable(); for (int i = 0; i < acceptedFlavors.length; i++) { final DataFlavor acceptedFlavor = acceptedFlavors[i]; if (transferable.isDataFlavorSupported(acceptedFlavor)) { // a transfer from the palette. try { transferData = transferable.getTransferData(acceptedFlavor); position = dtde.getLocation(); flavor = acceptedFlavor; final int result = updateDragOver(dtde); if (result > 0) { dtde.acceptDrag(DnDConstants.ACTION_COPY); } else { transferData = null; position = null; flavor = null; dtde.rejectDrag(); } break; } catch (Exception e) { if (logger.isDebugEnabled()) { logger.debug("ReportPanel.dragOver ", e); // NON-NLS } transferData = null; position = null; flavor = null; dtde.rejectDrag(); } } } }