From: Joel Uckelman <uckelman@no...> - 2007-09-30 20:01:14
This comment appears with VASSAL.build.module.map.PieceMover.mousePressed():
* This listener is used for faking drag-and-drop on Java 1.1 systems
which seems to indicate that it's no longer needed. However, if I comment
out the contents of this function, it becomes impossible to drag any tokens,
and in fact selectMovablePieces() is never called.
Should this comment have been removed? Are we still faking dnd when we
should be doing it some other way? The code here goes back to 2003, which
is before my time.
> * This listener is used for faking drag-and-drop on Java 1.1 systems
The comment is misleading. The method is necessary. The way dragging works
in VASSAL is that the contents of the DragBuffer are populated on a
mousePressed() event. Then the Java DND support kicks in during the drag.
When the mouse is released, the DND classes generate a mouseReleased event
on the target map window, and the drop is handled by Map.mouseReleased().