示例#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 initSelectionListener() {
   selectionFocusListener =
       c -> {
         if (selectionModel.getSelectedItems().isEmpty())
           tertiaryRoom.setCameraCenter(rnaSequence3D.computeCenter());
         if (selectionModel.getSelectedIndices().size() > 0) selectFocus();
       };
 }