本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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
}
}
}
示例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;
}
示例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;
}
示例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();
}
示例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);
}
示例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);
}
}
示例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");
}
示例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);
}
示例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");
}
示例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);
}
}
示例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);
}
}
示例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);
}