當前位置: 首頁>>代碼示例>>Java>>正文


Java ScrollPane.setFitToHeight方法代碼示例

本文整理匯總了Java中javafx.scene.control.ScrollPane.setFitToHeight方法的典型用法代碼示例。如果您正苦於以下問題:Java ScrollPane.setFitToHeight方法的具體用法?Java ScrollPane.setFitToHeight怎麽用?Java ScrollPane.setFitToHeight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.control.ScrollPane的用法示例。


在下文中一共展示了ScrollPane.setFitToHeight方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createTextArea

import javafx.scene.control.ScrollPane; //導入方法依賴的package包/類
private Node createTextArea(boolean selectable, boolean editable) {
    textArea = new TextArea();
    textArea.setPrefRowCount(4);
    textArea.setEditable(editable);
    textArea.textProperty().addListener((observable, oldValue, newValue) -> {
        text = textArea.getText();
    });
    textArea.setText(text);
    ScrollPane scrollPane = new ScrollPane(textArea);
    scrollPane.setFitToWidth(true);
    scrollPane.setFitToHeight(true);
    scrollPane.setHbarPolicy(ScrollBarPolicy.NEVER);
    scrollPane.setVbarPolicy(ScrollBarPolicy.ALWAYS);
    HBox.setHgrow(scrollPane, Priority.ALWAYS);
    return scrollPane;
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:17,代碼來源:CheckList.java

示例2: FlowCardComposite

import javafx.scene.control.ScrollPane; //導入方法依賴的package包/類
/**
 * @param nodeConverter
 */
public FlowCardComposite() {

	scrollPane = new ScrollPane();
	scrollPane.setFitToHeight(true);
	scrollPane.setFitToWidth(true);
	scrollPane.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
	StackPane stackPane = new StackPane(scrollPane);
	stackPane.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
	masonryPane = new JFXMasonryPane();

	scrollPane.setContent(masonryPane);

	setCenter(stackPane);

	initialize();

	masonryPane.setCache(false);
	setStyle("-fx-background-color : #292929");
}
 
開發者ID:callakrsos,項目名稱:Gargoyle,代碼行數:23,代碼來源:FlowCardComposite.java

示例3: HistoryListPopup

import javafx.scene.control.ScrollPane; //導入方法依賴的package包/類
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();
}
 
開發者ID:kayler-renslow,項目名稱:arma-dialog-creator,代碼行數:27,代碼來源:HistoryListPopup.java

示例4: MemristorParametersUI

import javafx.scene.control.ScrollPane; //導入方法依賴的package包/類
public MemristorParametersUI(MemristorLibrary.Memristor_Model memristorType) {
    dm = new DialogsManager();
    savedFileCount = 0;
    this.memristorType = memristorType;
    memristor = MemristorLibrary.GetNewMemristor(memristorType);
    selectedPreset = 0;
    simulationType = ResourcesMAF.MONTECARLO_SIMULATION;
    // Main GridPane
    GridPane gridPane = new GridPane();
    gridPane.setPadding(new Insets(15, 15, 15, 15));
    gridPane.setHgap(5);
    gridPane.setVgap(5);
    gridPane.setAlignment(Pos.CENTER);
    // Create UI
    RecreateParameterAndVariationsUI(gridPane, memristorType.index());
    // Set content in scroll pane
    ScrollPane sp = new ScrollPane();
    sp.setContent(gridPane);
    sp.setFitToHeight(true);
    sp.setFitToWidth(true);
    this.getChildren().add(sp);

}
 
開發者ID:fgr1986,項目名稱:maf,代碼行數:24,代碼來源:MemristorParametersUI.java

示例5: start

