/** Initiating the drag */ @Override public void dragGestureRecognized(DragGestureEvent dge) { super.dragGestureRecognized(dge); }
public void dragEnter(DragSourceDragEvent dsde) { doDragOver(dsde); }
Node[] nodes = obtainNodes(dge); int possibleNodeAction = getAllowedDragActions(); boolean dragStatus = canDrag(dragAction, possibleNodeAction);
/** Activates or deactivates Drag support on asociated JTree * component * @param active true if the support should be active, false * otherwise */ public void activate (boolean active) { if (this.active == active) return; this.active = active; DragGestureRecognizer dgr = getDefaultGestureRecognizer(); if (active) { dgr.setSourceActions (getAllowedDragActions ()); try { dgr.removeDragGestureListener(this); dgr.addDragGestureListener(this); } catch (TooManyListenersException exc) { throw new IllegalStateException("Too many listeners for drag gesture."); // NOI18N } } else { dgr.removeDragGestureListener(this); } }
public void dragEnter (DragSourceDragEvent dsde) { dsde.getDragSourceContext().setCursor(DragDropUtilities.chooseCursor( dsde.getDropAction (), canDrag(dsde.getUserAction (), exDnD.getNodeAllowedActions ()))); }
/** Safe getter for default gesture<br> * (creates the gesture when called for the first time) */ DragGestureRecognizer getDefaultGestureRecognizer() { if (defaultGesture == null) { DragSource ds = DragSource.getDefaultDragSource(); defaultGesture = ds.createDefaultDragGestureRecognizer(comp, getAllowedDragActions(), this); } return defaultGesture; }
Node[] nodes = obtainNodes(dge); int possibleNodeAction = getAllowedDragActions (); for (int i = 0; i < nodes.length; i++) { if ((possibleNodeAction & DnDConstants.ACTION_MOVE) != 0) { boolean dragStatus = canDrag (dragAction, possibleNodeAction);
/** Activates or deactivates Drag support on asociated JTree * component * @param active true if the support should be active, false * otherwise */ public void activate (boolean active) { if (this.active == active) return; this.active = active; DragGestureRecognizer dgr = getDefaultGestureRecognizer(); if (active) { dgr.setSourceActions (getAllowedDragActions ()); try { dgr.removeDragGestureListener(this); dgr.addDragGestureListener(this); } catch (TooManyListenersException exc) { throw new IllegalStateException("Too many listeners for drag gesture."); // NOI18N } } else { dgr.removeDragGestureListener(this); } }
public void dragEnter (DragSourceDragEvent dsde) { dsde.getDragSourceContext().setCursor(DragDropUtilities.chooseCursor( dsde.getDropAction (), canDrag(dsde.getUserAction (), exDnD.getNodeAllowedActions ()))); }
public void dragDropEnd (DragSourceDropEvent dsde) { super.dragDropEnd (dsde);
/** Safe getter for default gesture<br> * (creates the gesture when called for the first time) */ DragGestureRecognizer getDefaultGestureRecognizer () { if (defaultGesture == null) { DragSource ds = DragSource.getDefaultDragSource(); defaultGesture = ds.createDefaultDragGestureRecognizer( comp, getAllowedDragActions (), this); } return defaultGesture; }
Node[] nodes = obtainNodes(dge); int possibleNodeAction = getAllowedDragActions (); for (int i = 0; i < nodes.length; i++) { if ((possibleNodeAction & DnDConstants.ACTION_MOVE) != 0) { boolean dragStatus = canDrag (dragAction, possibleNodeAction);
/** Activates or deactivates Drag support on asociated JTree * component * @param active true if the support should be active, false * otherwise */ public void activate(boolean active) { if (this.active == active) { return; } this.active = active; DragGestureRecognizer dgr = getDefaultGestureRecognizer(); if (dgr == null) { return; } if (active) { dgr.setSourceActions(getAllowedDragActions()); try { dgr.removeDragGestureListener(this); dgr.addDragGestureListener(this); } catch (TooManyListenersException exc) { throw new IllegalStateException("Too many listeners for drag gesture."); // NOI18N } } else { dgr.removeDragGestureListener(this); } }
/** Initiating the drag */ public void dragGestureRecognized(DragGestureEvent dge) { super.dragGestureRecognized(dge); }
public void dragOver (DragSourceDragEvent dsde) { dsde.getDragSourceContext().setCursor(DragDropUtilities.chooseCursor( dsde.getDropAction (), canDrag(dsde.getUserAction (), exDnD.getNodeAllowedActions ()))); }
public void dragDropEnd (DragSourceDropEvent dsde) { super.dragDropEnd (dsde);
/** Safe getter for default gesture<br> * (creates the gesture when called for the first time) */ DragGestureRecognizer getDefaultGestureRecognizer () { if (defaultGesture == null) { DragSource ds = DragSource.getDefaultDragSource(); defaultGesture = ds.createDefaultDragGestureRecognizer( comp, getAllowedDragActions (), this); } return defaultGesture; }
public void dragOver(DragSourceDragEvent dsde) { doDragOver(dsde); }
@Override public void dragGestureRecognized(DragGestureEvent dge) { super.dragGestureRecognized(dge); // TODO // notify tree cell editor that DnD operationm is active // if (exDnD.isDnDActive()) { // TreeCellEditor tce = ((JTree) tree).getCellEditor(); // // if (tce instanceof TreeViewCellEditor) { // ((TreeViewCellEditor) tce).setDnDActive(true); // } // } }