pane.getBottomBar().getChildren().add(title); title.setStyle("-fx-text-fill:WHITE; -fx-font-size: 40;"); JFXScrollPane.smoothScrolling((ScrollPane) pane.getChildren().get(0));
/** * Wrap a {@link JFXListView} on a {@link JFXScrollPane} adding functionality. * * @param pane * the {@link JFXScrollPane} pane * @param node * the {@link Node} * @param titleString * the {@link String} title * @param cssId * the cssId */ // CHECKSTYLE:OFF Magicnumber AH DI MI TOCCA public static void wrapNodeOnScrollPane(final JFXScrollPane pane, final Node node, final String titleString, final String cssId) { // list.setMinHeight(1000); //ACTIVATE SCROLL final StackPane container = new StackPane(node); container.setPadding(new Insets(-1)); pane.setContent(container); final Label title = new Label(titleString); pane.getBottomBar().getChildren().add(title); title.setStyle("-fx-text-fill:WHITE; -fx-font-size: 40;"); StackPane.setMargin(title, new Insets(0, 0, 0, 80)); StackPane.setAlignment(title, Pos.CENTER_LEFT); pane.getMainHeader().setId(cssId); // CHECKSTYLE:ON Magicnumber }
@Override public void loadUserProfile(final String name) { try { // Load the actual user this.recognizer.loadUserProfile(name); } catch (final IOException e1) { ViewUtilities.showNotificationPopup("User Dataset not found", "Regenerating it", Duration.MEDIUM, // NOPMD NotificationType.ERROR, t -> e1.printStackTrace()); } catch (final JsonSyntaxException e2) { ViewUtilities.showNotificationPopup("Json file changed by human!", "Please click to se exception", Duration.MEDIUM, // NOPMD NotificationType.ERROR, t -> e2.printStackTrace()); } // Set User name in scroll bar ((Label) this.userScrollPane.getBottomBar().getChildren().get(0)).setText(name); // Load user gestures ViewUtilities.showSnackBar((Pane) this.recorderPane.getCenter(), "Database loaded and Gesture updated!", Duration.MEDIUM, DimDialogs.SMALL, null); // Create the gesture tree representation. this.createGestureTreeView(this.recognizer.getUserName()); // Initialize the gesture length. this.gestureLength = this.recognizer.getUserGestureLength(); // Initialize Charts this.setChart(this.gestureLength.getFrameNumber(), this.gestureLength.getFrameNumber()); this.startButton.setDisable(false); }