Class 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 usually Singletons 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()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DragService

        protected DragService​(java.lang.String name)
        Parameters:
        name - The name for the SimpleObjectProperty.
    • 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 drag
        name - The name to set as the content of the dragboard
      • completeDrag

        public void completeDrag()
        This should be called when the drag action is complete.