src/main/java/chalmers/pimp/controller/components/LayerItemPane.java
private void addListeners() {
    setOnDragDetected(this::handleDragDetected);
    setOnDragOver(this::handleDragOver);
    setOnDragDropped(this::handleDragDropped);
    setOnDragExited(this::handleDragExited);

    renameField.focusedProperty().addListener((observable, oldvalue, newvalue) -> {
      if (!newvalue && !renameButton.isFocused()) {
        standardPane.toFront();
      }
    });

    addEventHandler(MouseEvent.MOUSE_CLICKED, event -> {
      if (event.getButton() == MouseButton.PRIMARY) {
        selectLayer();
      } else if (event.getButton() == MouseButton.SECONDARY) {
        openContextMenu(event.getSceneX(), event.getSceneY());
      }
    });
  }
/**
   * Adds all relevant listeners to the root pane and other components.
   */
Adds all relevant listeners to the root pane and other components.
Adds all relevant listeners to the root pane and other components .
private void addListeners() {
    setOnDragDetected(this::handleDragDetected);
    setOnDragOver(this::handleDragOver);
    setOnDragDropped(this::handleDragDropped);
    setOnDragExited(this::handleDragExited);
    renameField.focusedProperty().addListener((observable, oldvalue, newvalue) -> {
      if (!newvalue && !renameButton.isFocused()) {
        standardPane.toFront();
      }
    });
    addEventHandler(MouseEvent.MOUSE_CLICKED, event -> {
      if (event.getButton() == MouseButton.PRIMARY) {
        selectLayer();
      } else if (event.getButton() == MouseButton.SECONDARY) {
        openContextMenu(event.getSceneX(), event.getSceneY());
      }
    });
  }
private void addListeners ( ) { setOnDragDetected ( this :: handleDragDetected ) ; setOnDragOver ( this :: handleDragOver ) ; setOnDragDropped ( this :: handleDragDropped ) ; setOnDragExited ( this :: handleDragExited ) ; renameField . focusedProperty ( ) . addListener ( ( observable , oldvalue , newvalue ) -> { if ( ! newvalue && ! renameButton . isFocused ( ) ) { standardPane . toFront ( ) ; } } ) ; addEventHandler ( MouseEvent . MOUSE_CLICKED , event -> { if ( event . getButton ( ) == MouseButton . PRIMARY ) { selectLayer ( ) ; } else if ( event . getButton ( ) == MouseButton . SECONDARY ) { openContextMenu ( event . getSceneX ( ) , event . getSceneY ( ) ) ; } } ) ; }
Adds all relevant listeners to the root pane and other components.
Adds all relevant listeners to the root pane and other components .