Package com.nomagic.magicdraw.ui.dnd
Class DiagramTransferableDragAndDropHandler
- java.lang.Object
-
- com.nomagic.magicdraw.ui.dnd.DiagramTransferableDragAndDropHandler
-
- All Implemented Interfaces:
ConfiguratorWithPriority
,PriorityProvider
@OpenApiAll public abstract class DiagramTransferableDragAndDropHandler extends java.lang.Object implements ConfiguratorWithPriority
Drop handler toDiagramPresentationElement
based onTransferable
.
-
-
Field Summary
-
Fields inherited from interface com.nomagic.magicdraw.utils.PriorityProvider
HIGH_PRIORITY, LOW_PRIORITY, MEDIUM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description DiagramTransferableDragAndDropHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
drop(java.awt.Point location, DiagramPresentationElement diagramPresentationElement, PresentationElement elementOver, java.awt.datatransfer.Transferable transferable)
Drops calculatedDropTarget
.java.lang.String
getDescription()
Returns a human-readable description of what the handler can achieve.abstract DropTarget
getDropTarget(java.awt.Point location, DiagramPresentationElement diagramPresentationElement, java.awt.datatransfer.Transferable transferable)
GetsDropTarget
for this handler.int
getPriority()
Returns priority of this configurator.
-
-
-
Method Detail
-
getDropTarget
public abstract DropTarget getDropTarget(java.awt.Point location, DiagramPresentationElement diagramPresentationElement, java.awt.datatransfer.Transferable transferable)
GetsDropTarget
for this handler.- Parameters:
location
- location on the diagramdiagramPresentationElement
- diagram presentation element on which the drag is being performedtransferable
- transferable drag&drop object- Returns:
- calculated drop target for this handler
-
drop
public abstract void drop(java.awt.Point location, DiagramPresentationElement diagramPresentationElement, PresentationElement elementOver, java.awt.datatransfer.Transferable transferable)
Drops calculatedDropTarget
.- Parameters:
location
- location on the diagramdiagramPresentationElement
- diagram presentation elementelementOver
- symbol on which drag is being performed (if drop target was not specified, passes DiagramPresentationElement)transferable
- transferable drag&drop object
-
getDescription
@CheckForNull public java.lang.String getDescription()
Returns a human-readable description of what the handler can achieve. Might be used to inform user about the purpose of this handler in various GUI forms, mostly tool tips.- Returns:
- description as a String or null if no description is provided
-
getPriority
public int getPriority()
Description copied from interface:ConfiguratorWithPriority
Returns priority of this configurator. All configurators are sorted by priority before configuration. This is very important if one configurator expects input from other configurators. In such case configurator must have lower priority than others.- Specified by:
getPriority
in interfaceConfiguratorWithPriority
- Specified by:
getPriority
in interfacePriorityProvider
- Returns:
- priority of this configurator.
- See Also:
PriorityProvider.HIGH_PRIORITY
,PriorityProvider.MEDIUM_PRIORITY
,PriorityProvider.LOW_PRIORITY
-
-