Class DropTarget

java.lang.Object
com.nomagic.magicdraw.ui.dnd.DropTarget

@OpenApiAll public class DropTarget extends Object
Class is used as a wrapper for drag and drop handler data
  • Constructor Details

    • DropTarget

      public DropTarget(@CheckForNull PresentationElement target, boolean valid, @CheckForNull String description, @CheckForNull Cursor cursor)
      Parameters:
      target - presentation element which the drag is dropped on
      valid - check whether the drop target is valid
      description - to be shown on the drop
      cursor - to be shown on the drop
    • DropTarget

      public DropTarget(@CheckForNull PresentationElement target, boolean valid, @CheckForNull String description)
      Parameters:
      target - presentation element which the drag is dropped on
      valid - check whether the drop target is valid
      description - to be shown on the drop
    • DropTarget

      public DropTarget(@CheckForNull PresentationElement target, boolean valid)
      Parameters:
      target - presentation element which the drag is dropped on
      valid - check whether the drop target is valid
    • DropTarget

      public DropTarget(@CheckForNull PresentationElement target)
      Parameters:
      target - presentation element which the drag is dropped on
    • DropTarget

      public DropTarget(@CheckForNull PresentationElement target, @CheckForNull String description)
      Parameters:
      target - presentation element which the drag is dropped on
      description - to be shown on the drop
  • Method Details

    • getTarget

      @CheckForNull public PresentationElement getTarget()
      Returns:
      target presentation element which the drag is dropped on
    • isValid

      public boolean isValid()
      Returns:
      whether dropped target is valid or not
    • getDescription

      @CheckForNull public String getDescription()
      Returns:
      description of the dropped target
    • getCursor

      @CheckForNull public Cursor getCursor()
      Returns:
      cursor that is shown on drop
    • setTarget

      public void setTarget(@CheckForNull PresentationElement target)
      Set presentation element for the drop target
      Parameters:
      target - presentation element
    • setValid

      public void setValid(boolean valid)
      Set valid to true if drop is correct
      Parameters:
      valid - true if valid drop, otherwise false
    • setDescription

      public void setDescription(@CheckForNull String description)
      Set description of dropped target
      Parameters:
      description - string representation for dropped target
    • setCursor

      public void setCursor(@CheckForNull Cursor cursor)
      Set cursor for the drop
      Parameters:
      cursor - of the drop