Class PieceMover.DragHandler
java.lang.Object
VASSAL.build.module.map.PieceMover.AbstractDragHandler
VASSAL.build.module.map.PieceMover.DragHandler
- All Implemented Interfaces:
DragGestureListener
,DragSourceListener
,DragSourceMotionListener
,DropTargetListener
,EventListener
- Direct Known Subclasses:
PieceMover.DragHandlerMacOSX
- Enclosing class:
PieceMover
VASSAL's front-line drag handler for drag-and-drop of pieces.
Implementation of AbstractDragHandler when DragImage is supported by JRE.
PieceMover.DragHandlerMacOSX
extends this for special Mac platform- Author:
- Pieter Geerkens
-
Nested Class Summary
Nested classes/interfaces inherited from class VASSAL.build.module.map.PieceMover.AbstractDragHandler
PieceMover.AbstractDragHandler.AbstractDragHandlerFactory
-
Field Summary
Fields inherited from class VASSAL.build.module.map.PieceMover.AbstractDragHandler
boundingBox, boundingBoxComp, currentPieceOffsetX, currentPieceOffsetY, CURSOR_ALPHA, dragCursor, dragCursorZoom, dragPieceOffCenterZoom, dropTargetListeners, EXTRA_BORDER, lastDragLocation, pieceMovers
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
DRAG GESTURE LISTENER INTERFACE EVENT uses SCALED, DRAG-SOURCE coordinate system.protected double
protected double
protected int
Methods inherited from class VASSAL.build.module.map.PieceMover.AbstractDragHandler
addPieceMover, beginDragging, calcDrawOffset, dragDropEnd, dragEnter, dragEnter, dragExit, dragExit, dragGestureRecognizedPrep, dragMouseMoved, dragOver, dragOver, drop, dropActionChanged, dropActionChanged, getListener, getTheDragHandler, makeDragCursor, makeDragImageCursorCommon, makeDragImageCursorCommon, makeDropTarget, moveDragCursor, removeDragCursor, removeDropTarget, resetDragHandler, resetRecursivePieceSlots, setDrawWinToOwnerOf, setTheDragHandler
-
Constructor Details
-
DragHandler
public DragHandler()
-
-
Method Details
-
dragGestureRecognized
Description copied from class:PieceMover.AbstractDragHandler
DRAG GESTURE LISTENER INTERFACE EVENT uses SCALED, DRAG-SOURCE coordinate system. ("component coordinates") PIECE uses SCALED, OWNER (arbitrary) coordinate system ("map coordinates") Fires after user begins moving the mouse several pixels over a map. This method will be overridden, but called as a super(), by the Drag Gesture extension that is used, which will either bePieceMover.DragHandler
if DragImage is supported by the JRE, orPieceMover.DragHandlerNoImage
if not. Either one will have calledPieceMover.AbstractDragHandler.dragGestureRecognizedPrep(java.awt.dnd.DragGestureEvent)
, immediately below, before it calls this method.- Specified by:
dragGestureRecognized
in interfaceDragGestureListener
- Overrides:
dragGestureRecognized
in classPieceMover.AbstractDragHandler
-
getOffsetMult
protected int getOffsetMult()- Specified by:
getOffsetMult
in classPieceMover.AbstractDragHandler
- Returns:
- platform-dependent offset multiplier
-
getDeviceScale
- Specified by:
getDeviceScale
in classPieceMover.AbstractDragHandler
- Parameters:
dge
- DG event- Returns:
- platform-dependent device scale
-
getDeviceScale
- Specified by:
getDeviceScale
in classPieceMover.AbstractDragHandler
-