Class CustomDragAndDropHandler


  • @OpenApiAll
    public abstract class CustomDragAndDropHandler
    extends java.lang.Object
    Drop Diagram Handler interface used to implement drag and drop actions for browser drops

    Using this interface you can implement the main methods that are responsible for drag and drop actions. And later register your custom drag and drop action using CustomDropDiagramHandlerFactory

    See Also:
    CustomDropDiagramHandlerFactory
    • Constructor Detail

      • CustomDragAndDropHandler

        public CustomDragAndDropHandler()
    • Method Detail

      • getDescription

        public abstract java.lang.String getDescription()
        Returns the description of the drop diagram handler
        Returns:
        description of drop diagram handler
      • willAcceptDrop

        public abstract boolean willAcceptDrop​(java.awt.Point location,
                                               @CheckForNull
                                               PresentationElement elementOver,
                                               @CheckForNull
                                               java.util.List<Element> draggedElements,
                                               DiagramPresentationElement diagram)
        Checks if drop can be executed
        Parameters:
        location - drop location
        elementOver - presentation element on which data is dragged
        draggedElements - dragged elements
        diagram - diagram presentation element on which Drag and Drop action is executed
        Returns:
        true if element can accept dragged data, else false
      • drop

        public abstract boolean drop​(java.awt.Point location,
                                     @CheckForNull
                                     PresentationElement elementOver,
                                     @CheckForNull
                                     java.util.List<Element> draggedElements,
                                     DiagramPresentationElement diagram)
        Executes the drop action
        Parameters:
        location - drop location
        elementOver - presentation element on which drop is executed
        draggedElements - dragged elements over drop target
        diagram - diagram presentation element on which Drag and Drop action is executed
        Returns:
        returns true if drop was successful, else false (it is important to return true after successful action, as else this and next Drag and Drop action will be executed)