本文整理匯總了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;
}
示例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;
}
}
}
}