private void selectionFocusBinding() { if (selectionFocusItem.isSelected()) { selectionModel.getSelectedItems().addListener(selectionFocusListener); } selectionFocusItem .selectedProperty() .addListener( (observable, oldValue, newValue) -> { if (newValue == oldValue) return; if (newValue && !oldValue) { selectionModel.getSelectedItems().addListener(selectionFocusListener); } else { selectionModel.getSelectedItems().removeListener(selectionFocusListener); } }); }
private void bindMenuItemsToButtons() { pyrpurItem.selectedProperty().bindBidirectional(colorPyrpur.selectedProperty()); augcItem.selectedProperty().bindBidirectional(colorAugc.selectedProperty()); meshItem.selectedProperty().bindBidirectional(structureMesh.selectedProperty()); stickItem.selectedProperty().bindBidirectional(structureStick.selectedProperty()); }