boolean (DnDEvent event) { final Object o = event.getAttachedObject(); if (! (o instanceof RowDragInfo) || ((RowDragInfo)o).component != component) { event.setDropPossible(false, ""); return true; } event.setDropPossible(true); int oldIndex = ((RowDragInfo)o).row; int newIndex = getRow(component, event.getPoint()); if (newIndex == -1) { event.setDropPossible(false, ""); return true; } Rectangle cellBounds = getCellBounds(component, newIndex); if (model instanceof RefinedDropSupport) { RefinedDropSupport.Position position = ((RefinedDropSupport)model).isDropInto(component, oldIndex, newIndex) ? INTO : (event.getPoint().y < cellBounds.y + cellBounds.height / 2) ? ABOVE : BELOW; boolean canDrop = ((RefinedDropSupport)model).canDrop(oldIndex, newIndex, position); event.setDropPossible(canDrop); if (canDrop && oldIndex != newIndex) { switch (position) { case INTO: event.setHighlighting(new RelativeRectangle(component, cellBounds), DnDEvent.DropTargetHighlightingType.RECTANGLE); break; case BELOW: cellBounds.y += cellBounds.height; case ABOVE: cellBounds.y -= -1; cellBounds.height = 2; event.setHighlighting(new RelativeRectangle(component, cellBounds), DnDEvent.DropTargetHighlightingType.FILLED_RECTANGLE); break; } } else { event.hideHighlighter(); } } else if (oldIndex != newIndex) { // Drag&Drop always starts with new==old and we shouldn't display 'rejecting' cursor if they are equal boolean canExchange = model.canExchangeRows(oldIndex, newIndex); if (canExchange) { if (oldIndex < newIndex) { cellBounds.y += cellBounds.height - 2; } RelativeRectangle rectangle = new RelativeRectangle(component, cellBounds); rectangle.getDimension().height = 2; event.setDropPossible(true); event.setHighlighting(rectangle, DnDEvent.DropTargetHighlightingType.FILLED_RECTANGLE); } else { event.setDropPossible(false); } } return true; }