List of usage examples for java.awt.dnd DragSourceDragEvent getLocation
public Point getLocation()
From source file:com.qspin.qtaste.ui.TestCaseTree.java
public void dragOver(DragSourceDragEvent dsde) { //// w w w . j a v a2 s . c om Point dropPoint = dsde.getLocation(); TreePath path = getPathForLocation(dropPoint.x, dropPoint.y); if (path == null) return; Object targetNode = path.getLastPathComponent(); if (targetNode instanceof TCTreeNode) { TCTreeNode tcTreeNode = (TCTreeNode) targetNode; if (tcTreeNode.getUserObject() instanceof FileNode) { FileNode fn = (FileNode) tcTreeNode.getUserObject(); } } }
From source file:org.rdv.ui.DataPanelContainer.java
public void dragOver(DragSourceDragEvent e) { Point dragPoint = e.getLocation(); Point containerLocation = getLocationOnScreen(); dragPoint.translate(-containerLocation.x, -containerLocation.y); Component overComponent = getComponentAt(dragPoint); Component dragComponent = e.getDragSourceContext().getComponent(); if (overComponent != null && overComponent != dragComponent) { moveBefore(dragComponent, overComponent); }// www . j av a2s. c o m }