Example #1
0
  /** initialize tertiary structure view */
  private void initTertiaryView() {
    Group models3D = new Group();
    rnaSequence3D = new RNASequence(model.getPdbfile());

    if (tertiaryRoom == null) {
      tertiaryRoom = new Room(models3D, 50, 50);
      tertiaryRoom.rotateCamera(tertiaryRoom);
      tertiaryRoom.scaleCamera(scene);
      tertiaryRoom.alignToParent(pane3D);
      tertiaryRoom.setPickOnBounds(false);
      pane3D.getChildren().add(tertiaryRoom);
    } else {
      tertiaryRoom.setObject(rnaSequence3D);
    }

    if (reloadItem.isSelected()) loadOneModel(0);
    if (!reloadItem.isSelected()) loadAllmodels();
    ((MeshModel) rnaSequence3D.getModels().get(1)).colorPyrPur();

    rnaSequence3D.setSelectionModel(selectionModel);
    tertiaryRoom.setCameraCenter(rnaSequence3D.computeCenter());

    activateRightSideButtons();
  }
Example #2
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);
              }
            });
  }