private ScrollPane allGlyphs() { List<SVGGlyph> glyphs = SVGGlyphLoader.getAllGlyphsIDs() .stream() .map(glyphName -> { try { return SVGGlyphLoader.getIcoMoonGlyph(glyphName); } catch (Exception e) { return null; } }) .collect(Collectors.toList()); glyphs.sort(Comparator.comparing(SVGGlyph::getName)); glyphs.forEach(glyph -> glyph.setSize(16)); List<Button> iconButtons = glyphs.stream().map(this::createIconButton).collect(Collectors.toList()); // important to improve the performance of animation in scroll pane so buttons are treated as images iconButtons.forEach(button -> button.setCache(true)); Platform.runLater(()->iconButtons.get(0).fire()); FlowPane glyphLayout = new FlowPane(); glyphLayout.setHgap(10); glyphLayout.setVgap(10); glyphLayout.setPadding(new Insets(10)); glyphLayout.getChildren().setAll(iconButtons); glyphLayout.setPrefSize(600, 300); ScrollPane scrollableGlyphs = new ScrollPane(glyphLayout); scrollableGlyphs.setFitToWidth(true); return scrollableGlyphs; }
scrollPane.setFitToWidth(true);
final ScrollPane scrollPane = new ScrollPane(); scrollPane.setContent(contentContainer); scrollPane.setFitToWidth(true); scrollPane.vvalueProperty().addListener((o, oldVal, newVal) -> { if (minHeight == -1) {
KeywordsTab() { VBox content = new VBox(); content.getStyleClass().add("info-props"); setText(DefaultI18nContext.getInstance().i18n("Keywords")); setClosable(false); keywords.setWrapText(true); keywords.getStyleClass().add("info-property-value"); content.getChildren().add(keywords); ScrollPane scroll = new ScrollPane(content); scroll.setFitToHeight(true); scroll.setFitToWidth(true); setContent(scroll); eventStudio().addAnnotatedListeners(this); }
@Inject public WorkArea(List<Module> modules, QuickbarModuleButtonsPane modulesButtons) { getStyleClass().addAll(Style.CONTAINER.css()); setId("work-area"); for (Module module : modules) { this.modules.put(module.id(), module); } fade.setFromValue(0); fade.setToValue(1); center.setHbarPolicy(ScrollBarPolicy.NEVER); center.setFitToWidth(true); center.setFitToHeight(true); setCenter(center); setLeft(new QuickbarPane(modulesButtons)); eventStudio().addAnnotatedListeners(this); }
BaseInfoTab() { setClosable(false); grid.getStyleClass().add("info-props"); grid.setAlignment(Pos.TOP_CENTER); ColumnConstraints column1 = new ColumnConstraints(); column1.setPercentWidth(25); ColumnConstraints column2 = new ColumnConstraints(); column2.setPercentWidth(75); grid.getColumnConstraints().addAll(column1, column2); ScrollPane scroll = new ScrollPane(grid); scroll.setFitToHeight(true); scroll.setFitToWidth(true); setContent(scroll); }
public NewsPanel() { getStyleClass().add("news-panel"); getStyleClass().addAll(Style.CONTAINER.css()); Button closeButton = FontAwesomeIconFactory.get().createIconButton(FontAwesomeIcon.TIMES); closeButton.getStyleClass().addAll("close-button"); closeButton.setOnAction(e -> eventStudio().broadcast(HideNewsPanelRequest.INSTANCE)); Label titleLabel = new Label(DefaultI18nContext.getInstance().i18n("What's new")); titleLabel.setPrefWidth(Integer.MAX_VALUE); titleLabel.getStyleClass().add("news-panel-title"); StackPane top = new StackPane(titleLabel, closeButton); top.setAlignment(Pos.TOP_RIGHT); scroll.getStyleClass().add("scrollable-news"); scroll.setHbarPolicy(ScrollBarPolicy.NEVER); scroll.setFitToHeight(true); scroll.setFitToWidth(true); getChildren().addAll(top, scroll); eventStudio().addAnnotatedListeners(this); }
DashboardItemPane(DashboardItem item) { requireNotNull(item, "Dashboard item cannot be null"); this.item = item; this.item.pane().getStyleClass().addAll(Style.DEAULT_CONTAINER.css()); this.item.pane().getStyleClass().addAll(Style.CONTAINER.css()); ScrollPane scroll = new ScrollPane(this.item.pane()); scroll.getStyleClass().addAll(Style.DEAULT_CONTAINER.css()); scroll.setFitToWidth(true); scroll.setHbarPolicy(ScrollBarPolicy.NEVER); scroll.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); setCenter(scroll); eventStudio().add(SetActiveModuleRequest.class, enableFooterListener, Integer.MAX_VALUE, ReferenceStrength.STRONG); }
FlowPane contentContainer = new FlowPane(); contentContainer.setVgap(10); contentContainer.setHgap(10); ScrollPane scroll = new ScrollPane(contentContainer); scroll.setFitToWidth(true); // fill FlowPane with some content ArrayList<Node> content = new ArrayList<>(); for (int i = 0; i < 15; i++) { Text text = new Text(Integer.toString(i)); text.setFill(Color.YELLOW); StackPane pane = new StackPane(text); pane.setStyle("-fx-background-color: blue;"); pane.setPrefSize(50, 50); content.add(pane); } contentContainer.getChildren().setAll(content);
/** * Default Constructor */ public Content() { getChildren().add(scroll); scroll.setFitToHeight(true); scroll.setFitToWidth(true); }
ScrollPane scrollPane = new ScrollPane(content); scrollPane.setFitToWidth(true); // scrollPane.prefHeightProperty().bind(top.heightProperty()); BorderPane root = new BorderPane(scrollPane); root.setTop(new MenuBar(new Menu("Foo"))); Scene scene = new Scene(root); aStage.setScene(scene); root.applyCss(); scrollPane.setPrefHeight(top.prefHeight(-1)); root.requestLayout(); aStage.sizeToScene(); aStage.show(); aStage.toFront();
@Override public void start(Stage stage) { TableView<ObservableList<String>> table = new TableView<ObservableList<String>>(); table.setMinWidth(400); ScrollPane sp = new ScrollPane(table); sp.setFitToHeight(true); sp.setFitToWidth(true); stage.setScene(new Scene(table, 800, 600)); stage.show(); } public static void main(String[] args) { launch(); }
/** * @{inheritedDoc} */ @Override public void displayAll() { if (scroll) { scrollPane.setFitToHeight(true); scrollPane.setFitToWidth(true); scrollPane.setContent(content); getChildren().add(scrollPane); } else { getChildren().add(content); NodeHelper.setHVGrow(content); } }
private Node wrapGrid(GridPane gridPane){ VBox vBox = new VBox(); vBox.getChildren().add(new Separator()); vBox.getChildren().add(gridPane); vBox.getChildren().add(new Separator()); ScrollPane scrollPane = new ScrollPane(vBox); scrollPane.setFitToWidth(true); // root.setFitToHeight(scrollPaneFitToHeight); scrollPane.setStyle("-fx-background-color:transparent;");//hide border // root.disableProperty().edit(disabledProperty()); return scrollPane; }
/** * @{inheritedDoc} */ @Override public void setRootConfig(VLViewComponentXML fieldsetListConfig) { boolean scroll = fieldsetListConfig.getBooleanProperty("scroll", true); if (scroll) { fieldsetBottomLayoutCenter.getChildren().add(scrollPane); scrollPane.setFitToHeight(true); scrollPane.setFitToWidth(true); scrollPane.setContent(contentLayout); } else { NodeHelper.styleClassAddAll(contentLayout, fieldsetListConfig, "styleClass", "fieldset-group-selector-top-tabed-content"); fieldsetBottomLayoutCenter.getChildren().add(contentLayout); } }
/** * Constructor */ public NotifsPane() { setAlignment(Pos.TOP_CENTER); notifsContainer.getStyleClass().add("notifications-pane"); NodeHelper.setVgrow(notifsContainer); // getChildren().addAll(notifsContainer, notifsFilter); scrollPane.setFitToHeight(true); scrollPane.setFitToWidth(true); getChildren().addAll(scrollPane); scrollPane.setContent(notifsContainer); }
/** * @{inheritedDoc} */ @Override public void setRootConfig(VLViewComponentXML fieldsetListConfig) { this.fieldsetConfiguration = fieldsetListConfig; boolean scroll = fieldsetListConfig.getBooleanProperty("scroll", true); if (scroll) { fieldsetTopLayoutCenter.getChildren().add(scrollPane); scrollPane.setFitToHeight(true); scrollPane.setFitToWidth(true); scrollPane.setContent(contentLayout); scrollPane.setVbarPolicy(ScrollBarPolicy.NEVER); NodeHelper.styleClassAddAll(contentLayout, fieldsetListConfig, "contentStyleClass", "fieldset-group-selector-top-tabed-content"); } else { NodeHelper.styleClassAddAll(contentLayout, fieldsetListConfig, "contentStyleClass", "fieldset-group-selector-top-tabed-content"); fieldsetTopLayoutCenter.getChildren().add(contentLayout); } NodeHelper.styleClassAddAll(header, fieldsetConfiguration, "headerStyleClass", "fieldset-group-selector-top-tabed-header"); }
/** * Wrap a node into a scrollpane, this scrollpane is attended to be in the center of the view. Because a padding of 32 is set in the right side of the scrollpane. * * @param node * @return */ public static ScrollPane makeCentralScrollable(Node node) { final ScrollPane scrollPane = new ScrollPane(); scrollPane.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollPane.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollPane.setContent(node); scrollPane.setFitToHeight(true); scrollPane.setFitToWidth(true); scrollPane.setFocusTraversable(false); scrollPane.setStyle("-fx-background-color: transparent;" + "-fx-padding:0 ;" + "-fx-border-color:transparent;"); return scrollPane; }
/** * {@inheritDoc} */ @Override public void initialise() { final Text title = new Text(tr("Engine tools")); title.getStyleClass().add("title"); final FlowPane toolButtonContainer = createToolButtonContainer(); final VBox toolsPane = new VBox(title, toolButtonContainer); toolsPane.getStyleClass().addAll("containerConfigurationPane"); final ScrollPane scrollPane = new ScrollPane(toolsPane); scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); scrollPane.setFitToWidth(true); getChildren().addAll(scrollPane); }
@Override protected void drawStepContent() { Text textWidget = new Text(textToShow); textWidget.setId("stepText"); ScrollPane scrollPane = new ScrollPane(); scrollPane.setId("stepScrollPane"); scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); scrollPane.setFitToWidth(true); scrollPane.setContent(new TextFlow(textWidget)); this.addToContentPane(scrollPane); VBox.setVgrow(scrollPane, Priority.ALWAYS); }