/** 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; }
/** 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; }
/** 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; }
/** 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); } }
/** 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); } }
/** 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); } }
int possibleNodeAction = getAllowedDragActions();
int possibleNodeAction = getAllowedDragActions (); for (int i = 0; i < nodes.length; i++) { if ((possibleNodeAction & DnDConstants.ACTION_MOVE) != 0) {
int possibleNodeAction = getAllowedDragActions (); for (int i = 0; i < nodes.length; i++) { if ((possibleNodeAction & DnDConstants.ACTION_MOVE) != 0) {