Package com.simsilica.lemur.dnd
Class DefaultDragSession
java.lang.Object
com.simsilica.lemur.dnd.DefaultDragSession
- All Implemented Interfaces:
DragSession
-
Field Summary
Fields inherited from interface com.simsilica.lemur.dnd.DragSession
ITEM -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void<T> TReturns an attribute previously stored in this session or the default value if no such attribute exists.Returns the application-provided "Draggable" that is used to display the current drag location.Returns the current drag location in 'cursor space', ie: the 2D coordinate of the screen or viewport that indicates the drag location.Returns the container Spatial upon which the drag operation was initiated.Return the drop status of this drag session.Returns the current 'drop' collision information or null if there is no current drop target.Returns the current drop target or null if the drag is not currently over a drop target.booleanhasAttribute(String name) Returns true if the session has the specified attribute defined.voidSets an application-specific session attribute that lives as long as this specific drag session.protected voidsetDraggable(Draggable draggable) voidsetDragStatus(DragStatus status) Called by drop event handlers to indicate that a drop target and location are valid or invalid.protected voidsetDropCollision(CollisionResult collision) protected voidsetDropTarget(Spatial dropTarget, DragEvent event)
-
Constructor Details
-
DefaultDragSession
-
-
Method Details
-
set
Description copied from interface:DragSessionSets an application-specific session attribute that lives as long as this specific drag session. Applications can use this to store their payload or attributes relating to the drag payload or advanced status not provided by the DragSession's normal book-keeping. Most often this is used to store a reference to the dragged item. For standardization, the callers can use the ITEM constant for a default location for dragged items. Setting an attribute to null will remove it from the session.- Specified by:
setin interfaceDragSession
-
get
Description copied from interface:DragSessionReturns an attribute previously stored in this session or the default value if no such attribute exists.- Specified by:
getin interfaceDragSession
-
hasAttribute
Description copied from interface:DragSessionReturns true if the session has the specified attribute defined.- Specified by:
hasAttributein interfaceDragSession
-
getDragSource
Description copied from interface:DragSessionReturns the container Spatial upon which the drag operation was initiated.- Specified by:
getDragSourcein interfaceDragSession
-
setDraggable
-
getDraggable
Description copied from interface:DragSessionReturns the application-provided "Draggable" that is used to display the current drag location.- Specified by:
getDraggablein interfaceDragSession
-
setDragStatus
Description copied from interface:DragSessionCalled by drop event handlers to indicate that a drop target and location are valid or invalid. If there is no current drop target than the drag status is DragStatus.NoTarget.- Specified by:
setDragStatusin interfaceDragSession
-
getDragStatus
Description copied from interface:DragSessionReturn the drop status of this drag session. If there is no current drop target then the drag status is DragStatus.NoTarget. DragStatus.InvalidTarget indicates that the drag is over a drop target but either the container or the location in the container is not valid.- Specified by:
getDragStatusin interfaceDragSession
-
close
-
setDropTarget
-
getDropTarget
Description copied from interface:DragSessionReturns the current drop target or null if the drag is not currently over a drop target.- Specified by:
getDropTargetin interfaceDragSession
-
getDragLocation
Description copied from interface:DragSessionReturns the current drag location in 'cursor space', ie: the 2D coordinate of the screen or viewport that indicates the drag location.- Specified by:
getDragLocationin interfaceDragSession
-
setDropCollision
-
getDropCollision
Description copied from interface:DragSessionReturns the current 'drop' collision information or null if there is no current drop target.- Specified by:
getDropCollisionin interfaceDragSession
-