Java Code Examples for javafx.scene.control.ScrollPane#setStyle()

The following examples show how to use javafx.scene.control.ScrollPane#setStyle() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ClientDisplay.java    From Open-Lowcode with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * @return a display with no page shown
 */
public Node getEmptyDisplay() {
	logger.severe("Setting empty display");
	BorderPane mainpane = new BorderPane();
	mainpane.setBackground(new Background(new BackgroundFill(Color.WHITE, null, null)));
	connectionbar = new ConnectionBar(this, urltoconnectto, this.questionmarkicon);

	this.userinteractionwidgets.add(connectionbar);

	Pane connectionpanel = connectionbar.getPane();
	mainpane.setTop(connectionpanel);
	BorderPane.setMargin(connectionpanel, new Insets(3, 5, 3, 5));
	Pane statusbar = generateStatusBar();

	mainpane.setBottom(statusbar);
	BorderPane.setMargin(statusbar, new Insets(3, 5, 3, 5));
	ScrollPane contentholder = new ScrollPane();
	contentholder.setStyle("-fx-background: rgb(255,255,255);");
	contentholder.setBorder(Border.EMPTY);
	mainpane.setCenter(contentholder);
	this.contentholder = contentholder;
	return mainpane;

}
 
Example 2
Source File: ControlPropertiesEditorPane.java    From arma-dialog-creator with MIT License 6 votes vote down vote up
/** @return a titled pane for the accordion that holds all properties of a certain {@link ConfigPropertyCategory} */
@NotNull
private PlaceholderTitledPane getPropertiesTitledPane(@NotNull String title, @NotNull ConfigPropertyCategory category) {
	final VBox vb = new VBox(10);
	vb.setFillWidth(true);
	vb.setPadding(new Insets(5));
	final Label lblNoProps = new Label(bundle.getString("ControlPropertiesConfig.no_properties_available"));
	final PlaceholderTitledPane tp = new PlaceholderTitledPane(title, lblNoProps, vb, true);
	final ScrollPane scrollPane = tp.getScrollPane();
	if (scrollPane != null) {
		scrollPane.setFitToWidth(true);
		scrollPane.setStyle("-fx-background-color:transparent");
	}
	tp.setAnimated(false);

	return tp;
}
 
Example 3
Source File: HistoryListPopup.java    From arma-dialog-creator with MIT License 6 votes vote down vote up
public HistoryListPopup(@Nullable String popupTitle, @NotNull HistoryListProvider provider) {
	super(ArmaDialogCreator.getPrimaryStage(), new VBox(5), popupTitle);
	this.provider = provider;

	myRootElement.setPadding(new Insets(10));
	final ScrollPane scrollPane = new ScrollPane(stackPaneWrapper);
	VBox.setVgrow(scrollPane, Priority.ALWAYS);
	scrollPane.setFitToHeight(true);
	scrollPane.setFitToWidth(true);
	scrollPane.setStyle("-fx-background-color:transparent");

	myRootElement.getChildren().addAll(scrollPane, new Separator(Orientation.HORIZONTAL), getBoundResponseFooter(false, true, false));

	gridPaneContent.setVgap(15);
	gridPaneContent.setHgap(5);
	ColumnConstraints constraints = new ColumnConstraints(-1, -1, Double.MAX_VALUE, Priority.ALWAYS, HPos.CENTER, true);
	gridPaneContent.getColumnConstraints().addAll(constraints, constraints);

	myStage.setMinWidth(320);
	myStage.setMinHeight(320);
	myStage.setWidth(480);

	stackPaneWrapper.setPrefHeight(320);

	fillContent();
}
 
Example 4
Source File: LogWindow.java    From PDF4Teachers with Apache License 2.0 5 votes vote down vote up
public LogWindow(){

        Pane root = new Pane();
        Scene scene = new Scene(root, Main.SCREEN_BOUNDS.getWidth()-200 >= 1200 ? 1200 : Main.SCREEN_BOUNDS.getWidth()-200, Main.SCREEN_BOUNDS.getHeight()-200 >= 675 ? 675 : Main.SCREEN_BOUNDS.getHeight()-200);

        getIcons().add(new Image(getClass().getResource("/logo.png")+""));
        setResizable(true);
        setTitle(TR.tr("PDF4Teachers - Console"));
        setScene(scene);
        setOnCloseRequest(e -> {
            updater.stop();
            close();
        });
        new JMetro(scene, Style.DARK);

        Pane pane = new Pane();
        root.setStyle("-fx-background-color: black;");
        ScrollPane scrollPane = new ScrollPane(pane);
        scrollPane.setStyle("-fx-background-color: black;");
        scrollPane.setFitToHeight(true);
        scrollPane.setFitToWidth(true);
        scrollPane.prefWidthProperty().bind(scene.widthProperty());
        scrollPane.prefHeightProperty().bind(scene.heightProperty());
        pane.minHeightProperty().bind(text.heightProperty());
        root.getChildren().add(scrollPane);
        setupUi(pane);

        show();
    }
 
Example 5
Source File: DiagramTab.java    From JetUML with GNU General Public License v3.0 4 votes vote down vote up
/**
    * Constructs a diagram tab initialized with pDiagram.
    * @param pDiagram The initial diagram
 */
public DiagramTab(Diagram pDiagram)
{
	aDiagram = pDiagram;
	DiagramTabToolBar sideBar = new DiagramTabToolBar(pDiagram);
	UserPreferences.instance().addBooleanPreferenceChangeHandler(sideBar);
	aDiagramCanvas = new DiagramCanvas(pDiagram);
	UserPreferences.instance().addBooleanPreferenceChangeHandler(aDiagramCanvas);
	aDiagramCanvasController = new DiagramCanvasController(aDiagramCanvas, sideBar, this);
	aDiagramCanvas.setController(aDiagramCanvasController);
	aDiagramCanvas.paintPanel();
	
	BorderPane layout = new BorderPane();
	layout.setRight(sideBar);

	// We put the diagram in a fixed-size StackPane for the sole purpose of being able to
	// decorate it with CSS. The StackPane needs to have a fixed size so the border fits the 
	// canvas and not the parent container.
	StackPane pane = new StackPane(aDiagramCanvas);
	final int buffer = 12; // (border insets + border width + 1)*2
	pane.setMaxSize(aDiagramCanvas.getWidth() + buffer, aDiagramCanvas.getHeight() + buffer);
	final String cssDefault = "-fx-border-color: grey; -fx-border-insets: 4;"
			+ "-fx-border-width: 1; -fx-border-style: solid;";
	pane.setStyle(cssDefault);
	
	// We wrap pane within an additional, resizable StackPane that can grow to fit the parent
	// ScrollPane and thus center the decorated canvas.
	ScrollPane scroll = new ScrollPane(new StackPane(pane));
	
	// The call below is necessary to removes the focus highlight around the Canvas
	// See issue #250
	scroll.setStyle("-fx-focus-color: transparent; -fx-faint-focus-color: transparent;"); 

	scroll.setFitToWidth(true);
	scroll.setFitToHeight(true);
	layout.setCenter(scroll);
	
	setTitle();
	setContent(layout);

	setOnCloseRequest(pEvent -> 
	{
		pEvent.consume();
		EditorFrame editorFrame = (EditorFrame) getTabPane().getParent();
		editorFrame.close(this);
	});
}