import javafx.scene.control.ScrollPane; //導入方法依賴的package包/類
@Override
public void start(Stage primaryStage) throws Exception {
    if (primaryStage == null) {
        return;
    }

    /* Layers */
    Group backgroundLayer = new Group();
    Group statesLayer = new Group();
    Group selectionLayer = new Group();

    Pane paintingPane = new Pane(backgroundLayer, statesLayer, selectionLayer);
    paintingPane.setStyle(BACKGROUND_STYLE);

    /* Top-level */
    Pane contentPane = new Pane(paintingPane);
    contentPane.minWidthProperty().bind(contentPane.prefWidthProperty());
    contentPane.maxWidthProperty().bind(contentPane.prefWidthProperty());

    ScrollPane scrollPane = new ScrollPane(contentPane);
    scrollPane.setVbarPolicy(ScrollBarPolicy.ALWAYS);
    scrollPane.setHbarPolicy(ScrollBarPolicy.ALWAYS);
    scrollPane.setFitToHeight(true);
    scrollPane.setFitToWidth(true);
    scrollPane.setPannable(true);

    BorderPane borderPane = new BorderPane(scrollPane);

    primaryStage.setScene(new Scene(borderPane));
    primaryStage.show();
    primaryStage.setHeight(500);
    primaryStage.setWidth(500);

    contentPane.setPrefHeight(200);
    contentPane.setPrefWidth(PANE_WIDTH);

    /* Bind painting pane's height to the content pane */
    paintingPane.minHeightProperty().bind(contentPane.minHeightProperty());
    paintingPane.prefHeightProperty().bind(contentPane.prefHeightProperty());
    paintingPane.maxHeightProperty().bind(contentPane.maxHeightProperty());

    /* We set painting's pane width programmatically */
    paintingPane.minWidthProperty().bind(paintingPane.prefWidthProperty());
    paintingPane.maxWidthProperty().bind(paintingPane.prefWidthProperty());

    paintingPane.setPrefWidth(2000);
    double x = PANE_WIDTH - 2000;
    System.out.println(x);
    paintingPane.relocate(x, 0);

    drawBackground(backgroundLayer, paintingPane);
    drawRectangles(statesLayer);
    drawSelection(selectionLayer, paintingPane);
}
 
開發者ID:lttng,項目名稱:lttng-scope,代碼行數:55,代碼來源:UiModelApp2.java

示例6: start

import javafx.scene.control.ScrollPane; //導入方法依賴的package包/類
@Override
public void start(Stage primaryStage) throws Exception {
    if (primaryStage == null) {
        return;
    }

    /* Layers */
    Group backgroundLayer = new Group();
    Group statesLayer = new Group();
    Group selectionLayer = new Group();

    /* Top-level */
    Pane contentPane = new Pane(backgroundLayer, statesLayer, selectionLayer);
    contentPane.minWidthProperty().bind(contentPane.prefWidthProperty());
    contentPane.maxWidthProperty().bind(contentPane.prefWidthProperty());
    contentPane.setStyle(BACKGROUND_STYLE);

    ScrollPane scrollPane = new ScrollPane(contentPane);
    scrollPane.setVbarPolicy(ScrollBarPolicy.ALWAYS);
    scrollPane.setHbarPolicy(ScrollBarPolicy.ALWAYS);
    scrollPane.setFitToHeight(true);
    scrollPane.setFitToWidth(true);
    scrollPane.setPannable(true);

    BorderPane borderPane = new BorderPane(scrollPane);

    primaryStage.setScene(new Scene(borderPane));
    primaryStage.show();
    primaryStage.setHeight(500);
    primaryStage.setWidth(500);

    contentPane.setPrefHeight(200);
    contentPane.setPrefWidth(PANE_WIDTH);

    drawBackground(backgroundLayer, contentPane);
    drawRectangles(statesLayer);
    drawSelection(selectionLayer, contentPane);
}
 
開發者ID:lttng,項目名稱:lttng-scope,代碼行數:39,代碼來源:UiModelApp.java

示例7: licencesp

import javafx.scene.control.ScrollPane; //導入方法依賴的package包/類
private ScrollPane licencesp(double width, double height) {

        ScrollPane sp = new ScrollPane();

        Text text = new Text();

        text.setX(width * 0.1);
        text.setY(height * 0.1);
        text.setFont(new Font(20));

        text.setFill(new Color(1, 1, 1, 1));

        StringBuilder licence = new StringBuilder(10000);
        String line;

        try {
            BufferedReader br = new BufferedReader(new FileReader("data/common/licence.txt"));

            while ((line = br.readLine()) != null) {
                licence.append('\n');
                licence.append(line);
            }
            br.close();
        } catch (IOException e) {
            log.error("Exception", e);
        }

        text.setText(licence.toString());

        sp.setContent(text);
        sp.setFitToHeight(true);
        sp.setFitToWidth(true);
        sp.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
        sp.setVmax(height);
        // sp.setPrefSize(width*0.8, height*0.8);

        return sp;

    }
 
開發者ID:schwabdidier,項目名稱:GazePlay,代碼行數:40,代碼來源:License.java

示例8: productbyType

