Package com.nomagic.magicdraw.ui.dnd
Class DiagramTransferableDragAndDropHandler
java.lang.Object
com.nomagic.magicdraw.ui.dnd.DiagramTransferableDragAndDropHandler
- All Implemented Interfaces:
ConfiguratorWithPriority,PriorityProvider,PriorityProvider
@OpenApiAll
public abstract class DiagramTransferableDragAndDropHandler
extends Object
implements ConfiguratorWithPriority
Drop handler to
DiagramPresentationElement based on Transferable.-
Field Summary
Fields inherited from interface com.nomagic.utils.PriorityProvider
HIGH_PRIORITY, LOW_PRIORITY, MEDIUM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voiddrop(Point location, DiagramPresentationElement diagramPresentationElement, PresentationElement elementOver, Transferable transferable) Drops calculatedDropTarget.Returns a human-readable description of what the handler can achieve.abstract DropTargetgetDropTarget(Point location, DiagramPresentationElement diagramPresentationElement, Transferable transferable) GetsDropTargetfor this handler.intReturns priority of this configurator.
-
Constructor Details
-
DiagramTransferableDragAndDropHandler
public DiagramTransferableDragAndDropHandler()
-
-
Method Details
-
getDropTarget
public abstract DropTarget getDropTarget(Point location, DiagramPresentationElement diagramPresentationElement, Transferable transferable) GetsDropTargetfor 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(Point location, DiagramPresentationElement diagramPresentationElement, PresentationElement elementOver, 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
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:ConfiguratorWithPriorityReturns 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 a case configurator must have lower priority than others.- Specified by:
getPriorityin interfaceConfiguratorWithPriority- Specified by:
getPriorityin interfacePriorityProvider- Returns:
- priority of this configurator.
- See Also:
-