Changeset 6157
- Timestamp:
- 2003-12-08T14:33:53+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/tree/DragTree.java
r5885 r6157 50 50 /** The last tree path the drag was hovered over. */ 51 51 private TreePath previous_path = null; 52 53 static private Cursor NO_DRAG_CURSOR = null; 54 52 55 static private final Color TRANSPARENT_COLOR = new Color(0,0,0,0); 53 56 /** The distance from the edge of the current view within the scroll bar which if entered causes the view to scroll. */ … … 73 76 74 77 public void init(String name, String background_name, boolean mixed_selection) { 78 if(NO_DRAG_CURSOR == null) { 79 NO_DRAG_CURSOR = DragSource.DefaultMoveNoDrop; 80 //Image image = (Utility.getImage("no_drag_cursor.gif")).getImage(); 81 //Point hot_spot = new Point(1,1); 82 //NO_DRAG_CURSOR = Toolkit.getDefaultToolkit().createCustomCursor(image, hot_spot, "No_Drag_Cursor"); 83 } 84 75 85 // Init 76 86 this.name = name; … … 207 217 } 208 218 if (!isValidDrag()) { 219 try { 220 event.startDrag(NO_DRAG_CURSOR, new StringSelection("dummy"), this); 221 //dragging = true; 222 } 223 catch(Exception error) { 224 error.printStackTrace(); 225 } 209 226 return; 210 227 } … … 249 266 label = null; 250 267 try { 251 event.startDrag(new Cursor(Cursor.DEFAULT_CURSOR), group.image_ghost, new Point(5,5), new StringSelection("dummy"), this);268 event.startDrag(new Cursor(Cursor.DEFAULT_CURSOR), group.image_ghost, group.mouse_offset, new StringSelection("dummy"), this); 252 269 //dragging = true; 253 270 } … … 278 295 } 279 296 pt_last = pt; 280 if(!DragSource.isDragImageSupported() ) {297 if(!DragSource.isDragImageSupported() && group.image_ghost != null) { 281 298 // Erase the last ghost image and cue line 282 299 paintImmediately(ra_ghost.getBounds()); … … 344 361 ///ystem.err.println("Valid drop."); 345 362 TreePath[] selection = group.getSelection(); 346 if(target != null ) {363 if(target != null && selection != null) { 347 364 FileNode[] source_nodes = new FileNode[selection.length]; 348 365 for(int i = 0; i < source_nodes.length; i++) { … … 361 378 paintImmediately(ra_ghost.getBounds()); 362 379 event.getDropTargetContext().dropComplete(true); 380 group.image_ghost = null; 363 381 } 364 382
Note:
See TracChangeset
for help on using the changeset viewer.