import javafx.scene.control.ScrollPane; //導入方法依賴的package包/類
public static BorderPane productbyType(String type) {

        BorderPane products = new BorderPane();
        products.setPadding(new Insets(10,20,10,20));

        Connection con = null;
        PreparedStatement stmt = null;
        ResultSet rs = null;

        String query = DBUtils.prepareSelectQuery(" * ",
                " classroomflipkart.productdetail AS T ," +
                        " ( "+ DBUtils.prepareSelectQuery("productId",
                                " classroomflipkart.homeproducts ",
                                "type = '"+type+"'")+
                        " ) AS S",
                " T.productId = S.productId ");

        try {
            con = DBUtils.getConnection();
            stmt = con.prepareStatement(query);
            rs = stmt.executeQuery();

            rs.last();
            int size = rs.getRow();

            if (size>0){
                rs.beforeFirst();

                Label title = new Label(type+"");
                title.setFont(Font.font("Open Sans", FontWeight.BOLD,17));
                title.setPadding(new Insets(10));
                title.setAlignment(Pos.CENTER);

                HBox productList = new HBox(20);
                productList.setAlignment(Pos.CENTER);

                while (rs.next()) {
                    String productId = rs.getString("productId");
                    String productName = rs.getString("productName");
                    String newPrice = rs.getString("newPrice");
                    String oldPrice = rs.getString("oldPrice");
                    String category = rs.getString("category");
                    String subcategory = rs.getString("subcategory");
                    String imageName = rs.getString("imageName");
                    String productAvailability = rs.getString("productAvailability");

                    productList.getChildren().add(productDetail.productByType(productId,productName,newPrice,oldPrice,category,subcategory,imageName, productAvailability));
                }

                ScrollPane proScroller = new ScrollPane(productList);
                proScroller.setFitToHeight(true);
                proScroller.setFitToWidth(true);
                proScroller.setPannable(true);
                proScroller.setPadding(new Insets(0,0,30,0));

                StackPane titlePane = new StackPane(title);
                titlePane.setAlignment(Pos.CENTER);

                StackPane productPane = new StackPane(proScroller);
                productPane.setAlignment(Pos.CENTER);

                products.setTop(titlePane);
                products.setCenter(productPane);
            }


        } catch (Exception e) {
            products.setCenter(new Label(e.getMessage()));
            e.printStackTrace();
        } finally {
            DBUtils.closeAll(rs, stmt, con);
            return products;
        }
    }
 
開發者ID:madHEYsia,項目名稱:ClassroomFlipkart,代碼行數:75,代碼來源:fetchProducts.java

示例9: initBoxes

import javafx.scene.control.ScrollPane; //導入方法依賴的package包/類
private void initBoxes(Pane root, Scene scene) {
    VBox vBox = Nodes.TEXT_VBOX;
    HBox hBox = Nodes.TEXTBAR_HBOX;
    ScrollPane scrollPane = Nodes.SCROLL_PANE;

    vBox.setTranslateY(10);
    vBox.setTranslateX(10);
    vBox.prefWidthProperty().bind(scene.widthProperty().subtract(10));
    vBox.prefHeightProperty().bind(scene.heightProperty().subtract(20).subtract(preferences.getDouble("textbar-height")));
    vBox.setSpacing((preferences.getDouble("messages-spacing-level") - 1)*10-5);


    hBox.setPrefWidth(scene.getWidth());
    hBox.setPrefHeight(preferences.getDouble("textbar-height"));
    hBox.setTranslateY(scene.getHeight() - hBox.getPrefHeight());
    hBox.setSpacing(20);

    root.widthProperty().addListener(o -> hBox.setPrefWidth(root.getWidth()));
    root.heightProperty().addListener(o -> hBox.setTranslateY(scene.getHeight() - Nodes.TEXTBAR_HBOX.getPrefHeight()));

    scrollPane.setContent(vBox);
    scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    scrollPane.setTranslateX(vBox.getTranslateX());
    scrollPane.setTranslateY(vBox.getTranslateY());
    scrollPane.maxWidthProperty().bind(vBox.prefWidthProperty());
    scrollPane.prefWidthProperty().bind(vBox.prefWidthProperty());
    scrollPane.prefHeightProperty().bind(vBox.prefHeightProperty());
    scrollPane.setFitToWidth(true);
    scrollPane.setFitToHeight(true);
}
 
開發者ID:iAmGio,項目名稱:jrfl,代碼行數:32,代碼來源:Jrfl.java

示例10: wrapForScroll

