use of org.csstudio.display.builder.model.properties.Direction in project org.csstudio.display.builder by kasemir.
the class NavigationTabsDemo method start.
@Override
public void start(final Stage stage) {
final NavigationTabs nav_tabs = new NavigationTabs();
final List<String> tabs = IntStream.range(1, 10).mapToObj(i -> "Step" + i).collect(Collectors.toList());
nav_tabs.setTabs(tabs);
nav_tabs.setTabSize(80, 40);
nav_tabs.setTabSpacing(5);
nav_tabs.getBodyPane().getChildren().setAll(new Label(" Go on, select something!"));
nav_tabs.addListener(index -> {
System.out.println("User selected tab " + index);
final Label label = new Label("You selected tab " + (index + 1));
label.setLayoutX(index * 10);
label.setLayoutY(index * 15);
nav_tabs.getBodyPane().getChildren().setAll(label);
});
nav_tabs.selectTab(2);
final Button direction = new Button("Change direction");
direction.setOnAction(e -> nav_tabs.setDirection(Direction.values()[1 - nav_tabs.getDirection().ordinal()]));
final BorderPane layout = new BorderPane();
layout.setCenter(nav_tabs);
layout.setBottom(direction);
final Scene scene = new Scene(layout);
// Enable scene debugging?
// ScenicView.show(scene);
JFXRepresentation.setSceneStyle(scene);
stage.setTitle("Navigation Tab Demo");
stage.setScene(scene);
stage.setWidth(800);
stage.setHeight(600);
stage.show();
}
Aggregations