public static void smoothScrolling(ScrollPane scrollPane) { customScrolling(scrollPane, scrollPane.vvalueProperty(), bounds -> bounds.getHeight()); }
scrollPane.setContent(contentContainer); scrollPane.setFitToWidth(true); scrollPane.vvalueProperty().addListener((o, oldVal, newVal) -> { if (minHeight == -1) { minHeight = bottomBar.getBoundsInParent().getMinY();
public static void smoothScrolling(ScrollPane scrollPane) { customScrolling(scrollPane, scrollPane.vvalueProperty(), bounds -> bounds.getHeight()); }
/** * Scrolls the given value to visible using an animation */ static void scrollToVisible(@Nonnull ScrollPane scrollPane, double targetVValue, boolean animated) { if (!animated) { scrollPane.vvalueProperty().setValue(targetVValue); return; } final Timeline l_timeline = new Timeline(); l_timeline.getKeyFrames().add( new KeyFrame(Duration.millis(200), new KeyValue(scrollPane.vvalueProperty(), targetVValue, Interpolator.EASE_BOTH)) ); l_timeline.play(); }
public void appendTextToConsole(String text, ConsoleTextType textType) { final Text commandText = new Text(text); commandText.setWrappingWidth(console.getWidth()); commandText.getStyleClass().addAll("consoleText", textType.getCssName()); Platform.runLater(() -> { forceScroll = true; console.getChildren().add(commandText); console.layout(); consolePane.vvalueProperty().setValue(1.0); }); }
toolBar.getItems().add(sectionChoiceBox); setBottom(toolBar); scrollPane.vvalueProperty().addListener(new ChangeListener<Number>() { @Override public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) { if (!isLocalChange) {
@FXML private ImageView image; @FXML private Button back; @FXML private AnchorPane Instructions; @FXML private ScrollPane sp; private void setScrollPane() { sp.setContent(image); sp.setHbarPolicy(ScrollBarPolicy.NEVER); sp.setVbarPolicy(ScrollBarPolicy.ALWAYS); sp.setFitToWidth(true); sp.setFitToHeight(true); sp.vvalueProperty().addListener((ObservableValue<? extends Number> ov, Number old_val, Number new_val) -> { if (new_val.doubleValue() >= sp.getVmax()) { back.setVisible(true); } if (new_val.doubleValue() < sp.getVmax()) { back.setVisible(false); } }); }
consolePane.vvalueProperty().addListener((ov, oldValue, newValue) -> { if (forceScroll && (double) newValue != 1.0) { consolePane.vvalueProperty().setValue(1.0);
scrollPane.setContent(contentContainer); scrollPane.setFitToWidth(true); scrollPane.vvalueProperty().addListener((o, oldVal, newVal) -> { if (minHeight == -1) { minHeight = bottomBar.getBoundsInParent().getMinY();