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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDRAG SOURCE LISTENER INTERFACEvoidDROP TARGET INTERFACE EVENT uses UNSCALED, DROP-TARGET coordinate system dragEnter - switches current drawWin when mouse enters a new DropTargetvoidDRAG GESTURE LISTENER INTERFACE EVENT uses SCALED, DRAG-SOURCE coordinate system.voidDRAG SOURCE MOTION LISTENER INTERFACE EVENT uses UNSCALED, SCREEN coordinate system Moves cursor after mouse.voidDROP TARGET INTERFACE EVENT uses UNSCALED, DROP-TARGET coordinate system drop() - Last event of the drop operation.protected doubleprotected intMethods 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.AbstractDragHandlerDRAG 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.DragHandlerif DragImage is supported by the JRE, orPieceMover.DragHandlerNoImageif not. Either one will have calledPieceMover.AbstractDragHandler.dragGestureRecognizedPrep(java.awt.dnd.DragGestureEvent), immediately below, before it calls this method.- Specified by:
dragGestureRecognizedin interfaceDragGestureListener- Overrides:
dragGestureRecognizedin classPieceMover.AbstractDragHandler
-
getOffsetMult
protected int getOffsetMult()- Specified by:
getOffsetMultin classPieceMover.AbstractDragHandler- Returns:
- platform-dependent offset multiplier
-
getDeviceScale
- Specified by:
getDeviceScalein classPieceMover.AbstractDragHandler- Parameters:
dge- DG event- Returns:
- platform-dependent device scale
-
dragDropEnd
Description copied from class:PieceMover.AbstractDragHandlerDRAG SOURCE LISTENER INTERFACE- Specified by:
dragDropEndin interfaceDragSourceListener- Overrides:
dragDropEndin classPieceMover.AbstractDragHandler
-
dragMouseMoved
Description copied from class:PieceMover.AbstractDragHandlerDRAG 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:
dragMouseMovedin interfaceDragSourceMotionListener- Specified by:
dragMouseMovedin classPieceMover.AbstractDragHandler
-
dragEnter
Description copied from class:PieceMover.AbstractDragHandlerDROP TARGET INTERFACE EVENT uses UNSCALED, DROP-TARGET coordinate system dragEnter - switches current drawWin when mouse enters a new DropTarget- Specified by:
dragEnterin interfaceDropTargetListener- Overrides:
dragEnterin classPieceMover.AbstractDragHandler
-
drop
Description copied from class:PieceMover.AbstractDragHandlerDROP 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:
dropin interfaceDropTargetListener- Overrides:
dropin classPieceMover.AbstractDragHandler
-