/** User drag over us */ public void dragOver(DropTargetDragEvent dtde) { if (!checkConditions(dtde)) { dtde.rejectDrag(); if (lastIndex >= 0) { cellRenderer.draggingExit(); comp.repaint(comp.getCellBounds(lastIndex, lastIndex)); lastIndex = -1; } } else { dtde.acceptDrag(DnDConstants.ACTION_MOVE); int index = comp.locationToIndex(dtde.getLocation()); if (lastIndex == index) cellRenderer.draggingOver(index, ids.getDragGestureEvent().getDragOrigin(), dtde.getLocation()); else { if (lastIndex < 0) lastIndex = index; cellRenderer.draggingExit(); cellRenderer.draggingEnter(index, ids.getDragGestureEvent().getDragOrigin(), dtde.getLocation()); comp.repaint(comp.getCellBounds(lastIndex, index)); lastIndex = index; } } }
/** User drag over us */ public void dragOver(DropTargetDragEvent dtde) { if (!checkConditions(dtde)) { dtde.rejectDrag(); if (lastIndex >= 0) { cellRenderer.draggingExit(); comp.repaint(comp.getCellBounds(lastIndex, lastIndex)); lastIndex = -1; } } else { dtde.acceptDrag(DnDConstants.ACTION_MOVE); int index = comp.locationToIndex(dtde.getLocation()); if (lastIndex == index) cellRenderer.draggingOver(index, ids.getDragGestureEvent().getDragOrigin(), dtde.getLocation()); else { if (lastIndex < 0) lastIndex = index; cellRenderer.draggingExit(); cellRenderer.draggingEnter(index, ids.getDragGestureEvent().getDragOrigin(), dtde.getLocation()); comp.repaint(comp.getCellBounds(lastIndex, index)); lastIndex = index; } } }
/** User is starting to drag over us */ public void dragEnter(DropTargetDragEvent dtde) { if (!checkConditions(dtde)) dtde.rejectDrag(); else { lastIndex = comp.locationToIndex(dtde.getLocation()); cellRenderer.draggingEnter(lastIndex, ids.getDragGestureEvent().getDragOrigin(), dtde.getLocation()); comp.repaint(comp.getCellBounds(lastIndex, lastIndex)); } }
/** User is starting to drag over us */ public void dragEnter(DropTargetDragEvent dtde) { if (!checkConditions(dtde)) dtde.rejectDrag(); else { lastIndex = comp.locationToIndex(dtde.getLocation()); cellRenderer.draggingEnter(lastIndex, ids.getDragGestureEvent().getDragOrigin(), dtde.getLocation()); comp.repaint(comp.getCellBounds(lastIndex, lastIndex)); } }
/** User drag over us */ public void dragOver(DropTargetDragEvent dtde) { if (!checkConditions(dtde)) { dtde.rejectDrag(); if (lastIndex >= 0) { cellRenderer.draggingExit(); comp.repaint(comp.getCellBounds(lastIndex, lastIndex)); lastIndex = -1; } } else { dtde.acceptDrag(DnDConstants.ACTION_MOVE); int index = comp.locationToIndex(dtde.getLocation()); if (lastIndex == index) { cellRenderer.draggingOver(index, ids.getDragGestureEvent().getDragOrigin(), dtde.getLocation()); } else { if (lastIndex < 0) { lastIndex = index; } cellRenderer.draggingExit(); cellRenderer.draggingEnter(index, ids.getDragGestureEvent().getDragOrigin(), dtde.getLocation()); comp.repaint(comp.getCellBounds(lastIndex, index)); lastIndex = index; } } }
/** User is starting to drag over us */ public void dragEnter(DropTargetDragEvent dtde) { if (!checkConditions(dtde)) { dtde.rejectDrag(); } else { lastIndex = comp.locationToIndex(dtde.getLocation()); cellRenderer.draggingEnter(lastIndex, ids.getDragGestureEvent().getDragOrigin(), dtde.getLocation()); comp.repaint(comp.getCellBounds(lastIndex, lastIndex)); } }