本文整理汇总了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;
}
}
}
}