当前位置: 首页>>代码示例>>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;未经允许,请勿转载。