public class DragHandler extends DefaultCursorListener
Constructor and Description |
---|
DragHandler() |
DragHandler(com.google.common.base.Function<com.jme3.scene.Spatial,com.jme3.scene.Spatial> draggableLocator) |
Modifier and Type | Method and Description |
---|---|
void |
cursorButtonEvent(CursorButtonEvent event,
com.jme3.scene.Spatial target,
com.jme3.scene.Spatial capture) |
void |
cursorMoved(CursorMotionEvent event,
com.jme3.scene.Spatial target,
com.jme3.scene.Spatial capture) |
protected void |
endDrag(CursorButtonEvent event,
com.jme3.scene.Spatial target,
com.jme3.scene.Spatial capture) |
protected com.jme3.scene.Spatial |
findDraggable(com.jme3.scene.Spatial capture)
Finds the draggable spatial for the specified capture spatial.
|
boolean |
getConsumeDrags() |
boolean |
getConsumeDrops() |
com.google.common.base.Function<com.jme3.scene.Spatial,com.jme3.scene.Spatial> |
getDraggableLocator() |
protected com.jme3.math.Vector2f |
getDragStartLocation() |
boolean |
isDragging() |
void |
setConsumeDrags(boolean consumeDrags) |
void |
setConsumeDrops(boolean consumeDrops) |
void |
setDraggableLocator(com.google.common.base.Function<com.jme3.scene.Spatial,com.jme3.scene.Spatial> draggableLocator)
Sets the function that will be used to find the draggable spatial
relative to the spatial that was clicked.
|
protected void |
startDrag(CursorButtonEvent event,
com.jme3.scene.Spatial target,
com.jme3.scene.Spatial capture) |
click, cursorEntered, cursorExited
public DragHandler()
public DragHandler(com.google.common.base.Function<com.jme3.scene.Spatial,com.jme3.scene.Spatial> draggableLocator)
public void setDraggableLocator(com.google.common.base.Function<com.jme3.scene.Spatial,com.jme3.scene.Spatial> draggableLocator)
public com.google.common.base.Function<com.jme3.scene.Spatial,com.jme3.scene.Spatial> getDraggableLocator()
public boolean isDragging()
protected com.jme3.math.Vector2f getDragStartLocation()
protected com.jme3.scene.Spatial findDraggable(com.jme3.scene.Spatial capture)
protected void startDrag(CursorButtonEvent event, com.jme3.scene.Spatial target, com.jme3.scene.Spatial capture)
protected void endDrag(CursorButtonEvent event, com.jme3.scene.Spatial target, com.jme3.scene.Spatial capture)
public void cursorButtonEvent(CursorButtonEvent event, com.jme3.scene.Spatial target, com.jme3.scene.Spatial capture)
cursorButtonEvent
in interface CursorListener
cursorButtonEvent
in class DefaultCursorListener
public void cursorMoved(CursorMotionEvent event, com.jme3.scene.Spatial target, com.jme3.scene.Spatial capture)
cursorMoved
in interface CursorListener
cursorMoved
in class DefaultCursorListener
public void setConsumeDrags(boolean consumeDrags)
public boolean getConsumeDrags()
public void setConsumeDrops(boolean consumeDrops)
public boolean getConsumeDrops()