APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.javafx.embed.swing

public final Class SwingDnD

extends Object
Class Inheritance
Imports
com.sun.javafx.embed.EmbeddedSceneDSInterface, .EmbeddedSceneDTInterface, .EmbeddedSceneInterface, .HostDragStartListener, com.sun.javafx.tk.Toolkit, java.awt.Point, java.awt.datatransfer.DataFlavor, .Transferable, java.awt.dnd.DnDConstants, .DragGestureEvent, .DragGestureRecognizer, .DragSource, .DragSourceAdapter, .DragSourceDropEvent, .DragSourceListener, .DropTarget, .DropTargetAdapter, .DropTargetDragEvent, .DropTargetDropEvent, .DropTargetEvent, .DropTargetListener, .InvalidDnDOperationException, java.awt.event.InputEvent, .MouseAdapter, .MouseEvent, java.io.UnsupportedEncodingException, java.util.ArrayList, .Arrays, .Collections, .EnumSet, .List, .Set, javafx.scene.input.TransferMode, javax.swing.JComponent, .SwingUtilities

An utility class to connect DnD mechanism of Swing and FX. It allows FX content to use the AWT machinery for performing DnD.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final Transferable
private final DragSource
private final DragSourceListener
private EmbeddedSceneDSInterface
private EmbeddedSceneDTInterface
private MouseEvent
private SwingDragSource

Constructor Summary

AccessConstructor and Description
public
SwingDnD(final JComponent comp, final EmbeddedSceneInterface embeddedScene)

Method Summary

Modifier and TypeMethod and Description
public void
private void
private void
public static Set<TransferMode>
dropActionsToTransferModes(final int dropActions)

public static TransferMode
dropActionToTransferMode(final int dropAction)

private void
public HostDragStartListener
public void
private void
startDrag(final MouseEvent e, final Transferable t, final Set<TransferMode> sa, final TransferMode dragAction)

private void
public static int
public static int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dndTransferableback to summary
private final Transferable dndTransferable
dragSourceback to summary
private final DragSource dragSource
dragSourceListenerback to summary
private final DragSourceListener dragSourceListener
fxDragSourceback to summary
private EmbeddedSceneDSInterface fxDragSource
fxDropTargetback to summary
private EmbeddedSceneDTInterface fxDropTarget
meback to summary
private MouseEvent me
swingDragSourceback to summary
private SwingDragSource swingDragSource

Constructor Detail

SwingDnDback to summary
public SwingDnD(final JComponent comp, final EmbeddedSceneInterface embeddedScene)

Method Detail

addNotifyback to summary
public void addNotify()
applyDragResultback to summary
private void applyDragResult(final TransferMode dragResult, final DropTargetDragEvent e)
applyDropResultback to summary
private void applyDropResult(final TransferMode dropResult, final DropTargetDropEvent e)
dropActionsToTransferModesback to summary
public static Set<TransferMode> dropActionsToTransferModes(final int dropActions)
dropActionToTransferModeback to summary
public static TransferMode dropActionToTransferMode(final int dropAction)
endDnDback to summary
private void endDnD()
getDragStartListenerback to summary
public HostDragStartListener getDragStartListener()
removeNotifyback to summary
public void removeNotify()
startDragback to summary
private void startDrag(final MouseEvent e, final Transferable t, final Set<TransferMode> sa, final TransferMode dragAction)
storeMouseEventback to summary
private void storeMouseEvent(final MouseEvent me)
transferModesToDropActionsback to summary
public static int transferModesToDropActions(final Set<TransferMode> tms)
transferModeToDropActionback to summary
public static int transferModeToDropAction(final TransferMode tm)
com.sun.javafx.embed.swing back to summary

private final Class SwingDnD.DnDTransferable

extends Object
implements Transferable
Class Inheritance
All Implemented Interfaces
java.awt.datatransfer.Transferable

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Object
getTransferData(final DataFlavor flavor)

Implements java.awt.datatransfer.Transferable.getTransferData.

Returns an object which represents the data to be transferred.

public DataFlavor[]
getTransferDataFlavors()

Implements java.awt.datatransfer.Transferable.getTransferDataFlavors.

Returns an array of DataFlavor objects indicating the flavors the data can be provided in. The array should be ordered according to preference for providing the data (from most richly descriptive to least descriptive).

public boolean
isDataFlavorSupported(final DataFlavor flavor)

Implements java.awt.datatransfer.Transferable.isDataFlavorSupported.

Returns whether or not the specified data flavor is supported for this object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DnDTransferableback to summary
private DnDTransferable()

Method Detail

getTransferDataback to summary
public Object getTransferData(final DataFlavor flavor) throws UnsupportedEncodingException

Implements java.awt.datatransfer.Transferable.getTransferData.

Doc from java.awt.datatransfer.Transferable.getTransferData.

Returns an object which represents the data to be transferred. The class of the object returned is defined by the representation class of the flavor.

Annotations
@Override
getTransferDataFlavorsback to summary
public DataFlavor[] getTransferDataFlavors()

Implements java.awt.datatransfer.Transferable.getTransferDataFlavors.

Doc from java.awt.datatransfer.Transferable.getTransferDataFlavors.

Returns an array of DataFlavor objects indicating the flavors the data can be provided in. The array should be ordered according to preference for providing the data (from most richly descriptive to least descriptive).

Annotations
@Override
isDataFlavorSupportedback to summary
public boolean isDataFlavorSupported(final DataFlavor flavor)

Implements java.awt.datatransfer.Transferable.isDataFlavorSupported.

Doc from java.awt.datatransfer.Transferable.isDataFlavorSupported.

Returns whether or not the specified data flavor is supported for this object.

Annotations
@Override