Package VASSAL.build.module.map
Class PieceMover.DragHandlerNoImage
java.lang.Object
VASSAL.build.module.map.PieceMover.AbstractDragHandler
VASSAL.build.module.map.PieceMover.DragHandlerNoImage
- All Implemented Interfaces:
DragGestureListener
,DragSourceListener
,DragSourceMotionListener
,DropTargetListener
,EventListener
- Enclosing class:
- PieceMover
Fallback drag-handler when DragImage not supported by JRE. Implements a pseudo-cursor
that follows the mouse cursor when user drags game pieces. Supports map zoom by
resizing cursor when it enters a drop target of type Map.View.
- Version:
- 0.4.2
- Author:
- Jim Urbas
-
Field Summary
Fields inherited from class VASSAL.build.module.map.PieceMover.AbstractDragHandler
dragCursor, dragCursorZoom, dragPieceOffCenterZoom, lastDragLocation
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
DRAG SOURCE LISTENER INTERFACEvoid
DROP TARGET INTERFACE EVENT uses UNSCALED, DROP-TARGET coordinate system dragEnter - switches current drawWin when mouse enters a new DropTargetvoid
DRAG GESTURE LISTENER INTERFACE EVENT uses SCALED, DRAG-SOURCE coordinate system.void
DRAG SOURCE MOTION LISTENER INTERFACE EVENT uses UNSCALED, SCREEN coordinate system Moves cursor after mouse.void
DROP TARGET INTERFACE EVENT uses UNSCALED, DROP-TARGET coordinate system drop() - Last event of the drop operation.protected double
protected int
Methods inherited from class VASSAL.build.module.map.PieceMover.AbstractDragHandler
beginDragging, dragEnter, dragExit, dragExit, dragGestureRecognizedPrep, dragOver, dragOver, dropActionChanged, dropActionChanged, getListener, getTheDragHandler, makeDragCursor, makeDropTarget, moveDragCursor, removeDragCursor, removeDropTarget, setDrawWinToOwnerOf, setTheDragHandler
-
Constructor Details
-
DragHandlerNoImage
public DragHandlerNoImage()
-
-
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
-
dragDropEnd
Description copied from class:PieceMover.AbstractDragHandler
DRAG SOURCE LISTENER INTERFACE- Specified by:
dragDropEnd
in interfaceDragSourceListener
- Overrides:
dragDropEnd
in classPieceMover.AbstractDragHandler
-
dragMouseMoved
Description copied from class:PieceMover.AbstractDragHandler
DRAG SOURCE MOTION LISTENER INTERFACE EVENT uses UNSCALED, SCREEN coordinate system Moves cursor after mouse. Used to check for real mouse movement. Warning: dragMouseMoved fires 8 times for each point on development system (Win2k)- Specified by:
dragMouseMoved
in interfaceDragSourceMotionListener
- Specified by:
dragMouseMoved
in classPieceMover.AbstractDragHandler
-
dragEnter
Description copied from class:PieceMover.AbstractDragHandler
DROP TARGET INTERFACE EVENT uses UNSCALED, DROP-TARGET coordinate system dragEnter - switches current drawWin when mouse enters a new DropTarget- Specified by:
dragEnter
in interfaceDropTargetListener
- Overrides:
dragEnter
in classPieceMover.AbstractDragHandler
-
drop
Description copied from class:PieceMover.AbstractDragHandler
DROP TARGET INTERFACE EVENT uses UNSCALED, DROP-TARGET coordinate system drop() - Last event of the drop operation. We adjust the drop point for off-center drag, remove the cursor, and pass the event along listener chain.- Specified by:
drop
in interfaceDropTargetListener
- Overrides:
drop
in classPieceMover.AbstractDragHandler
-