There are 4 code examples for java.awt.dnd.DragGestureEvent.
The API names are highlighted below.
You can use
button
to vote the code example(s) you like. The best code example will be ranked first next time. Thanks a lot for your feedback.
Project Name: druid Package: org.dlib.gui.treetable
Source Code: TreeTable.java (Click to view .java file)
Method Code:
/**
* Enable the drag action in a drag'n'drop.
* @param actions a bitwise mask of DndConstants values, like ACTION_MOVE, ACTION_COPY, ACTION_LINK
* @param listener listener to be notified when the drop action ends on success
*/
public void setDragPathEnabled(int actions,final DragSourceListener listener){
DragGestureListener dgl=new DragGestureListener(){
public void dragGestureRecognized( DragGestureEvent e){
TreePath paths[]=treeView.getSelectionPaths();
if (paths != null) e.startDrag(null,new TreeViewPathTransfer(treeView,paths),listener);
}
}
;
DragSource dragSource=DragSource.getDefaultDragSource();
dragSource.createDefaultDragGestureRecognizer(this,actions,dgl);
}
Project Name: druid Package: org.dlib.gui.treetable
Source Code: TreeTable.java (Click to view .java file)
Method Code:
public void dragGestureRecognized(DragGestureEvent e){
TreePath paths[]=treeView.getSelectionPaths();
if (paths != null) e.startDrag(null,new TreeViewPathTransfer(treeView,paths),listener);
}
Project Name: druid Package: org.dlib.gui.treeview
Source Code: TreeView.java (Click to view .java file)
Method Code:
/**
* Enable the drag action in a drag'n'drop.
* @param actions a bitwise mask of DndConstants values, like ACTION_MOVE, ACTION_COPY, ACTION_LINK
* @param listener listener to be notified when the drop action ends on success
*/
public void setDragPathEnabled(int actions,final DragSourceListener listener){
DragGestureListener dgl=new DragGestureListener(){
public void dragGestureRecognized( DragGestureEvent e){
TreePath paths[]=getSelectionPaths();
if (paths != null) e.startDrag(null,new TreeViewPathTransfer(TreeView.this,paths),listener);
}
}
;
DragSource dragSource=DragSource.getDefaultDragSource();
dragSource.createDefaultDragGestureRecognizer(this,actions,dgl);
}
Project Name: druid Package: org.dlib.gui.treeview
Source Code: TreeView.java (Click to view .java file)
Method Code:
public void dragGestureRecognized(DragGestureEvent e){
TreePath paths[]=getSelectionPaths();
if (paths != null) e.startDrag(null,new TreeViewPathTransfer(TreeView.this,paths),listener);
}