import javafx.scene.control.ScrollPane; //導入方法依賴的package包/類
protected ScrollPane wrapForScroll(Pane rootGrid) {
	ScrollPane scrollPane = new ScrollPane(rootGrid);
	scrollPane.setPadding(new Insets(0));
	scrollPane.setFitToWidth(true);
	scrollPane.setFitToHeight(true);
	return scrollPane;
}
 
開發者ID:CedricReichenbach,項目名稱:audiomerge,代碼行數:8,代碼來源:Page.java

示例11: createContent

import javafx.scene.control.ScrollPane; //導入方法依賴的package包/類
@Override
public Node createContent() {
    final ScrollPane scrollPane = new ScrollPane(viewContent.createContent());
    scrollPane.setFitToWidth(true);
    scrollPane.setFitToHeight(true);
    return scrollPane;
}
 
開發者ID:factoryfx,項目名稱:factoryfx,代碼行數:8,代碼來源:View.java

示例12: testTomlEditor

import javafx.scene.control.ScrollPane; //導入方法依賴的package包/類
public void testTomlEditor() {
        //inp = testsFolder + "/tomlConfigTest.toml";
        inp = testsFolder + "/tomlConfigTest.toml";

        HMDFileProcessor mdObject = new HMDFileProcessor(testsFolder + "/test.md");
        mdObject.readHMdFile();


//        TomlParser tomlParser = new TomlString(mdObject.getFrontMatter());

        String tomlString;
        try {
            tomlString = FileHandler.readFile(inp);


            TomlEditorControl tomlEditor = new TomlEditorControl(tomlString);

            Button print = new Button("print");
            print.setOnAction(new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent event) {
                    mdObject.setFrontMatter(tomlEditor.getTomlString());
                    System.out.println(mdObject.getFrontMatter());
                }
            });

            tomlEditor.getChildren().add(print);

            ScrollPane sp = new ScrollPane(tomlEditor);
            sp.setFitToHeight(true);

            pane.getChildren().add(sp);

            primaryStage.setTitle("Toml Editor");

        } catch (IOException e) {
            ExceptionAlerter.showException(e);
        }
    }
 
開發者ID:SohanChy,項目名稱:Lipi,代碼行數:40,代碼來源:RunTestsJavaFX.java

示例13: createUIList

import javafx.scene.control.ScrollPane; //導入方法依賴的package包/類
/**
 * Function to create UI element that will hold a list of songs in it based on the collection passed in.
 *
 * @param listOfSongs   The list of songs to displays.
 * @param rowCreation   The row creation action.
 * @param style         The styling to style the list.
 * @return              A scrollable UI element that contains all the songs in the collection.
 */
public static ScrollPane createUIList(Collection<Song> listOfSongs, ILabelAction rowCreation, String style) {
    ScrollPane wrapper = new ScrollPane();

    wrapper.setStyle(style);
    wrapper.setFitToHeight(true);
    wrapper.setFitToWidth(true);

    VBox allSongs = new VBox();
    allSongs.setStyle(style);
    allSongs.setSpacing(VERTICAL_SPACING);

    int songNumber = 1;
    for (Song song : listOfSongs) {
        HBox row = rowCreation.createRow(song, songNumber);
        String baseStyle = row.getStyle();

        row.setOnMouseEntered(event -> row.setStyle("-fx-background-color: lightgray"));
        row.setOnMouseExited(event -> row.setStyle(baseStyle));

        HBox.setHgrow(row, Priority.ALWAYS);
        row.setFillHeight(true);
        row.setMaxWidth(Double.MAX_VALUE);
        row.setSpacing(HORIZONTAL_ELEMENT_SPACING);
        allSongs.getChildren().add(row);

        songNumber++;
    }
    allSongs.setPrefHeight(PREF_HEIGHT);
    allSongs.setMaxHeight(MAX_HEIGHT);
    allSongs.setFillWidth(true);

    wrapper.setContent(allSongs);
    return wrapper;
}
 
開發者ID:ijh165,項目名稱:Gamma-Music-Manager,代碼行數:43,代碼來源:UserInterfaceUtils.java

示例14: setLayout

