Class SwingDragger
java.lang.Object
com.inductiveautomation.snap.swing.SwingDragger
- All Implemented Interfaces:
DragSourceListener,DragSourceMotionListener,EventListener
A class to manage dragging.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCreates new drag source listener.protected TransferableCreates a transferable for DragItem.static TransferablecreateTransferable(Object anItem) Creates a transferable for given object.voiddragDropEnd(DragSourceDropEvent anEvent) DragSourceListener method.voiddragEnter(DragSourceDragEvent anEvent) DragSourceListener method.voiddragExit(DragSourceEvent anEvent) DragSourceListener method.voiddragMouseMoved(DragSourceDragEvent anEvent) DragSourceMotionListener method.voiddragOver(DragSourceDragEvent anEvent) DragSourceListener method.voiddropActionChanged(DragSourceDragEvent anEvent) DragSourceListener method.static SwingDraggerReturns the currently active dragger.protected JComponentReturns the component.Returns the DragGestureEvent.Returns the image to be dragged.protected PointReturns the drag image offset point.Returns the point that the drag image should be dragged by.Returns the item really being dragged.<T> TgetDragItem(Class<T> aClass) Returns the drag item as given class.Returns the drag item as string.Returns the DragSource.Returns the optional DragSourceListener.Sets the transferable.voidsetDragGestureEvent(DragGestureEvent anEvent) Sets the DragGestureEvent.voidsetDragImage(Image anImage) Sets the image to be dragged.voidsetDragImageFromString(String aString, Font aFont) Sets the drag image from given string and font.voidsetDragImagePoint(double anX, double aY) Returns the point that the drag image should be dragged by.voidsetDragImagePoint(Point aPoint) Returns the point that the drag image should be dragged by.voidsetDragItem(Object anItem) Sets the item really being dragged.voidsetDragSourceListener(DragSourceListener aListener) Sets an optional DragSourceListener.voidsetTransferable(Transferable aTrans) Sets the transferable.voidsetTransferable(String aString) Sets the transferable from string.voidStarts the drag.
-
Constructor Details
-
SwingDragger
public SwingDragger()
-
-
Method Details
-
getDragItem
Returns the item really being dragged. -
setDragItem
Sets the item really being dragged. -
getDragItem
Returns the drag item as given class. -
getDragItemString
Returns the drag item as string. -
getDragGestureEvent
Returns the DragGestureEvent. -
setDragGestureEvent
Sets the DragGestureEvent. -
getDragImage
Returns the image to be dragged. -
setDragImage
Sets the image to be dragged. -
setDragImageFromString
Sets the drag image from given string and font. -
getDragImagePoint
Returns the point that the drag image should be dragged by. -
setDragImagePoint
Returns the point that the drag image should be dragged by. -
setDragImagePoint
public void setDragImagePoint(double anX, double aY) Returns the point that the drag image should be dragged by. -
getDragImageOffset
Returns the drag image offset point. -
getTransferable
Sets the transferable. -
setTransferable
Sets the transferable. -
setTransferable
Sets the transferable from string. -
createTransferable
Creates a transferable for DragItem. -
createTransferable
Creates a transferable for given object. -
getDragSourceListener
Returns the optional DragSourceListener. -
setDragSourceListener
Sets an optional DragSourceListener. -
getComponent
Returns the component. -
getDragSource
Returns the DragSource. -
startDrag
public void startDrag()Starts the drag. -
getActiveDragger
Returns the currently active dragger. -
createDragWindow
protected void createDragWindow()Creates new drag source listener. -
dragEnter
DragSourceListener method.- Specified by:
dragEnterin interfaceDragSourceListener
-
dragMouseMoved
DragSourceMotionListener method.- Specified by:
dragMouseMovedin interfaceDragSourceMotionListener
-
dragDropEnd
DragSourceListener method.- Specified by:
dragDropEndin interfaceDragSourceListener
-
dragOver
DragSourceListener method.- Specified by:
dragOverin interfaceDragSourceListener
-
dragExit
DragSourceListener method.- Specified by:
dragExitin interfaceDragSourceListener
-
dropActionChanged
DragSourceListener method.- Specified by:
dropActionChangedin interfaceDragSourceListener
-