public class DefaultDragSession extends java.lang.Object implements DragSession
ITEM
Constructor and Description |
---|
DefaultDragSession(com.jme3.scene.Spatial source,
com.jme3.math.Vector2f dragLocation) |
Modifier and Type | Method and Description |
---|---|
protected void |
close(DragEvent event) |
<T> T |
get(java.lang.String name,
T defaultValue)
Returns an attribute previously stored in this session or the
default value if no such attribute exists.
|
Draggable |
getDraggable()
Returns the application-provided "Draggable" that is used to
display the current drag location.
|
com.jme3.math.Vector2f |
getDragLocation()
Returns the current drag location in 'cursor space', ie: the 2D
coordinate of the screen or viewport that indicates the drag location.
|
com.jme3.scene.Spatial |
getDragSource()
Returns the container Spatial upon which the drag operation was
initiated.
|
DragStatus |
getDragStatus()
Return the drop status of this drag session.
|
com.jme3.collision.CollisionResult |
getDropCollision()
Returns the current 'drop' collision information or null if
there is no current drop target.
|
com.jme3.scene.Spatial |
getDropTarget()
Returns the current drop target or null if the drag is not
currently over a drop target.
|
boolean |
hasAttribute(java.lang.String name)
Returns true if the session has the specified attribute defined.
|
void |
set(java.lang.String name,
java.lang.Object attribute)
Sets an application-specific session attribute that lives as
long as this specific drag session.
|
protected void |
setDraggable(Draggable draggable) |
void |
setDragStatus(DragStatus status)
Called by drop event handlers to indicate that a drop
target and location are valid or invalid.
|
protected void |
setDropCollision(com.jme3.collision.CollisionResult collision) |
protected void |
setDropTarget(com.jme3.scene.Spatial dropTarget,
DragEvent event) |
public DefaultDragSession(com.jme3.scene.Spatial source, com.jme3.math.Vector2f dragLocation)
public void set(java.lang.String name, java.lang.Object attribute)
DragSession
set
in interface DragSession
public <T> T get(java.lang.String name, T defaultValue)
DragSession
get
in interface DragSession
public boolean hasAttribute(java.lang.String name)
DragSession
hasAttribute
in interface DragSession
public com.jme3.scene.Spatial getDragSource()
DragSession
getDragSource
in interface DragSession
protected void setDraggable(Draggable draggable)
public Draggable getDraggable()
DragSession
getDraggable
in interface DragSession
public void setDragStatus(DragStatus status)
DragSession
setDragStatus
in interface DragSession
public DragStatus getDragStatus()
DragSession
getDragStatus
in interface DragSession
protected void close(DragEvent event)
protected void setDropTarget(com.jme3.scene.Spatial dropTarget, DragEvent event)
public com.jme3.scene.Spatial getDropTarget()
DragSession
getDropTarget
in interface DragSession
public com.jme3.math.Vector2f getDragLocation()
DragSession
getDragLocation
in interface DragSession
protected void setDropCollision(com.jme3.collision.CollisionResult collision)
public com.jme3.collision.CollisionResult getDropCollision()
DragSession
getDropCollision
in interface DragSession