Package com.nomagic.magicdraw.ui.dnd
Class DropTarget
java.lang.Object
com.nomagic.magicdraw.ui.dnd.DropTarget
Class is used as a wrapper for drag and drop handler data
-
Constructor Summary
ConstructorDescriptionDropTarget
(PresentationElement target) DropTarget
(PresentationElement target, boolean valid) DropTarget
(PresentationElement target, boolean valid, String description) DropTarget
(PresentationElement target, boolean valid, String description, Cursor cursor) DropTarget
(PresentationElement target, String description) -
Method Summary
Modifier and TypeMethodDescriptionboolean
isValid()
void
Set cursor for the dropvoid
setDescription
(String description) Set description of dropped targetvoid
setTarget
(PresentationElement target) Set presentation element for the drop targetvoid
setValid
(boolean valid) Set valid to true if drop is correct
-
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 onvalid
- check whether the drop target is validdescription
- to be shown on the dropcursor
- 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 onvalid
- check whether the drop target is validdescription
- to be shown on the drop
-
DropTarget
- Parameters:
target
- presentation element which the drag is dropped onvalid
- check whether the drop target is valid
-
DropTarget
- Parameters:
target
- presentation element which the drag is dropped on
-
DropTarget
- Parameters:
target
- presentation element which the drag is dropped ondescription
- to be shown on the drop
-
-
Method Details
-
getTarget
- Returns:
- target presentation element which the drag is dropped on
-
isValid
public boolean isValid()- Returns:
- whether dropped target is valid or not
-
getDescription
- Returns:
- description of the dropped target
-
getCursor
- Returns:
- cursor that is shown on drop
-
setTarget
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
Set description of dropped target- Parameters:
description
- string representation for dropped target
-
setCursor
Set cursor for the drop- Parameters:
cursor
- of the drop
-