import javafx.scene.control.ScrollPane; //導入方法依賴的package包/類
private void setLayout() {
    // set layout for this pane
    final RowConstraints headerRow = new RowConstraints(USE_PREF_SIZE, USE_COMPUTED_SIZE, USE_PREF_SIZE); // HEADER FOR FULL WEEK
    final RowConstraints allDayRow = new RowConstraints(USE_PREF_SIZE, USE_COMPUTED_SIZE, USE_PREF_SIZE); // SINGLE DAY HEADER AND ALL DAY APPOINTMENTS
    final RowConstraints calendarRow = new RowConstraints(
            150, 500, Double.POSITIVE_INFINITY, Priority.ALWAYS, VPos.TOP, true); // CALENDAR
    final ColumnConstraints columnConstraints = new ColumnConstraints(
            400, 600, Double.POSITIVE_INFINITY, Priority.SOMETIMES, HPos.LEFT, true); // FULL WIDTH
    this.getRowConstraints().addAll(headerRow, allDayRow, calendarRow);
    this.getColumnConstraints().add(columnConstraints);
    this.getStyleClass().add("weekview");


    // create a container for the week header
    Pane weekHeaderContainer = new StackPane();
    weekHeaderContainer.getStyleClass().add("weekview-header-container");
    this.weekHeaderContainer = weekHeaderContainer;

    // ScrollPane that contains the DayPane and the TimeAxis
    final ScrollPane scrollPane = new ScrollPane();
    scrollPane.getStyleClass().add("weekview-scrollpane");
    scrollPane.setStyle("-fx-background-color:transparent;"); // remove gray border
    scrollPane.setFitToWidth(true);
    scrollPane.setFitToHeight(true);
    scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.ALWAYS);

    // the ScrollPane holds a GridPane with two columns: one for the TimeAxis and one for the calendar
    final GridPane scrollPaneContent = new GridPane();
    scrollPaneContent.getStyleClass().add("weekview-scrollpane-content");
    final ColumnConstraints timeColumn = new ColumnConstraints(
            USE_PREF_SIZE, USE_COMPUTED_SIZE, USE_PREF_SIZE, Priority.ALWAYS, HPos.LEFT, false); // TIME COLUMN
    final ColumnConstraints calendarColumn = new ColumnConstraints(
            USE_PREF_SIZE, USE_COMPUTED_SIZE, Double.POSITIVE_INFINITY, Priority.ALWAYS, HPos.LEFT, true); // CALENDAR COLUMN
    final RowConstraints rowConstraint = new RowConstraints(
            USE_PREF_SIZE, USE_COMPUTED_SIZE, Double.POSITIVE_INFINITY, Priority.ALWAYS, VPos.TOP, true); // FULL HEIGHT
    scrollPaneContent.getColumnConstraints().addAll(timeColumn, calendarColumn);
    scrollPaneContent.getRowConstraints().addAll(rowConstraint);
    scrollPane.setContent(scrollPaneContent);

    // create a container for the TimeAxis
    Pane timeAxisContainer = new StackPane();
    timeAxisContainer.getStyleClass().add("weekview-timeaxis-container");
    scrollPaneContent.add(timeAxisContainer, 0, 0);
    this.timeAxisContainer = timeAxisContainer;

    // set up a GridPane that holds all the DayPanes and a GridPane for the headers and full day appointments
    final GridPane dayPaneContainer = new GridPane();
    dayPaneContainer.getStyleClass().add("weekview-daypane-container");
    final GridPane dayHeaderContainer = new GridPane();
    dayHeaderContainer.getStyleClass().add("weekview-day-header-container");
    for (int i = 0; i < numberOfDays; i++) {
        final ColumnConstraints appointmentsColumn = new ColumnConstraints(
                USE_PREF_SIZE, dayPaneMinWidth, Double.POSITIVE_INFINITY, Priority.ALWAYS, HPos.CENTER, true);
        dayPaneContainer.getColumnConstraints().add(appointmentsColumn);
        dayHeaderContainer.getColumnConstraints().add(appointmentsColumn);
    }
    final RowConstraints singleDayHeaderRow = new RowConstraints(USE_PREF_SIZE, USE_COMPUTED_SIZE, USE_PREF_SIZE); // PANE FOR A DAILY HEADER
    final RowConstraints singleDayAppointmentsRow = new RowConstraints(USE_PREF_SIZE, USE_COMPUTED_SIZE, USE_PREF_SIZE); // PANE FOR ALL DAY APPOINTMENTS
    dayHeaderContainer.getRowConstraints().addAll(singleDayHeaderRow, singleDayAppointmentsRow);
    timeAxisContainer.widthProperty().addListener(observable -> {
        dayHeaderContainer.setPadding(new Insets(0, 17 /*scrollbar*/, 0, timeAxisContainer.getWidth() + 1));
    });
    final RowConstraints dayPanesRow = new RowConstraints(
            USE_PREF_SIZE, USE_COMPUTED_SIZE, Double.POSITIVE_INFINITY, Priority.ALWAYS, VPos.TOP, true); // FULL HEIGHT
    dayPaneContainer.getRowConstraints().add(dayPanesRow);
    this.dayPanesContainer = dayPaneContainer;
    this.dayHeadersContainer = dayHeaderContainer;
    scrollPaneContent.add(dayPaneContainer, 1, 0);

    // ordering is important:
    this.add(scrollPane, 0, 2);
    this.add(dayHeaderContainer, 0, 1);
    this.add(weekHeaderContainer, 0, 0);
}
 
