Class SwingDragger
- java.lang.Object
- 
- com.inductiveautomation.snap.swing.SwingDragger
 
- 
- All Implemented Interfaces:
- java.awt.dnd.DragSourceListener,- java.awt.dnd.DragSourceMotionListener,- java.util.EventListener
 
 public class SwingDragger extends java.lang.Object implements java.awt.dnd.DragSourceListener, java.awt.dnd.DragSourceMotionListenerA class to manage dragging.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classSwingDragger.FileTransferableA File Transferable.
 - 
Constructor SummaryConstructors Constructor Description SwingDragger()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcreateDragWindow()Creates new drag source listener.protected java.awt.datatransfer.TransferablecreateTransferable()Creates a transferable for DragItem.static java.awt.datatransfer.TransferablecreateTransferable(java.lang.Object anItem)Creates a transferable for given object.voiddragDropEnd(java.awt.dnd.DragSourceDropEvent anEvent)DragSourceListener method.voiddragEnter(java.awt.dnd.DragSourceDragEvent anEvent)DragSourceListener method.voiddragExit(java.awt.dnd.DragSourceEvent anEvent)DragSourceListener method.voiddragMouseMoved(java.awt.dnd.DragSourceDragEvent anEvent)DragSourceMotionListener method.voiddragOver(java.awt.dnd.DragSourceDragEvent anEvent)DragSourceListener method.voiddropActionChanged(java.awt.dnd.DragSourceDragEvent anEvent)DragSourceListener method.static SwingDraggergetActiveDragger()Returns the currently active dragger.protected javax.swing.JComponentgetComponent()Returns the component.java.awt.dnd.DragGestureEventgetDragGestureEvent()Returns the DragGestureEvent.java.awt.ImagegetDragImage()Returns the image to be dragged.protected java.awt.PointgetDragImageOffset()Returns the drag image offset point.java.awt.PointgetDragImagePoint()Returns the point that the drag image should be dragged by.java.lang.ObjectgetDragItem()Returns the item really being dragged.<T> TgetDragItem(java.lang.Class<T> aClass)Returns the drag item as given class.java.lang.StringgetDragItemString()Returns the drag item as string.java.awt.dnd.DragSourcegetDragSource()Returns the DragSource.java.awt.dnd.DragSourceListenergetDragSourceListener()Returns the optional DragSourceListener.java.awt.datatransfer.TransferablegetTransferable()Sets the transferable.voidsetDragGestureEvent(java.awt.dnd.DragGestureEvent anEvent)Sets the DragGestureEvent.voidsetDragImage(java.awt.Image anImage)Sets the image to be dragged.voidsetDragImageFromString(java.lang.String aString, java.awt.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(java.awt.Point aPoint)Returns the point that the drag image should be dragged by.voidsetDragItem(java.lang.Object anItem)Sets the item really being dragged.voidsetDragSourceListener(java.awt.dnd.DragSourceListener aListener)Sets an optional DragSourceListener.voidsetTransferable(java.awt.datatransfer.Transferable aTrans)Sets the transferable.voidsetTransferable(java.lang.String aString)Sets the transferable from string.voidstartDrag()Starts the drag.
 
- 
- 
- 
Method Detail- 
getDragItempublic java.lang.Object getDragItem() Returns the item really being dragged.
 - 
setDragItempublic void setDragItem(java.lang.Object anItem) Sets the item really being dragged.
 - 
getDragItempublic <T> T getDragItem(java.lang.Class<T> aClass) Returns the drag item as given class.
 - 
getDragItemStringpublic java.lang.String getDragItemString() Returns the drag item as string.
 - 
getDragGestureEventpublic java.awt.dnd.DragGestureEvent getDragGestureEvent() Returns the DragGestureEvent.
 - 
setDragGestureEventpublic void setDragGestureEvent(java.awt.dnd.DragGestureEvent anEvent) Sets the DragGestureEvent.
 - 
getDragImagepublic java.awt.Image getDragImage() Returns the image to be dragged.
 - 
setDragImagepublic void setDragImage(java.awt.Image anImage) Sets the image to be dragged.
 - 
setDragImageFromStringpublic void setDragImageFromString(java.lang.String aString, java.awt.Font aFont)Sets the drag image from given string and font.
 - 
getDragImagePointpublic java.awt.Point getDragImagePoint() Returns the point that the drag image should be dragged by.
 - 
setDragImagePointpublic void setDragImagePoint(java.awt.Point aPoint) Returns the point that the drag image should be dragged by.
 - 
setDragImagePointpublic void setDragImagePoint(double anX, double aY)Returns the point that the drag image should be dragged by.
 - 
getDragImageOffsetprotected java.awt.Point getDragImageOffset() Returns the drag image offset point.
 - 
getTransferablepublic java.awt.datatransfer.Transferable getTransferable() Sets the transferable.
 - 
setTransferablepublic void setTransferable(java.awt.datatransfer.Transferable aTrans) Sets the transferable.
 - 
setTransferablepublic void setTransferable(java.lang.String aString) Sets the transferable from string.
 - 
createTransferableprotected java.awt.datatransfer.Transferable createTransferable() Creates a transferable for DragItem.
 - 
createTransferablepublic static java.awt.datatransfer.Transferable createTransferable(java.lang.Object anItem) Creates a transferable for given object.
 - 
getDragSourceListenerpublic java.awt.dnd.DragSourceListener getDragSourceListener() Returns the optional DragSourceListener.
 - 
setDragSourceListenerpublic void setDragSourceListener(java.awt.dnd.DragSourceListener aListener) Sets an optional DragSourceListener.
 - 
getComponentprotected javax.swing.JComponent getComponent() Returns the component.
 - 
getDragSourcepublic java.awt.dnd.DragSource getDragSource() Returns the DragSource.
 - 
startDragpublic void startDrag() Starts the drag.
 - 
getActiveDraggerpublic static SwingDragger getActiveDragger() Returns the currently active dragger.
 - 
createDragWindowprotected void createDragWindow() Creates new drag source listener.
 - 
dragEnterpublic void dragEnter(java.awt.dnd.DragSourceDragEvent anEvent) DragSourceListener method.- Specified by:
- dragEnterin interface- java.awt.dnd.DragSourceListener
 
 - 
dragMouseMovedpublic void dragMouseMoved(java.awt.dnd.DragSourceDragEvent anEvent) DragSourceMotionListener method.- Specified by:
- dragMouseMovedin interface- java.awt.dnd.DragSourceMotionListener
 
 - 
dragDropEndpublic void dragDropEnd(java.awt.dnd.DragSourceDropEvent anEvent) DragSourceListener method.- Specified by:
- dragDropEndin interface- java.awt.dnd.DragSourceListener
 
 - 
dragOverpublic void dragOver(java.awt.dnd.DragSourceDragEvent anEvent) DragSourceListener method.- Specified by:
- dragOverin interface- java.awt.dnd.DragSourceListener
 
 - 
dragExitpublic void dragExit(java.awt.dnd.DragSourceEvent anEvent) DragSourceListener method.- Specified by:
- dragExitin interface- java.awt.dnd.DragSourceListener
 
 - 
dropActionChangedpublic void dropActionChanged(java.awt.dnd.DragSourceDragEvent anEvent) DragSourceListener method.- Specified by:
- dropActionChangedin interface- java.awt.dnd.DragSourceListener
 
 
- 
 
-