コード例 #1
0
  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);
              }
            });
  }
コード例 #2
0
 private void bindMenuItemsToButtons() {
   pyrpurItem.selectedProperty().bindBidirectional(colorPyrpur.selectedProperty());
   augcItem.selectedProperty().bindBidirectional(colorAugc.selectedProperty());
   meshItem.selectedProperty().bindBidirectional(structureMesh.selectedProperty());
   stickItem.selectedProperty().bindBidirectional(structureStick.selectedProperty());
 }