Example #1
0
  public void addDetector(String name) {

    TreeItem<String> clasROOT = new TreeItem<String>("CLAS12");

    this.treeView.setEditable(true);
    this.treeView.setCellFactory(CheckBoxTreeCell.<String>forTreeView());
    for (int sector = 1; sector <= 6; sector++) {
      MeshStore store = GeometryLoader.getGeometry("FTOF", sector, 1);
      store.setMaterial(0.6, 0.2, 0.2, 0.4);
      this.meshStores.put(store.getName(), store);
      // treeView = new TreeView<String>();
      // this.treeView.setRoot(store.getMeshTree());
      clasROOT.getChildren().add(store.getMeshTree());
      for (Map.Entry<String, MeshView> entry : store.getMap().entrySet()) {
        root.getChildren().add(entry.getValue());
      }
    }

    for (int sector = 1; sector <= 6; sector++) {
      MeshStore store = GeometryLoader.getGeometry("FTOF", sector, 2);
      store.setMaterial(0.1, 0.1, 0.4, 0.4);
      this.meshStores.put(store.getName(), store);
      // treeView = new TreeView<String>();
      clasROOT.getChildren().add(store.getMeshTree());
      for (Map.Entry<String, MeshView> entry : store.getMap().entrySet()) {
        root.getChildren().add(entry.getValue());
      }
    }

    for (int sector = 1; sector <= 6; sector++) {
      MeshStore store = GeometryLoader.getGeometry("FTOF", sector, 3);
      // store.setVisible(false);

      store.setMaterial(0.1, 0.4, 0.1, 0.4);
      this.meshStores.put(store.getName(), store);
      // treeView = new TreeView<String>();
      clasROOT.getChildren().add(store.getMeshTree());
      for (Map.Entry<String, MeshView> entry : store.getMap().entrySet()) {
        root.getChildren().add(entry.getValue());
      }
    }

    this.treeView.setRoot(clasROOT);
  }
Example #2
0
 public void testBST() {
   PhongMaterial mat = new PhongMaterial();
   mat.setDiffuseColor(new Color(0.1, 0.1, 0.8, 0.5));
   mat.setSpecularColor(new Color(0.1, 0.1, 0.8, 0.5));
   MeshStore store = GeometryLoader.getGeometry("EC");
   for (Map.Entry<String, MeshView> item : store.getMap().entrySet()) {
     item.getValue().setMaterial(mat);
     root.getChildren().add(item.getValue());
   }
 }