開發者ID:Jibbow,項目名稱:FastisFX,代碼行數:75,代碼來源:WeekView.java

示例15: start

import javafx.scene.control.ScrollPane; //導入方法依賴的package包/類
@Override
public void start(Stage primaryStage)
{
	this.stage = primaryStage;
	primaryStage.setTitle(APPLICATION_NAME + " V" + VERSION + "." + REVISION);
	
	ApplicationSettings.initialize();
	ApplicationSettings.loadFromFile("settings/plp-tool.settings");
	
	EventRegistry.getGlobalRegistry().register(new ApplicationEventBusEventHandler());
	
	applicationThemeManager = new ApplicationThemeManager();
	
	this.assemblyDetails = new HashMap<>();
	this.openFileTabs = new DualHashBidiMap<>();
	this.openProjectsPanel = new TabPane();
	this.projectExplorer = createProjectTree();
	outlineView = createOutlineView();
	console = createConsole();
	console.println(">> Console Initialized.");
	
	openProjectsPanel.getSelectionModel().selectedItemProperty()
			.addListener(this::onTabActivation);
	
	ScrollPane scrollableProjectExplorer = new ScrollPane(projectExplorer);
	scrollableProjectExplorer.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
	scrollableProjectExplorer.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
	scrollableProjectExplorer.setFitToHeight(true);
	scrollableProjectExplorer.setFitToWidth(true);
	
	// Left side holds the project tree and outline view
	SplitPane leftSplitPane = new SplitPane();
	leftSplitPane.orientationProperty().set(Orientation.VERTICAL);
	leftSplitPane.getItems().addAll(scrollableProjectExplorer, outlineView);
	leftSplitPane.setDividerPositions(0.5, 1.0);
	leftSplitPane.setMinSize(0, 0);
	
	// Right side holds the source editor and the output console
	SplitPane rightSplitPane = new SplitPane();
	rightSplitPane.orientationProperty().set(Orientation.VERTICAL);
	rightSplitPane.getItems().addAll(Components.wrap(openProjectsPanel),
			Components.wrap(console));
	rightSplitPane.setDividerPositions(0.75, 1.0);
	rightSplitPane.setMinSize(0, 0);
	
	// Container for the whole view (everything under the toolbar)
	SplitPane explorerEditorSplitPane = new SplitPane();
	explorerEditorSplitPane.getItems().addAll(Components.wrap(leftSplitPane),
			Components.wrap(rightSplitPane));
	explorerEditorSplitPane.setDividerPositions(0.225, 1.0);
	explorerEditorSplitPane.setMinSize(0, 0);
	
	SplitPane.setResizableWithParent(leftSplitPane, Boolean.FALSE);
	
	//loadOpenProjects();
	
	Parent menuBar = createMenuBar();
	Parent toolbar = createToolbar();
	BorderPane mainPanel = new BorderPane();
	VBox topContainer = new VBox();
	topContainer.getChildren().add(menuBar);
	topContainer.getChildren().add(toolbar);
	mainPanel.setTop(topContainer);
	mainPanel.setCenter(explorerEditorSplitPane);
	
	int width = DEFAULT_WINDOW_WIDTH;
	int height = DEFAULT_WINDOW_HEIGHT;
	
	Scene scene = new Scene(Components.wrap(mainPanel), width, height);
	
	primaryStage.setScene(scene);
	
	String themeName = ApplicationSettings.getSetting(
			ApplicationSetting.APPLICATION_THEME).get();
	EventRegistry.getGlobalRegistry().post(new ThemeRequestEvent(themeName));
	
	primaryStage.show();
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:79,代碼來源:Main.java


注:本文中的javafx.scene.control.ScrollPane.setFitToHeight方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。