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


Java SplitPane.getOrientation方法代碼示例

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


在下文中一共展示了SplitPane.getOrientation方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: addComponent

import javafx.scene.control.SplitPane; //導入方法依賴的package包/類
protected void addComponent(Parent parent, Node component) {
    if (parent.getParent() instanceof SplitPane) {
        SplitPane splitPane = (SplitPane) parent.getParent();

        int index = splitPane.getItems().indexOf(draggableTabLayoutExtender);

        Orientation insertOrientation = direction == Direction.UP || direction == Direction.DOWN ? Orientation.VERTICAL : Orientation.HORIZONTAL;

        if (splitPane.getOrientation() != insertOrientation) {

            Node center = draggableTabLayoutExtender.getCenter();

            if (center instanceof SplitPane) {
                SplitPane pane = (SplitPane) center;

                if (pane.getOrientation() == insertOrientation) {
                    splitPane = pane;

                    if (direction == Direction.UP || direction == Direction.LEFT) {
                        index = 0;
                    } else {
                        index = pane.getItems().size();
                    }
                }
            }
        }

        if (splitPane.getOrientation() == Orientation.VERTICAL) {
            switch (direction) {
                case UP:
                    insertInto(splitPane, index, component);
                    break;
                case DOWN:
                    insertInto(splitPane, index + 1, component);
                    break;
                case LEFT:
                    splitInto(splitPane, index, component, draggableTabLayoutExtender);
                    break;
                case RIGHT:
                    splitInto(splitPane, index, draggableTabLayoutExtender, component);
                    break;
            }
        }

        if (splitPane.getOrientation() == Orientation.HORIZONTAL) {
            switch (direction) {
                case UP:
                    splitInto(splitPane, index, component, draggableTabLayoutExtender);
                    break;
                case DOWN:
                    splitInto(splitPane, index, draggableTabLayoutExtender, component);
                    break;
                case LEFT:
                    insertInto(splitPane, index, component);
                    break;
                case RIGHT:
                    insertInto(splitPane, index + 1, component);
                    break;
            }
        }
    }
}
 
開發者ID:xylo,項目名稱:DraggableTabs,代碼行數:63,代碼來源:DraggableTabInsertPane.java


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