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


Java SplitPane.setDividerPosition方法代碼示例

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


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

示例1: drawNode

import javafx.scene.control.SplitPane; //導入方法依賴的package包/類
@Override
public Node drawNode() {
    SplitPane node = (SplitPane) createObject();
    node.setDividerPositions(position);

    SplitPane split_pane = new SplitPane();
    for (int i = 0; i < SPLITS_NUM; i++) {
        VBox box = new VBox();
        box.setId(SPLIT_PANE_CONTENT);
        Label label = new Label("Split's " + i + " content");
        label.setMinSize(0, 0);
        box.getChildren().add(label);
        split_pane.getItems().add(box);
    }
    for (int i = 0; i < SPLITS_NUM - 1; i++) {
        split_pane.setDividerPosition(i, 1.0 * (i + 1) / SPLITS_NUM);
    }

    node.setOrientation(orientation);
    if (node.getOrientation() != orientation) {
        reportGetterFailure("getOrientation()");
    }
    return node;
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:25,代碼來源:SplitPaneApp.java

示例2: createObject

import javafx.scene.control.SplitPane; //導入方法依賴的package包/類
protected Object createObject(double width, double height, Double tab_width, Double tab_height) {
    SplitPane split_pane = new SplitPane();
    for (int i = 0; i < SPLITS_NUM; i++) {
        VBox box = new VBox();
        box.setId(SPLIT_PANE_CONTENT);
        Label label = new Label("Split's " + i + " content");
        label.setMinSize(0, 0);
        box.getChildren().add(label);
        split_pane.getItems().add(box);
    }
    for (int i = 0; i < SPLITS_NUM - 1; i++) {
        split_pane.setDividerPosition(i, 1.0 * (i + 1) / SPLITS_NUM);
    }

    split_pane.setMaxSize(width, height);
    split_pane.setPrefSize(width, height);
    split_pane.setMinSize(0, 0);
    split_pane.setStyle("-fx-border-color: darkgray;");
    return split_pane;
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:21,代碼來源:SplitPaneApp.java

示例3: layoutContent

import javafx.scene.control.SplitPane; //導入方法依賴的package包/類
private Node layoutContent() {					
	final VBox optionCardLayout = new VBox(5);
	optionCardLayout.getChildren().addAll(categoryNameLabel, optionsView);
	optionCardLayout.setPadding(new Insets(0, 5, 0, 15));
	
	final SplitPane mainLayout = new SplitPane();        
	mainLayout.setOrientation(Orientation.HORIZONTAL);
	mainLayout.setDividerPosition(0, 0.20);
	mainLayout.getItems().addAll(optionCategoriesTreeView, optionCardLayout);
	
	mainLayout.setPrefSize(770, 500);
	categoryNameLabel.prefWidthProperty().bind(mainLayout.widthProperty());
       
       SplitPane.setResizableWithParent(optionCategoriesTreeView, Boolean.FALSE);
	return mainLayout;
}
 
開發者ID:veroslav,項目名稱:jfx-torrent,代碼行數:17,代碼來源:PreferencesWindow.java

示例4: loadDividerPositions

import javafx.scene.control.SplitPane; //導入方法依賴的package包/類
private void loadDividerPositions(String name, SplitPane pane) {
    Preferences p0 = Preferences.userNodeForPackage(getClass());
    Preferences p1 = p0.node(name);
    double[] positions = pane.getDividerPositions();
    for (int i = 0; i < positions.length; i++) {
        try {
            double v = p1.getDouble(i + "", positions[i]);
            pane.setDividerPosition(i, v);
        }
        catch (Exception e) {
            // TODO log it
        }
    }
}
 
開發者ID:mbari-media-management,項目名稱:vars-annotation,代碼行數:15,代碼來源:ControlsPaneController.java

示例5: createLeftPanelSplitPane

import javafx.scene.control.SplitPane; //導入方法依賴的package包/類
/**
 * Create the left panel SplitPane, it contains the upper and lower
 * parts for different TabPane Groups
 * @return left panel SplitPane
 */
public SplitPane createLeftPanelSplitPane() {
    SplitPane sp = new SplitPane();
    sp.setOrientation(Orientation.VERTICAL);
    sp.setDividerPosition(0, 0.6f);
    return sp;
}
 
開發者ID:ztan5,項目名稱:TechnicalAnalysisTool,代碼行數:12,代碼來源:TatMain.java

示例6: createContent

import javafx.scene.control.SplitPane; //導入方法依賴的package包/類
@Override
public Node createContent() {
    SplitPane splitPane = new SplitPane();
    splitPane.getItems().addAll(dataEditor.createContent(),createTree());
    splitPane.setDividerPosition(0,0.75);
    return splitPane;
}
 
開發者ID:factoryfx,項目名稱:factoryfx,代碼行數:8,代碼來源:DataTreeWidget.java

示例7: initialize

import javafx.scene.control.SplitPane; //導入方法依賴的package包/類
private void initialize() {
	BorderPane panelMainEditor = new BorderPane();
	editor = getNewEditor();
	editor.textProperty().addListener((v, o, n) -> {
		updateUndoActionState();
		updateIsModified();
	});
	editor.selectedTextProperty().addListener((v, o, n) -> updateCutCopyActionState());
	editor.focusedProperty().addListener((v, o, n) -> maybeRefreshTab(this));
	
	panelMainEditor.setCenter(editor.getControl());


	console = getNewConsole();
	ContextMenu popup = new ContextMenu();
	popup.getItems().add(ActionUtils.createMenuItem(new Action("Clear console", e -> console.setText(""))));
	console.getControl().setContextMenu(popup);
	
	splitEditor = new SplitPane();
	splitEditor.setOrientation(Orientation.VERTICAL);
	splitEditor.getItems().addAll(
			panelMainEditor,
			console.getControl());
	SplitPane.setResizableWithParent(console.getControl(), Boolean.FALSE);
	splitEditor.setDividerPosition(0, 0.75);
	
	updateIsModified();
}
 
開發者ID:qupath,項目名稱:qupath,代碼行數:29,代碼來源:DefaultScriptEditor.java

示例8: resetDividers

import javafx.scene.control.SplitPane; //導入方法依賴的package包/類
void resetDividers(final SplitPane splitPane) {
	int n = splitPane.getItems().size();
	if (n <= 1)
		return;
	if (n == 2) {
		splitPane.setDividerPosition(0, 0.5);
		return;
	}
	double[] positions = new double[n-1];
	for (int i = 0; i < positions.length; i++)
		positions[i] = (i + 1.0) / (double)n;
	splitPane.setDividerPositions(positions);
}
 
開發者ID:qupath,項目名稱:qupath,代碼行數:14,代碼來源:QuPathGUI.java

示例9: handlePerspective

import javafx.scene.control.SplitPane; //導入方法依賴的package包/類
@Override
public void handlePerspective(final IAction<Event, Object> action,
		final PerspectiveLayout perspectiveLayout) {
	if (action.getLastMessage().equals(MessageUtil.INIT)) {
		final SplitPane mainLayout = SplitPaneBuilder.create()
				.styleClass("vsplitpane").orientation(Orientation.VERTICAL)
				.prefHeight(600).prefWidth(800).build();

		mainLayout.setDividerPosition(0, 0.50f);

		// create left button menu
		final GridPane top = GridPaneBuilder.create()
				.alignment(Pos.TOP_CENTER).build();
		GridPane.setHgrow(top, Priority.ALWAYS);
		GridPane.setVgrow(top, Priority.ALWAYS);

		// create main content Top
		final GridPane bottom = GridPaneBuilder.create()
				.alignment(Pos.BOTTOM_CENTER).build();
		GridPane.setHgrow(bottom, Priority.ALWAYS);
		GridPane.setVgrow(bottom, Priority.ALWAYS);

		GridPane.setVgrow(mainLayout, Priority.ALWAYS);
		GridPane.setHgrow(mainLayout, Priority.ALWAYS);

		mainLayout.getItems().addAll(top, bottom);
		// Register root component
		perspectiveLayout.registerRootComponent(mainLayout);
		// register left menu
		perspectiveLayout.registerTargetLayoutComponent("PTop", top);
		// register main content
		perspectiveLayout.registerTargetLayoutComponent("PBottom", bottom);
	}

}
 
開發者ID:JacpFX,項目名稱:JacpFX-misc,代碼行數:36,代碼來源:PerspectiveTwo.java

示例10: onStartPerspective

import javafx.scene.control.SplitPane; //導入方法依賴的package包/類
@PostConstruct
/**
 * @OnStart annotated method will be executed when component is activated.
 * @param layout
 * @param resourceBundle
 */
public void onStartPerspective(final PerspectiveLayout perspectiveLayout, final FXComponentLayout layout,
                               final ResourceBundle resourceBundle) {
    // define toolbars and menu entries
    JACPToolBar toolbar = layout.getRegisteredToolBar(ToolbarPosition.NORTH);
    Button pressMe = new Button(resourceBundle.getString("p2.button"));
    pressMe.setOnAction((event) -> context.send(BasicConfig.PERSPECTIVE_TWO, "show"));
    toolbar.addAllOnEnd(pressMe);
    toolbar.add(new Label(resourceBundle.getString("p1.button")));


    mainLayout = new SplitPane();
    mainLayout.setOrientation(Orientation.HORIZONTAL);
    mainLayout.setDividerPosition(0, 0.3f);

    // create left button menu
    GridPane leftMenu = new GridPane();
    // create main content Top
    GridPane mainContent = new GridPane();

    // let them grow
    GridPaneUtil.setFullGrow(ALWAYS, mainLayout);

    mainLayout.getItems().addAll(leftMenu, mainContent);
    // Register root component
    perspectiveLayout.registerRootComponent(mainLayout);
    // register left menu
    perspectiveLayout.registerTargetLayoutComponent(BasicConfig.TARGET_CONTAINER_LEFT, leftMenu);
    // register main content
    perspectiveLayout.registerTargetLayoutComponent(BasicConfig.TARGET_CONTAINER_MAIN, mainContent);
    log.info("on PostConstruct of PerspectiveOne");
}
 
開發者ID:JacpFX,項目名稱:JacpFX-misc,代碼行數:38,代碼來源:PerspectiveOne.java

示例11: onStartPerspective

import javafx.scene.control.SplitPane; //導入方法依賴的package包/類
/**
 * @param layout
 * @param resourceBundle
 * @OnStart annotated method will be executed when component is activated.
 */
@PostConstruct
public void onStartPerspective(final PerspectiveLayout perspectiveLayout, final FXComponentLayout layout,
                               final ResourceBundle resourceBundle) {


    SplitPane mainLayout = new SplitPane();
    LayoutUtil.GridPaneUtil.setFullGrow(ALWAYS, mainLayout);
    mainLayout.setOrientation(Orientation.VERTICAL);
    mainLayout.setDividerPosition(0, 0.5f);


    HBox contentTop = new HBox();

    HBox contentBottom = new HBox();

    mainLayout.getItems().addAll(contentTop, contentBottom);

    // Register root component
    perspectiveLayout.registerRootComponent(mainLayout);
    // register left menu
    perspectiveLayout.registerTargetLayoutComponent(BaseConfiguration.TARGET_CONTAINER_TOP, contentTop);
    // register main content
    perspectiveLayout.registerTargetLayoutComponent(BaseConfiguration.TARGET_CONTAINER_MAIN, contentBottom);

    createToolbar(layout);
}
 
開發者ID:JacpFX,項目名稱:JacpFX-misc,代碼行數:32,代碼來源:PerspectiveOne.java

示例12: onStartPerspective

import javafx.scene.control.SplitPane; //導入方法依賴的package包/類
@PostConstruct
/**
 * @PostConstruct annotated method will be executed when component is activated.
 * @param layout
 * @param resourceBundle
 */
public void onStartPerspective(final PerspectiveLayout perspectiveLayout, final FXComponentLayout layout,
                               final ResourceBundle resourceBundle) {
    // define toolbars and menu entries
    JACPToolBar toolbar = layout.getRegisteredToolBar(ToolbarPosition.NORTH);
    Button pressMe = new Button(resourceBundle.getString("p2.button"));
    pressMe.setOnAction((event) -> context.send(BasicConfig.PERSPECTIVE_TWO, "show"));
    toolbar.addAllOnEnd(pressMe);
    toolbar.add(new Label(resourceBundle.getString("p1.button")));


    mainLayout = new SplitPane();
    mainLayout.setOrientation(Orientation.HORIZONTAL);
    mainLayout.setDividerPosition(0, 0.3f);
    // let them grow
    LayoutUtil.GridPaneUtil.setFullGrow(ALWAYS, mainLayout);
    // create left button menu
    GridPane leftMenu = new GridPane();
    // create main content Top
    GridPane mainContent = new GridPane();

    mainLayout.getItems().addAll(leftMenu, mainContent);
    // Register root component
    perspectiveLayout.registerRootComponent(mainLayout);
    // register left menu
    perspectiveLayout.registerTargetLayoutComponent(BasicConfig.TARGET_CONTAINER_LEFT, leftMenu);
    // register main content
    perspectiveLayout.registerTargetLayoutComponent(BasicConfig.TARGET_CONTAINER_MAIN, mainContent);
    log.info("on PostConstruct of PerspectiveOne");
}
 
開發者ID:JacpFX,項目名稱:JacpFX-misc,代碼行數:36,代碼來源:PerspectiveOne.java

示例13: handlePerspective

import javafx.scene.control.SplitPane; //導入方法依賴的package包/類
@Override
public void handlePerspective(final Message<Event, Object> action,
                              final PerspectiveLayout perspectiveLayout) {
    if (action.messageBodyEquals(FXUtil.MessageUtil.INIT)) {
        SplitPane mainLayout = new SplitPane();
        mainLayout.setOrientation(Orientation.HORIZONTAL);
        mainLayout.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
        mainLayout.setDividerPosition(0, 0.55f);

        // create left button menu
        GridPane leftMenu = new GridPane();
        // create main content Top
        GridPane mainContent = new GridPane();

        // let them grow
        GridPaneUtil.setFullGrow(ALWAYS, leftMenu);
        GridPaneUtil.setFullGrow(ALWAYS, mainContent);
        GridPaneUtil.setFullGrow(ALWAYS, mainLayout);

        mainLayout.getItems().addAll(leftMenu, mainContent);
        // Register root component
        perspectiveLayout.registerRootComponent(mainLayout);
        // register left menu
        perspectiveLayout.registerTargetLayoutComponent(PerspectiveIds.TARGET_CONTAINER_LEFT, leftMenu);
        // register main content
        perspectiveLayout.registerTargetLayoutComponent(PerspectiveIds.TARGET_CONTAINER_MAIN, mainContent);
    }

}
 
開發者ID:JacpFX,項目名稱:JacpFX-misc,代碼行數:30,代碼來源:PerspectiveFour.java

示例14: handlePerspective

import javafx.scene.control.SplitPane; //導入方法依賴的package包/類
@Override
public void handlePerspective(final Message<Event, Object> action,
                              final PerspectiveLayout perspectiveLayout) {
    if (action.messageBodyEquals(FXUtil.MessageUtil.INIT)) {
        SplitPane mainLayout = new SplitPane();
        mainLayout.setOrientation(Orientation.HORIZONTAL);
        mainLayout.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
        mainLayout.setDividerPosition(0, 0.55f);

        // create left button menu
        GridPane leftMenu = new GridPane();
        // create main content Top
        GridPane mainContent = new GridPane();

        // let them grow
        GridPaneUtil.setFullGrow(ALWAYS, leftMenu);
        GridPaneUtil.setFullGrow(ALWAYS, mainContent);
        GridPaneUtil.setFullGrow(ALWAYS, mainLayout);

        mainLayout.getItems().addAll(leftMenu, mainContent);
        // Register root component
        perspectiveLayout.registerRootComponent(mainLayout);
        // register left menu
        perspectiveLayout.registerTargetLayoutComponent(PerspectiveIds.TARGET_CONTAINER_LEFT , leftMenu);
        // register main content
        perspectiveLayout.registerTargetLayoutComponent(PerspectiveIds.TARGET_CONTAINER_MAIN, mainContent);
    }

}
 
開發者ID:JacpFX,項目名稱:JacpFX-misc,代碼行數:30,代碼來源:PerspectiveThree.java

示例15: init

import javafx.scene.control.SplitPane; //導入方法依賴的package包/類
private void init() {
	// content

	ContentPane content = new ContentPane(gui, this, false);
	components.add(content);
	getItems().add(content);

	// lists

	SplitPane verticalPane = new SplitPane();
	getItems().add(verticalPane);

	// class list

	classList.setCellFactory(new MatchableListCellFactory<ClassInstance>());
	classList.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
		if (oldValue == newValue) return;

		onClassSelect(newValue != null ? newValue.getSubject() : null);
	});

	verticalPane.getItems().add(classList);

	// member list

	memberList.setCellFactory(new MatchableListCellFactory<MemberInstance<?>>());
	memberList.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
		if (oldValue == newValue) return;

		boolean wasMethod = oldValue != null && oldValue.getSubject() instanceof MethodInstance;
		boolean wasField = oldValue != null && oldValue.getSubject() instanceof FieldInstance;
		boolean isMethod = newValue != null && newValue.getSubject() instanceof MethodInstance;
		boolean isField = newValue != null && newValue.getSubject() instanceof FieldInstance;

		if (wasMethod && isField
				|| wasField && isMethod) {
			if (wasMethod) {
				onMethodSelect(null);
			} else {
				onFieldSelect(null);
			}
		}

		if (isMethod || newValue == null && wasMethod) {
			onMethodSelect(isMethod ? (MethodInstance) newValue.getSubject() : null);
		} else {
			onFieldSelect(isField ? (FieldInstance) newValue.getSubject() : null);
		}
	});

	verticalPane.getItems().add(memberList);

	// positioning

	verticalPane.setOrientation(Orientation.VERTICAL);
	verticalPane.setDividerPosition(0, 0.65);

	SplitPane.setResizableWithParent(verticalPane, false);
	setDividerPosition(0, 1 - 0.25);

	srcPane.addListener(srcListener);
}
 
開發者ID:sfPlayer1,項目名稱:Matcher,代碼行數:63,代碼來源:MatchPaneDst.java


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