@Override public void start(Stage stage) { Pane root = new Pane(); for(int i = 0 ;i < 4000; i++) { Label child = new Label("label" + i); child.setLayoutX(Math.random() * 500 + 100); child.setLayoutY(Math.random() * 500+ 100); root.getChildren().add(child); } root.getChildren().add(build()); FPSDecorator decorator = new FPSDecorator(stage, root); final Scene scene = new Scene(decorator, 800, 800); stage.setScene(scene); stage.setResizable(true); stage.show(); afterShow(stage); }
/** * Constructor */ public NavigationBar() { super(); IconUtils.setHeaderNavigationBack(backIcon); backIcon.getStyleClass().addAll("transparent-focus", "empty-padding", "scale-down-on-click"); backIcon.setOnAction(e -> goBack()); pane.getChildren().addAll(location0, location1, backIcon); getChildren().add(pane); NodeHelper.setHVGrow(pane); getStyleClass().add("ep-header-center-area-nav-bar-container"); location0.getStyleClass().add("previous-location-item-label"); location1.getStyleClass().add("current-location-item-label"); backIcon.setLayoutX(16); backIcon.setLayoutY(15); location0.setLayoutX(46); location0.setLayoutY(18); location1.setLayoutX(22); location1.setLayoutY(65); }
x = -barXPosition; label.setLayoutX(x + TITLE_LABEL_INDENT); } else { label.setText(SHORT_TEXT); label.setLayoutX(TITLE_LABEL_INDENT); expandedStateLabel.setLayoutX(x);
time.setLayoutX(ph.getWidth() - spacing - 32); dateTxt.setLayoutX(time.getLayoutX() - spacing - dateTxt.getBoundsInLocal().getWidth()); dateTxt.setTextOrigin(VPos.BASELINE);
background.setHeight(newValue.getHeight()); Dimension2D titleDim = textSize.calculate(control.getTitle(), openPatrician24); title.setLayoutX((newValue.getWidth() - titleDim.getWidth())/2 + frame.getInsetBackground().getX()); titleBackground.setLayoutX((newValue.getWidth() - titleWidth)/2 + frame.getInsetBackground().getX() + 20); Dimension2D titleDim = textSize.calculate(control.getTitle(), openPatrician24); title.setLayoutX((frame.getBackgroundDimension().getWidth() - titleDim.getWidth())/2 + newValue.getX()); titleBackground.setLayoutX((frame.getBackgroundDimension().getWidth() - titleWidth)/2 + newValue.getX() + 20); }); title.textProperty().addListener((observable, oldValue, newValue) -> { Dimension2D titleDim = textSize.calculate(control.getTitle(), openPatrician24); title.setLayoutX((frame.getBackgroundDimension().getWidth() - titleDim.getWidth())/2 + frame.getInsetBackground().getX()); }); desc.textProperty().addListener((observable, oldValue, newValue) -> {