container.setPadding(new Insets(24)); JFXScrollPane pane = new JFXScrollPane(); pane.setContent(container); button.setGraphic(arrow); button.setRipplerFill(Color.WHITE); pane.getTopBar().getChildren().add(button); pane.getBottomBar().getChildren().add(title); title.setStyle("-fx-text-fill:WHITE; -fx-font-size: 40;"); JFXScrollPane.smoothScrolling((ScrollPane) pane.getChildren().get(0));
public static void smoothScrolling(ScrollPane scrollPane) { customScrolling(scrollPane, scrollPane.vvalueProperty(), bounds -> bounds.getHeight()); }
/** * init fxml when loaded. */ @PostConstruct public void init() { for (int i = 0; i < 100; i++) { contentList.getItems().add("Item " + i); } contentList.setMaxHeight(3400); JFXScrollPane.smoothScrolling((ScrollPane) scroll.getChildren().get(0)); SVGGlyph arrow = new SVGGlyph(0, "FULLSCREEN", "M402.746 877.254l-320-320c-24.994-24.992-24.994-65.516 0-90.51l320-320c24.994-24.992 65.516-24.992 90.51 0 24.994 24.994 " + "24.994 65.516 0 90.51l-210.746 210.746h613.49c35.346 0 64 28.654 64 64s-28.654 64-64 64h-613.49l210.746 210.746c12.496 " + "12.496 18.744 28.876 18.744 45.254s-6.248 32.758-18.744 45.254c-24.994 24.994-65.516 24.994-90.51 0z", Color.WHITE); arrow.setSize(20, 16); backButton.setGraphic(arrow); backButton.setRipplerFill(Color.WHITE); } }
public JFXScrollPane() { this.getStyleClass().add(DEFAULT_STYLE_CLASS); this.setClip(clip); clip.widthProperty().bind(this.widthProperty()); clip.heightProperty().bind(this.heightProperty()); scale.setX(map(opacity, 0, 1, 1, 0.75)); scale.setY(map(opacity, 0, 1, 1, 0.75)); }); scrollPane.setPannable(true); getChildren().setAll(scrollPane, header);
/** * 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 }
JFXScrollPane.smoothHScrolling(this);
@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); }
public JFXScrollPane() { this.getStyleClass().add(DEFAULT_STYLE_CLASS); this.setClip(clip); clip.widthProperty().bind(this.widthProperty()); clip.heightProperty().bind(this.heightProperty()); scale.setX(map(opacity, 0, 1, 1, 0.75)); scale.setY(map(opacity, 0, 1, 1, 0.75)); }); scrollPane.setPannable(true); getChildren().setAll(scrollPane, header);
JFXScrollPane.smoothHScrolling(this);
public static void smoothHScrolling(ScrollPane scrollPane) { customScrolling(scrollPane, scrollPane.hvalueProperty(), bounds -> bounds.getWidth()); }
public static void smoothScrolling(ScrollPane scrollPane) { customScrolling(scrollPane, scrollPane.vvalueProperty(), bounds -> bounds.getHeight()); }
public static void smoothHScrolling(ScrollPane scrollPane) { customScrolling(scrollPane, scrollPane.hvalueProperty(), bounds -> bounds.getWidth()); }