Class PieceMover.DragHandlerMacOSX
java.lang.Object
VASSAL.build.module.map.PieceMover.AbstractDragHandler
VASSAL.build.module.map.PieceMover.DragHandler
VASSAL.build.module.map.PieceMover.DragHandlerMacOSX
- All Implemented Interfaces:
DragGestureListener, DragSourceListener, DragSourceMotionListener, DropTargetListener, EventListener
- Enclosing class:
PieceMover
Special MacOSX variant of DragHandler, because of differences in how
device scaling is handled.
-
Nested Class Summary
Nested classes/interfaces inherited from class PieceMover.AbstractDragHandler
PieceMover.AbstractDragHandler.AbstractDragHandlerFactoryModifier and TypeClassDescriptionstatic classPicks the correct drag handler based on our OS, DragSource, and preferences. -
Field Summary
Fields inherited from class PieceMover.AbstractDragHandler
boundingBox, boundingBoxComp, currentPieceOffsetX, currentPieceOffsetY, CURSOR_ALPHA, dragCursor, dragCursorZoom, dragPieceOffCenterZoom, dropTargetListeners, EXTRA_BORDER, lastDragLocation, pieceMoversModifier and TypeFieldDescriptionprotected Rectangleprotected Rectangleprotected intprotected intprotected static final intprotected JLabelprotected doubleprotected doubleprotected Map<Component, DropTargetListener> protected static final intprotected Pointprotected static List<PieceMover> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected doubleprotected doubleprotected intMethods inherited from class PieceMover.DragHandler
dragGestureRecognizedModifier and TypeMethodDescriptionvoidDRAG GESTURE LISTENER INTERFACE EVENT uses SCALED, DRAG-SOURCE coordinate system.Methods inherited from class 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, setTheDragHandlerModifier and TypeMethodDescriptionstatic voidRegisters a PieceMoverprotected voidThe the Drag Gesture Recognizer that we're officially beginning a drag.protected voidcalculates the offset between cursor dragCursor positionsvoidDRAG SOURCE LISTENER INTERFACEvoidvoidDROP TARGET INTERFACE EVENT uses UNSCALED, DROP-TARGET coordinate system dragEnter - switches current drawWin when mouse enters a new DropTargetvoidvoidPasses event along listener chainprotected PointSets things up at the beginning of a drag-and-drop operation:
- Screen out any immovable pieces
- Account for any offsets on in the window
- Sets dragWin to our source windowvoidDRAG SOURCE MOTION LISTENER INTERFACE EVENT uses UNSCALED, SCREEN coordinate system Moves cursor after mouse.voidvoidPasses event along listener chainvoidDROP TARGET INTERFACE EVENT uses UNSCALED, DROP-TARGET coordinate system drop() - Last event of the drop operation.voidvoidPasses event along listener chainprotected DropTargetListenerreturns the singleton DragHandler instanceprotected voidmakeDragCursor(double zoom) Deprecated, for removal: This API element is subject to removal in a future version.protected BufferedImagemakeDragImageCursorCommon(double zoom, boolean doOffset, Component target, boolean setSize) Deprecated, for removal: This API element is subject to removal in a future version.protected BufferedImagemakeDragImageCursorCommon(double mapzoom, double os_scale, boolean doOffset, Component target) static DropTargetmakeDropTarget(Component theComponent, int dndContants, DropTargetListener dropTargetListener) Creates a new DropTarget and hooks us into the beginning of a DropTargetListener chain.protected voidmoveDragCursor(int dragX, int dragY) Deprecated, for removal: This API element is subject to removal in a future version.protected voidDeprecated, for removal: This API element is subject to removal in a future version.static voidremoveDropTarget(Component theComponent) Removes a dropTarget componentstatic voidReset our drag handler, e.g. if our preferences change.static voidFinds all the piece slots in a module and resets their drop targets to use a new DragHandlervoidsetDrawWinToOwnerOf(Component newDropWin) Deprecated, for removal: This API element is subject to removal in a future version.static voidsetTheDragHandler(PieceMover.AbstractDragHandler myHandler)
-
Constructor Details
-
DragHandlerMacOSX
public DragHandlerMacOSX()
-
-
Method Details
-
getOffsetMult
protected int getOffsetMult()- Overrides:
getOffsetMultin classPieceMover.DragHandler- Returns:
- platform-dependent offset multiplier
-
getDeviceScale
- Overrides:
getDeviceScalein classPieceMover.DragHandler- Parameters:
dge- DG event- Returns:
- platform-dependent device scale
-
getDeviceScale
- Overrides:
getDeviceScalein classPieceMover.DragHandler
-