use of javafx.scene.control.CheckBoxTreeItem.TreeModificationEvent in project DistributedFractalNetwork by Budder21.
the class FractalEditor method getNewTreeItem.
@SuppressWarnings({ "rawtypes", "unchecked" })
private CheckBoxTreeItem getNewTreeItem() {
CheckBoxTreeItem i = new CheckBoxTreeItem(new MetaLayer("Layer" + incrementLayers(), "HistogramLayer"));
i.setSelected(true);
i.addEventHandler(CheckBoxTreeItem.checkBoxSelectionChangedEvent(), new EventHandler<CheckBoxTreeItem.TreeModificationEvent>() {
public void handle(TreeModificationEvent event) {
int index = layers.getRoot().getChildren().size() - 2 - layers.getRoot().getChildren().indexOf(i);
fractal.setLayerVisiblity(index, i.selectedProperty().get());
updateFractalImage();
}
});
return i;
}
Aggregations