Package edu.wpi.grip.ui.dragging
Class DragService<T>
- java.lang.Object
-
- edu.wpi.grip.ui.dragging.DragService<T>
-
- Type Parameters:
T
- The value that the object property holds.
- Direct Known Subclasses:
OperationDragService
,SocketHandleView.SocketDragService
,StepDragService
public class DragService<T> extends java.lang.Object
A service to provide data transfer capabilities between two controllers. Concrete versions of the service are usuallySingletons
so that they can be injected into the two controllers.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DragService(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beginDrag(T value, javafx.scene.Node root, java.lang.String name)
Begins the drag action.void
completeDrag()
This should be called when the drag action is complete.javafx.beans.property.ReadOnlyObjectProperty<T>
getDragProperty()
java.util.Optional<T>
getValue()
-
-
-
Method Detail
-
getDragProperty
public javafx.beans.property.ReadOnlyObjectProperty<T> getDragProperty()
- Returns:
- The read only version of this object property.
-
getValue
public java.util.Optional<T> getValue()
- Returns:
- The value stored in the object property.
-
beginDrag
public void beginDrag(T value, javafx.scene.Node root, java.lang.String name)
Begins the drag action. Creates the dragboard on the root node and adds a snapshot of the root node as the view.- Parameters:
value
- The value to be transferred during the drag.root
- The root node to dragname
- The name to set as the content of the dragboard
-
completeDrag
public void completeDrag()
This should be called when the drag action is complete.
-
-