Interface DropTarget


  • public interface DropTarget
    Interface representing a drop target.
    • Method Detail

      • dragEnter

        DropAction dragEnter​(Component component,
                             Manifest dragContent,
                             int supportedDropActions,
                             DropAction userDropAction)
        Called when the mouse first enters a drop target during a drag operation.
        Parameters:
        component - The drop target component.
        dragContent - What is being dragged.
        supportedDropActions - What drop actions should be considered.
        userDropAction - What drop action the user is requesting.
        Returns:
        The drop action that would result if the user dropped the item at this location, or null if the target cannot accept the drop.
      • dragExit

        void dragExit​(Component component)
        Called when the mouse leaves a drop target during a drag operation.
        Parameters:
        component - The drop target component.
      • dragMove

        DropAction dragMove​(Component component,
                            Manifest dragContent,
                            int supportedDropActions,
                            int x,
                            int y,
                            DropAction userDropAction)
        Called when the mouse is moved while positioned over a drop target during a drag operation.
        Parameters:
        component - The drop target component.
        dragContent - What is being dragged.
        supportedDropActions - The drop actions that are supported by the contents.
        x - The current mouse X-location.
        y - The current mouse Y-location.
        userDropAction - What drop action the user is requesting.
        Returns:
        The drop action that would result if the user dropped the item at this location, or null if the target cannot accept the drop.
      • userDropActionChange

        DropAction userDropActionChange​(Component component,
                                        Manifest dragContent,
                                        int supportedDropActions,
                                        int x,
                                        int y,
                                        DropAction userDropAction)
        Called when the user drop action changes while the mouse is positioned over a drop target during a drag operation.
        Parameters:
        component - The drop target component.
        dragContent - What is being dragged.
        supportedDropActions - The drop actions that are supported by the contents.
        x - The current mouse X-location.
        y - The current mouse Y-location.
        userDropAction - What drop action the user is requesting.
        Returns:
        The drop action that would result if the user dropped the item at this location, or null if the target cannot accept the drop.
      • drop

        DropAction drop​(Component component,
                        Manifest dragContent,
                        int supportedDropActions,
                        int x,
                        int y,
                        DropAction userDropAction)
        Called to drop the drag content.
        Parameters:
        component - The drop target component.
        dragContent - What is being dragged.
        supportedDropActions - The drop actions that are supported by the contents.
        x - The current mouse X-location.
        y - The current mouse Y-location.
        userDropAction - What drop action the user is requesting.
        Returns:
        The drop action used to perform the drop, or null if the target rejected the drop.