MagicDraw itself has many default DnD handlers for doing various things while dropping Elements from Browser(trees) component on the diagram or on other presentation elements in the diagram.
These default handlers creates new presentation elements, changes the properties of elements and etc. Same is true if presentation elements are dropped on top of other presentation elements.
API allows to register a custom DnD handler for doing some specific things using DnD mechanism.
There are different registrations
- Use com.nomagic.magicdraw.ui.dnd.CustomDropDiagramHandlerFactory.register(CustomDragAndDropHandler) to register a handler for dropping elements from browser(trees).
- Use com.nomagic.magicdraw.ui.dnd.CustomShapeMoveHandlerFactory.register(CustomDragAndDropHandler) to register a handler for dropping one presentation element on other presentation element in the same diagram
You can find the code examples in
- <installation_directory>\openapi\examples\customdraganddrop