use of com.helospark.tactview.core.timeline.subtimeline.ExposedDescriptorDescriptor in project tactview by helospark.
the class SubtimelineSelectWindow method open.
public Set<ExposedDescriptorDescriptor> open() {
Stage stage = new Stage();
BorderPane mainBorderPane = new BorderPane();
mainBorderPane.getStyleClass().add("dialog-root");
VBox vbox = new VBox();
vbox.getStyleClass().add("subtimeline-descriptor-properties-box");
for (var channel : timelineManagerAccessor.getChannels()) {
for (var clip : channel.getAllClips()) {
GridPane gridPane = new GridPane();
gridPane.getStyleClass().add("subtimeline-descriptor-properties-grid");
BorderPane borderPane = new BorderPane();
borderPane.setTop(new Label(nameToIdRepository.getNameForId(clip.getId()) + " properties"));
borderPane.setCenter(gridPane);
int index = 0;
for (var descriptor : clip.getDescriptors()) {
String descriptorId = descriptor.getKeyframeableEffect().getId();
ExposedDescriptorDescriptor descritporDescriptor = ExposedDescriptorDescriptor.builder().withId(descriptorId).withName(descriptor.getName()).withGroup(descriptor.getGroup().orElse(null)).build();
CheckBox checkBox = new CheckBox("");
checkBox.setSelected(false);
checkBox.selectedProperty().addListener((value, oldVal, newVal) -> {
if (newVal) {
descriptorDescriptors.put(descriptorId, descritporDescriptor);
} else {
descriptorDescriptors.remove(descriptorId);
}
});
Label label = new Label(descriptor.getName());
gridPane.add(checkBox, 0, index);
gridPane.add(label, 1, index);
++index;
}
vbox.getChildren().add(borderPane);
}
}
ScrollPane scrollPane = new ScrollPane(vbox);
mainBorderPane.setCenter(scrollPane);
mainBorderPane.setBottom(createButtonBar(stage));
Scene scene = new Scene(mainBorderPane);
stage.setWidth(700);
stage.setHeight(500);
stage.setScene(scene);
stage.setTitle("Select which properties are exposed");
stylesheetAdderService.setDefaultStyleSheetForDialog(stage, mainBorderPane);
stage.showAndWait();
return descriptorDescriptors.values().stream().collect(Collectors.toSet());
}
Aggregations