public void registerDragListeners() { if (dragSource != null) { dragSource.removeDragSourceListener(this); dragSource.removeDragSourceMotionListener(this); } dragSource = DragSource.getDefaultDragSource(); dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, this); dragSource.addDragSourceMotionListener(this); }
/** * {@inheritDoc} */ @Override public void removeNotify() { getDnDTargetController().removeHandler( this.dropHandler ); DragSource dragSource = this.dragGestureRecognizer.getDragSource(); if ( dragSource != null ) { dragSource.removeDragSourceListener( this.dndListener ); dragSource.removeDragSourceMotionListener( this.dndListener ); } removeMouseListener( this.mouseHandler ); super.removeNotify(); }
public void dragDropEnd(DragSourceDropEvent e) { describe("end", e); setModifiers(UNKNOWN_MODIFIERS); transferable = UNKNOWN_TRANSFERABLE; if (ghost != null) { if (e.getDropSuccess()) { ghost.dispose(); } else { ghost.returnToOrigin(); } ghost = null; } DragSource src = e.getDragSourceContext().getDragSource(); src.removeDragSourceMotionListener(this); moved = false; }
@Override public void dragDropEnd(DragSourceDropEvent e) { describe("end", e); setModifiers(UNKNOWN_MODIFIERS); transferable = UNKNOWN_TRANSFERABLE; if (ghost != null) { if (e.getDropSuccess()) { ghost.dispose(); } else { ghost.returnToOrigin(); } ghost = null; } DragSource src = e.getDragSourceContext().getDragSource(); src.removeDragSourceMotionListener(this); moved = false; }
@Override public void registerListeners() { super.registerListeners(); // Reactivate tooltip listener ToolTipManager.sharedInstance().registerComponent(this); if (dragSource != null) { dragSource.removeDragSourceListener(this); dragSource.removeDragSourceMotionListener(this); removeFocusListener(this); } addFocusListener(this); this.setFocusable(true); this.addMouseListener(this); dragSource = new DragSource(); dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, this); dragSource.addDragSourceMotionListener(this); }