Package com.nomagic.magicdraw.ui.dnd
Class CustomDragAndDropHandler
java.lang.Object
com.nomagic.magicdraw.ui.dnd.CustomDragAndDropHandler
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:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
drop
(Point location, PresentationElement elementOver, List<Element> draggedElements, DiagramPresentationElement diagram) Executes the drop actionabstract String
Returns the description of the drop diagram handlerabstract boolean
willAcceptDrop
(Point location, PresentationElement elementOver, List<Element> draggedElements, DiagramPresentationElement diagram) Checks if drop can be executed
-
Constructor Details
-
CustomDragAndDropHandler
public CustomDragAndDropHandler()
-
-
Method Details
-
getDescription
Returns the description of the drop diagram handler- Returns:
- description of drop diagram handler
-
willAcceptDrop
public abstract boolean willAcceptDrop(Point location, @CheckForNull PresentationElement elementOver, @CheckForNull 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(Point location, @CheckForNull PresentationElement elementOver, @CheckForNull 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)
-