Search in sources :

Example 1 with TreeModificationEvent

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;
}
Also used : CheckBoxTreeItem(javafx.scene.control.CheckBoxTreeItem) TreeModificationEvent(javafx.scene.control.CheckBoxTreeItem.TreeModificationEvent)

Aggregations

CheckBoxTreeItem (javafx.scene.control.CheckBoxTreeItem)1 TreeModificationEvent (javafx.scene.control.CheckBoxTreeItem.TreeModificationEvent)1