private void showLicensePopup() { Alert licenseAlert = new Alert(AlertType.INFORMATION); licenseAlert.setWidth(500); licenseAlert.setHeaderText("License"); ScrollPane scroll = new ScrollPane(); try { scroll.setContent(new TextArea(IOUtils.toString(getClass().getResourceAsStream("LICENSE"), StandardCharsets.UTF_8))); } catch (IOException e) { e.printStackTrace(); } licenseAlert.getDialogPane().setContent(scroll); licenseAlert.showAndWait(); }
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; }
final ScrollPane scrollPane = new ScrollPane(); scrollPane.setContent(contentContainer); scrollPane.setFitToWidth(true);
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); }
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); }
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); }
protected static ScrollPane createScrollPane(Node... nodes) { final VBox content = new VBox(nodes); final ScrollPane scrollPane = new ScrollPane(content); scrollPane.getStyleClass().add("sidebarScrollbar"); return scrollPane; } }
/** * Creates a {@link ScrollPane} containing the given {@link Node[] nodes}. * The nodes are shown below each other in the {@link ScrollPane} * * @param nodes The nodes inside the returned {@link ScrollPane} * @return A {@link ScrollPane} containing all given nodes */ protected static ScrollPane createScrollPane(Node... nodes) { final VBox content = new VBox(nodes); final ScrollPane scrollPane = new ScrollPane(content); scrollPane.getStyleClass().add("sidebarScrollbar"); return scrollPane; }
@Override public void start(Stage primaryStage) throws Exception { FlowPane iconsPane = new FlowPane(3, 3); for (WeatherIcon icon : WeatherIcon.values()) { iconsPane.getChildren().add(new WeatherIconView(icon, "3em")); } Scene scene = new Scene(new ScrollPane(iconsPane), 500, 500); primaryStage.setScene(scene); primaryStage.setTitle("FontAwesomeFX: WeatherIcons Demo"); primaryStage.show(); }
@Override public void start(Stage primaryStage) throws Exception { FlowPane iconsPane = new FlowPane(3,3); for (MaterialIcon icon : MaterialIcon.values()) { iconsPane.getChildren().add(new MaterialIconView(icon, "3em")); } Scene scene = new Scene(new ScrollPane(iconsPane), 500, 500); primaryStage.setScene(scene); primaryStage.setTitle("FontAwesomeFX: MaterialIcons Demo: " + MaterialIcon.values().length + " Icons"); primaryStage.show(); }
@Override public void start(Stage primaryStage) throws Exception { FlowPane iconsPane = new FlowPane(3, 3); for (OctIcon octicon : OctIcon.values()) { iconsPane.getChildren().add(new OctIconView(octicon, "3em")); } Scene scene = new Scene(new ScrollPane(iconsPane), 500, 500); primaryStage.setScene(scene); primaryStage.setTitle("OctIcons Demo: " + OctIcon.values().length + " Icons"); primaryStage.show(); }
@Override public void start(Stage primaryStage) throws Exception { FlowPane iconsPane = new FlowPane(3, 3); for (Icons525 icon : Icons525.values()) { iconsPane.getChildren().add(new Icons525View(icon, "3em")); } Scene scene = new Scene(new ScrollPane(iconsPane), 500, 500); primaryStage.setScene(scene); primaryStage.setTitle("FontAwesomeFX: 525 Icons Demo: " + Icons525.values().length + " Icons"); primaryStage.show(); }
@Override public void start(Stage primaryStage) throws Exception { FlowPane iconsPane = new FlowPane(3,3); for (MaterialDesignIcon icon : MaterialDesignIcon.values()) { iconsPane.getChildren().add(new MaterialDesignIconView(icon, "3em")); } Scene scene = new Scene(new ScrollPane(iconsPane), 500, 500); primaryStage.setScene(scene); primaryStage.setTitle("FontAwesomeFX: MaterialDesignIcons Demo: " + MaterialDesignIcon.values().length + " Icons"); primaryStage.show(); }
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; }
/** * {@inheritDoc} */ @Override public void initialise() { final ScrollPane scrollPane = new ScrollPane(); scrollPane.getStyleClass().add("iconListWidget"); scrollPane.setCache(true); scrollPane.setCacheHint(CacheHint.QUALITY); scrollPane.setContent(createContent(scrollPane)); getChildren().addAll(scrollPane); }
public NoticeBoard() { setManaged(false); String cssFileName = NoticeBoard.class.getSimpleName()+".css"; URL resource = NoticeBoard.class.getResource(cssFileName); getStylesheets().add(resource.toExternalForm()); getStyleClass().add("noticeBoardText"); ScrollPane scrollPane = new ScrollPane(); scrollPane.setLayoutX(20); scrollPane.setLayoutY(11); scrollPane.setMaxWidth(DEFAULT_WIDTH); scrollPane.setMinWidth(216); scrollPane.setMaxHeight(216); scrollPane.setMinHeight(216); scrollPane.setHbarPolicy(ScrollBarPolicy.NEVER); scrollPane.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); nbScrollPane = new NoticeBoardScrollPaneContent(); scrollPane.setContent(nbScrollPane); getChildren().addAll(scrollPane); }
/** * 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; }
@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); }
/** * {@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() { final String title = this.getParentWizardTitle(); VBox contentPane = new VBox(); contentPane.setId("presentationBackground"); Label titleWidget = new Label(title + "\n\n"); titleWidget.setId("presentationTextTitle"); Text textWidget = new Text(textToShow); textWidget.setId("presentationText"); TextFlow flow = new TextFlow(); flow.getChildren().add(textWidget); ScrollPane scrollPane = new ScrollPane(); scrollPane.setId("presentationScrollPane"); scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); scrollPane.setFitToWidth(true); scrollPane.setContent(flow); VBox.setVgrow(scrollPane, Priority.ALWAYS); contentPane.getChildren().add(scrollPane); getParent().getRoot().setCenter(contentPane); }