Package com.nomagic.magicdraw.ui.dnd
Class CustomDragAndDropHandler
- java.lang.Object
-
- com.nomagic.magicdraw.ui.dnd.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 usingCustomDropDiagramHandlerFactory
- See Also:
CustomDropDiagramHandlerFactory
-
-
Constructor Summary
Constructors Constructor Description CustomDragAndDropHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract boolean
drop(java.awt.Point location, PresentationElement elementOver, java.util.List<Element> draggedElements, DiagramPresentationElement diagram)
Executes the drop actionabstract java.lang.String
getDescription()
Returns the description of the drop diagram handlerabstract boolean
willAcceptDrop(java.awt.Point location, PresentationElement elementOver, java.util.List<Element> draggedElements, DiagramPresentationElement diagram)
Checks if drop can be executed
-
-
-
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 locationelementOver
- presentation element on which data is draggeddraggedElements
- dragged elementsdiagram
- 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 locationelementOver
- presentation element on which drop is executeddraggedElements
- dragged elements over drop targetdiagram
- 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)
-
-