src/main/java/chalmers/pimp/controller/components/LayerItemPane.java
private void handleDragDetected(MouseEvent event) {
    if (event.isPrimaryButtonDown()) {
      Dragboard dragBoard = startDragAndDrop(TransferMode.MOVE);

      var snapshotParams = new SnapshotParameters();

      WritableImage image = snapshot(snapshotParams, null);

      dragBoard.setDragView(image);
      model.selectLayer(associatedLayerIndex);

      var content = new ClipboardContent();
      content.putString(String.valueOf(associatedLayerIndex));
      dragBoard.setContent(content);
    }
    event.consume();
  }
/**
   * Handles a mouse event triggered by initiating a mouse drag on the layer item pane.
   *
   * @param event the associated mouse event.
   */
Handles a mouse event triggered by initiating a mouse drag on the layer item pane.
@param event the associated mouse event.
Handles a mouse event triggered by initiating a mouse drag on the layer item pane . @param event the associated mouse event .
private void handleDragDetected(MouseEvent event) {
    if (event.isPrimaryButtonDown()) {
      Dragboard dragBoard = startDragAndDrop(TransferMode.MOVE);
      var snapshotParams = new SnapshotParameters();
      WritableImage image = snapshot(snapshotParams, null);
      dragBoard.setDragView(image);
      model.selectLayer(associatedLayerIndex);
      var content = new ClipboardContent();
      content.putString(String.valueOf(associatedLayerIndex));
      dragBoard.setContent(content);
    }
    event.consume();
  }
private void handleDragDetected ( MouseEvent event ) { if ( event . isPrimaryButtonDown ( ) ) { Dragboard dragBoard = startDragAndDrop ( TransferMode . MOVE ) ; var snapshotParams = new SnapshotParameters ( ) ; WritableImage image = snapshot ( snapshotParams , null ) ; dragBoard . setDragView ( image ) ; model . selectLayer ( associatedLayerIndex ) ; var content = new ClipboardContent ( ) ; content . putString ( String . valueOf ( associatedLayerIndex ) ) ; dragBoard . setContent ( content ) ; } event . consume ( ) ; }
Handles a mouse event triggered by initiating a mouse drag on the layer item pane.
Handles a mouse event triggered by initiating a mouse drag on the layer item pane .