示例#1
0
 private void selectFocus() {
   Point3D p = new Point3D(0, 0, 0);
   Nucleotide n =
       selectionModel
           .getItems()[
           selectionModel
               .getSelectedIndices()
               .get(selectionModel.getSelectedIndices().size() - 1)];
   p = p.add(utils.fx3d.computeCenter(n.getNucleotideCoordinates()));
   p = p.add(utils.fx3d.computeCenter(n.getBaseCoordinates()));
   p = p.multiply(1 / ((double) 2));
   // fx3d.transiteFromTOo(tertiaryRoom.getCamera(), p);
   tertiaryRoom.setCameraCenter(p);
 }
示例#2
0
 private void initKeyEventHandler() {
   keyPressedEventHandler =
       event -> {
         if (event.getCode() == KeyCode.LEFT) {
           System.out.println("LEFT");
           int focus = selectionModel.getFocusIndex();
           selectionModel.deselect(focus);
           if (focus - 1 >= 0) {
             selectionModel.select(focus - 1);
           }
           event.consume();
         }
         if (event.getCode() == KeyCode.RIGHT) {
           System.out.println("RIGHT");
           int focus = selectionModel.getFocusIndex();
           selectionModel.deselect(focus);
           if (focus + 1 < selectionModel.getItems().length) {
             selectionModel.select(focus + 1);
           }
           event.consume();
         }
       };
 }