/** * init fxml when loaded. */ @PostConstruct public void init() throws Exception { final Stage stage = (Stage) context.getRegisteredObject("Stage"); glyphDetailViewer = new GlyphDetailViewer(); detailsContainer.getChildren().add(glyphDetailViewer); ScrollPane scrollableGlyphs = allGlyphs(); scrollableGlyphs.setStyle(FX_BACKGROUND_INSETS_0); iconsContainer.getChildren().add(scrollableGlyphs); browseFont.setOnAction((action) -> { FileChooser fileChooser = new FileChooser(); FileChooser.ExtensionFilter extFilter = new FileChooser.ExtensionFilter("SVG files (*.svg)", "*.svg"); fileChooser.getExtensionFilters().add(extFilter); File file = fileChooser.showOpenDialog(stage); if (file != null) { SVGGlyphLoader.clear(); try { SVGGlyphLoader.loadGlyphsFont(new FileInputStream(file), file.getName()); ScrollPane newglyphs = allGlyphs(); newglyphs.setStyle(FX_BACKGROUND_INSETS_0); iconsContainer.getChildren().clear(); iconsContainer.getChildren().add(newglyphs); } catch (IOException ioExc) { ioExc.printStackTrace(); } } }); }
/** * @{inheritedDoc} */ @Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { this.configuration = configuration; this.controller = (AbstractViewController) controller; if (!toolbar.isPresent()) { toolbar = ToolbarUtils.buildToolbar((AbstractViewController) controller, this); } AbstractToolbar buildable = toolbar.orElse(null); if (buildable != null) { ScrollPane sc = NodeHelper.makeCentralScrollable(buildable.getDisplay()); sc.setStyle("-fx-padding:8"); getChildren().add(sc); } }
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; }
/** * @return menu content containing a list of credits */ protected final MenuContent createContentCredits() { log.debug("createContentCredits()"); ScrollPane pane = new FXGLScrollPane(); pane.setPrefWidth(app.getWidth() * 3 / 5); pane.setPrefHeight(app.getHeight() / 2); pane.setStyle("-fx-background:black;"); VBox vbox = new VBox(); vbox.setAlignment(Pos.CENTER); vbox.setPrefWidth(pane.getPrefWidth() - 15); List<String> credits = new ArrayList<>(getSettings().getCredits().getList()); credits.add(""); credits.add("Powered by FXGL " + FXGL.getVersion()); credits.add("Author: Almas Baimagambetov"); credits.add("https://github.com/AlmasB/FXGL"); credits.add(""); for (String credit : credits) { vbox.getChildren().add(getUIFactory().newText(credit)); } pane.setContent(vbox); return new MenuContent(pane); }
/** * 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; }
/** * @param processedView */ private void setLeft(Node processedView) { leftPane = processedView; if (orientation.get() == SwitchableTwoHPanesOrientation.LEFT) { NodeHelper.setHVGrow(processedView); leftFloatingPaneContent.getChildren().clear(); leftFloatingPaneContent.getChildren().add(leftPane); leftFloatingPaneContent.setCache(true); leftFloatingPaneContent.setCacheHint(CacheHint.SPEED); leftScrollPane.setStyle("-fx-effect: dropshadow(one-pass-box, -grey-color-400, 14.0, 0.2, 2.0, 1.0);"); } else { NodeHelper.setHVGrow(processedView); rightFloatingPaneContent.getChildren().clear(); rightFloatingPaneContent.getChildren().add(leftPane); rightFloatingPaneContent.setCache(true); rightFloatingPaneContent.setCacheHint(CacheHint.SPEED); } }
protected void openLeftPane() { closeRightPane(); if (!minimized.get()) { popOverFloatingScrollPane.setStyle(""); leftFloatingPaneContentWrapper.setVisible(true); // if the node was minimized before // the content is empty so rebuild it! if (leftFloatingPaneContent.getChildren().size() == 0) { leftFloatingPaneContent.getChildren().add(leftPopoverNode); leftPopoverNode.setVisible(true); } } else { popOverFloatingScrollPane.setVisible(true); beginPopOverLeft(); endPopOverRight(); } hideLeftPaneButton.setVisible(true); }
/** * Wrap a node into a scrollpane * * @param node * @return */ public static ScrollPane makeScrollable(Node node) { final ScrollPane scrollPane = new ScrollPane(); final StackPane stackPane = new StackPane(); stackPane.getChildren().add(node); final Group scrollPaneContent = new Group(stackPane); scrollPaneContent.setAutoSizeChildren(true); scrollPane.setContent(scrollPaneContent); scrollPane.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollPane.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollPane.setFitToHeight(false); scrollPane.setFitToWidth(true); scrollPane.setFocusTraversable(false); scrollPane.setStyle("-fx-background-color:white;-fx-padding:0 0 0 0;" + "-fx-border-color:transparent;"); return scrollPane; }
private void beginPopOverLeft() { leftFloatingPaneContentWrapper.setVisible(true); popOverFloatingScrollPane.setVisible(true); popOverFloatingPane.getChildren().clear(); popOverFloatingPane.getChildren().add(leftPopoverNode); popOverFloatingScrollPane.setStyle("-fx-effect:-ep-pane-left-pane-shadow-effect"); AnchorPane.clearConstraints(popOverFloatingScrollPane); AnchorPane.setTopAnchor(popOverFloatingScrollPane, 0.); AnchorPane.setBottomAnchor(popOverFloatingScrollPane, 0.); AnchorPane.setLeftAnchor(popOverFloatingScrollPane, 60.); final EasingInterpolator ei = new EasingInterpolator(EasingMode.IN_EXPO); TranslateTransition tt; popOverFloatingScrollPane.layout(); tt = NodeHelper.translateTo(-1000, 0, popOverFloatingScrollPane); tt.setDuration(Duration.millis(100)); tt.setInterpolator(ei); tt.play(); }
scrollPane.setFitToWidth(true); scrollPane.setFitToHeight(true); scrollPane.setStyle("-fx-focus-color: transparent;");
scrollPane.setFitToWidth(true); scrollPane.setFitToHeight(true); scrollPane.setStyle("-fx-focus-color: transparent;");