当前位置: 首页>>代码示例>>Java>>正文


Java SplitPane.setDividerPositions方法代码示例

本文整理汇总了Java中javafx.scene.control.SplitPane.setDividerPositions方法的典型用法代码示例。如果您正苦于以下问题:Java SplitPane.setDividerPositions方法的具体用法?Java SplitPane.setDividerPositions怎么用?Java SplitPane.setDividerPositions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.control.SplitPane的用法示例。


在下文中一共展示了SplitPane.setDividerPositions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import javafx.scene.control.SplitPane; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
   
    TabPane tabPane = new TabPane();
    Tab tab1 = new Tab();
    tab1.setText("Demos");
    tab1.setClosable(false);
    
    SplitPane sp = new SplitPane();
    final StackPane sp1 = new StackPane();
    sp1.getChildren().add(createTreeView());
    final BorderPane sp2 = new BorderPane();
    sp2.setCenter(createChartPane());
 
    sp.getItems().addAll(sp1, sp2);
    sp.setDividerPositions(0.3f, 0.6f);
    tab1.setContent(sp);
    tabPane.getTabs().add(tab1);        
 
    Tab tab2 = new Tab();
    tab2.setText("About");
    tab2.setClosable(false);
    
    WebView browser = new WebView();
    WebEngine webEngine = browser.getEngine();
    webEngine.load(getClass().getResource("/com/orsoncharts/fx/demo/about.html").toString());
    tab2.setContent(browser);
    tabPane.getTabs().add(tab2);        

    Scene scene = new Scene(tabPane, 1024, 768);
    stage.setScene(scene);
    stage.setTitle("Orson Charts JavaFX Demo");
    stage.show();
}
 
开发者ID:jfree,项目名称:jfree-fxdemos,代码行数:35,代码来源:OrsonChartsFXDemo.java

示例2: PMDCheckComposite

import javafx.scene.control.SplitPane; //导入方法依赖的package包/类
public PMDCheckComposite(File sourceFile) {
	this.sourceFile = sourceFile;

	javaTextArea = new JavaTextArea();
	xmlEditor = new XMLEditor();
	SplitPane splitPane = new SplitPane(javaTextArea, xmlEditor);
	splitPane.setOrientation(Orientation.VERTICAL);
	splitPane.setDividerPositions(0.7d, 0.3d);

	setCenter(splitPane);
	violationLabel = new Label();
	setBottom(violationLabel);

	if (this.sourceFile.isDirectory()) {
		dirFilePmd(this.sourceFile);
	} else {
		simpleFilePmd(this.sourceFile);
	}

}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:21,代码来源:PMDCheckComposite.java

示例3: 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

示例4: create

import javafx.scene.control.SplitPane; //导入方法依赖的package包/类
private void create() {
  myEditorController = new EditorController();
  HierarchyTreeViewController componentTree = new HierarchyTreeViewController(myEditorController);
  ContentPanelController canvas = new ContentPanelController(myEditorController);
  InspectorPanelController propertyTable = new InspectorPanelController(myEditorController);
  LibraryPanelController palette = new LibraryPanelController(myEditorController);

  loadFile();
  startChangeListener();

  SplitPane leftPane = new SplitPane();
  leftPane.setOrientation(Orientation.VERTICAL);
  leftPane.getItems().addAll(palette.getPanelRoot(), componentTree.getPanelRoot());
  leftPane.setDividerPositions(0.5, 0.5);

  SplitPane.setResizableWithParent(leftPane, Boolean.FALSE);
  SplitPane.setResizableWithParent(propertyTable.getPanelRoot(), Boolean.FALSE);

  SplitPane mainPane = new SplitPane();

  mainPane.getItems().addAll(leftPane, canvas.getPanelRoot(), propertyTable.getPanelRoot());
  mainPane.setDividerPositions(0.11036789297658862, 0.8963210702341137);

  myPanel.setScene(new Scene(mainPane, -1, -1, true, SceneAntialiasing.BALANCED));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:SceneBuilderImpl.java

示例5: start

import javafx.scene.control.SplitPane; //导入方法依赖的package包/类
@Override
public void start(final Stage stage)
{
    final SplitPane split = new SplitPane();

    Label label = new Label("Left");
    label.setMaxWidth(Double.MAX_VALUE);
    label.setStyle(DEBUG_STYLE);
    final StackPane left = new StackPane(label);

    label = new Label("Some long text in the right panel");
    label.setStyle(DEBUG_STYLE);
    label.setMaxWidth(Double.MAX_VALUE);
    label.setPrefWidth(Double.MAX_VALUE);
    final ScrollPane scroll = new ScrollPane(label);
    scroll.setHbarPolicy(ScrollBarPolicy.NEVER);
    scroll.setVbarPolicy(ScrollBarPolicy.ALWAYS);
    final StackPane right = new StackPane(scroll);

    split.getItems().addAll(left, right);
    split.setDividerPositions(0.5);

    final Scene scene = new Scene(split, 800, 700);
    stage.setScene(scene);
    stage.show();
}
 
开发者ID:kasemir,项目名称:org.csstudio.display.builder,代码行数:27,代码来源:SplitPaneDemo.java

示例6: start

import javafx.scene.control.SplitPane; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) {
    input = new TextArea();
    output = new BorderPane();
    
    SplitPane root = new SplitPane();
    root.setDividerPositions(0.5);
    root.getItems().add(input);
    root.getItems().add(output);
    
    input.textProperty().addListener(new ChangeListener() {
        @Override
        public void changed(ObservableValue observable, Object oldValue, Object newValue) {                           changed = true;
        }           
    });
    
    Scene scene = new Scene(root, 700, 550);
    
    primaryStage.setScene(scene);
    primaryStage.show();
    
    new Thread(this).start();
}
 
开发者ID:automenta,项目名称:netentionj-desktop,代码行数:24,代码来源:NLPAnalyzer.java

示例7: marathon_select

import javafx.scene.control.SplitPane; //导入方法依赖的package包/类
@Override public boolean marathon_select(String value) {
    SplitPane splitPane = (SplitPane) getComponent();
    JSONArray locations = new JSONArray(value);
    double[] dividerLocations = new double[locations.length()];
    for (int i = 0; i < locations.length(); i++) {
        dividerLocations[i] = locations.getDouble(i);
    }
    splitPane.setDividerPositions(dividerLocations);
    return true;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:11,代码来源:JavaFXSplitPaneElement.java

示例8: SplitPaneSample

import javafx.scene.control.SplitPane; //导入方法依赖的package包/类
public SplitPaneSample() {
    SplitPane sp = new SplitPane();
    sp.setPrefSize(250, 250);

    StackPane sp1 = new StackPane();
    sp1.getChildren().add(new Button("Button One"));
    final StackPane sp2 = new StackPane();
    sp2.getChildren().add(new Button("Button Two"));
    final StackPane sp3 = new StackPane();
    sp3.getChildren().add(new Button("Button Three"));
    sp.getItems().addAll(sp1, sp2, sp3);
    sp.setDividerPositions(0.3f, 0.6f, 0.9f);
    getChildren().add(sp);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:15,代码来源:SplitPaneSample.java

示例9: buildSplitPane

import javafx.scene.control.SplitPane; //导入方法依赖的package包/类
private SplitPane buildSplitPane() {
    SplitPane sp = new SplitPane();
    sp.getItems().add(tree);
    sp.getItems().add(hexPane);
    sp.setDividerPositions(0.3, 0.7);
    return sp;
}
 
开发者ID:Glavo,项目名称:ClassViewer,代码行数:8,代码来源:ParsedViewerPane.java

示例10: OptionsPane

import javafx.scene.control.SplitPane; //导入方法依赖的package包/类
/**
 * Creation of the OptionsPane. Pass in a map that fully maps all titles to their respective panes.
 * <p>
 * CAUTION: Map should can't be null. However, the map can be empty.
 *
 * @param optionsMenuModel
 * 		Map from tree names to panes
 */
public OptionsPane( Map<OptionSection, Pane> optionsMenuModel )
{
	//TODO use some kind of selection model to default to select first item or last item selected
	optionScreenMap = optionsMenuModel;
	sections = new OptionsSettingsTree(optionsMenuModel.keySet());
	sections.setTreeDoubleClick(this::onTreeDoubleClick);

	sectionView = new SwapPane();

	SplitPane sectionContentSplitPane = new SplitPane();
	sectionContentSplitPane.setOrientation(Orientation.HORIZONTAL);
	sectionContentSplitPane.getItems().addAll(sections, sectionView);

	sectionContentSplitPane.setDividerPositions(0.2, 1);
	setCenter(sectionContentSplitPane);

	okAction = () -> {
	};
	cancelAction = () -> {
	};

	Button okButton = new Button();
	okButton.setText("OK");
	okButton.setOnMouseClicked(this::okButtonClicked);

	Button cancelButton = new Button();
	cancelButton.setText("Cancel");
	cancelButton.setOnMouseClicked(this::cancelButtonClicked);

	HBox buttonBar = new HBox();
	buttonBar.getChildren().addAll(okButton, cancelButton);
	buttonBar.setAlignment(Pos.BASELINE_RIGHT);

	setBottom(buttonBar);
}
 
开发者ID:dhawal9035,项目名称:WebPLP,代码行数:44,代码来源:OptionsPane.java

示例11: SimpleSQLResultView

import javafx.scene.control.SplitPane; //导入方法依赖的package包/类
public SimpleSQLResultView(String sql, Map<String, Object> param) {
	this.sql = sql;

	sqlKeywords = new SqlKeywords();
	mappingedSqlKeywords = new SqlKeywords();

	tbResult = new TableView<Map<String, Object>>();
	tbBind = new TableView<KeyValue>();
	this.param = new HashMap<>(param);

	keyColumn = new TableColumn<>("Key");
	valueColumn = new TableColumn<>("Value");
	tbBind.getColumns().add(keyColumn);
	tbBind.getColumns().add(valueColumn);

	keyColumn.setCellValueFactory(new PropertyValueFactory<KeyValue, Object>("key"));
	valueColumn.setCellValueFactory(new PropertyValueFactory<KeyValue, Object>("value"));

	splitPane = new SplitPane(sqlKeywords, mappingedSqlKeywords, tbBind);
	tbBind.setMinWidth(80);
	tbBind.setMaxWidth(180);
	splitPane.setDividerPositions(0.5);

	splitPane.setOrientation(Orientation.HORIZONTAL);
	this.setCenter(splitPane);
	// this.setRight(tbBind);
	this.setBottom(tbResult);

}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:30,代码来源:SimpleSQLResultView.java

示例12: DesignerFx

import javafx.scene.control.SplitPane; //导入方法依赖的package包/类
public DesignerFx(String[] args) {

		xpathQueryArea.setFont(FONT);

		SplitPane controlSplitPane = new SplitPane(createCodeEditorPanel(), createXPathQueryPanel());
		controlSplitPane.setOrientation(Orientation.HORIZONTAL);
		SplitPane astAndSymbolTablePane = new SplitPane(createASTPanel(), createSymbolTableResultPanel());
		astAndSymbolTablePane.setOrientation(Orientation.VERTICAL);
		astAndSymbolTablePane.setDividerPositions(1, 1);

		SplitPane resultsSplitPane = new SplitPane(astAndSymbolTablePane, createXPathResultPanel());
		resultsSplitPane.setOrientation(Orientation.HORIZONTAL);
		TabPane tabbed = new TabPane();

		dfaPanel = new DFAPanelFx();
		//		dfaPanelFx = new SwingNode();
		//		createSwingContent(dfaPanelFx, dfaPanel);

		tabbed.getTabs().add(new Tab("Abstract Syntax Tree / XPath / Symbol Table", resultsSplitPane));
		tabbed.getTabs().add(new Tab("Data Flow Analysis", dfaPanel));

		containerSplitPane = new SplitPane(controlSplitPane, tabbed);
		containerSplitPane.setOrientation(Orientation.VERTICAL);
		createFxMenuBar = createFxMenuBar();

		//		controlSplitPane.setDividerPosition(0, 0.5);
		//		containerSplitPane.setDividerPosition(0, 0.5);
		//		astAndSymbolTablePane.setDividerPosition(0, 0.5);
		//		astAndSymbolTablePane.setDividerPositions(0, 0.5);
		//		resultsSplitPane.setDividerPositions(0, 0.5);

		loadSettings();
	}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:34,代码来源:DesignerFx.java

示例13: createContent

import javafx.scene.control.SplitPane; //导入方法依赖的package包/类
@Override
    public Node createContent() {
//        MasterDetailPane pane = new MasterDetailPane();
        dataEditor.reset();
        SplitPane splitPane = new SplitPane();
        splitPane.setOrientation(orientation);

        tableView.setItems(dataView.dataList());
        tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
        TableColumn<T, String> test = new TableColumn<>("Data");
        test.setCellValueFactory(param -> param.getValue().internal().getDisplayTextObservable());
        tableView.getColumns().add(test);
        tableView.getStyleClass().add("hidden-tableview-headers");

        BorderPane borderPaneWrapper = new BorderPane();
        borderPaneWrapper.setCenter(tableView);
        SplitPane.setResizableWithParent(borderPaneWrapper, Boolean.FALSE);
        splitPane.getItems().add(borderPaneWrapper);

        Node dataEditorWidget = this.dataEditor.createContent();
        SplitPane.setResizableWithParent(dataEditorWidget, Boolean.TRUE);
        splitPane.getItems().add(dataEditorWidget);
        splitPane.setDividerPositions(dividerPosition);

        tableView.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
            dataEditor.edit(newValue);
            dataEditor.resetHistory();
        });


        TableControlWidget tableControlWidget= new TableControlWidget<>(tableView, uniformDesign);
        borderPaneWrapper.setBottom(tableControlWidget.createContent());




        return splitPane;
    }
 
开发者ID:factoryfx,项目名称:factoryfx,代码行数:39,代码来源:DataViewWidget.java

示例14: createContent

import javafx.scene.control.SplitPane; //导入方法依赖的package包/类
@Override
    public Node createContent() {
//        MasterDetailPane pane = new MasterDetailPane();
        SplitPane splitPane = new SplitPane();
        splitPane.setOrientation(Orientation.VERTICAL);

        TableView<T> tableView = new TableView<>();
        tableView.setItems(tableDataView.dataList());
        tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
        for (TableDataColumnSpec<T> col : columns) {
            tableView.getColumns().add(col.create());
        }

        BorderPane borderPaneWrapper = new BorderPane();
        borderPaneWrapper.setCenter(tableView);
        splitPane.getItems().add(borderPaneWrapper);

        Node dataEditorWidget = this.dataEditor.createContent();
        SplitPane.setResizableWithParent(dataEditorWidget, Boolean.FALSE);
        splitPane.getItems().add(dataEditorWidget);
        splitPane.setDividerPositions(dividerPosition);

        tableView.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
            dataEditor.edit(newValue);
            dataEditor.resetHistory();
        });


        TableControlWidget tableControlWidget= new TableControlWidget<>(tableView, uniformDesign);
        borderPaneWrapper.setBottom(tableControlWidget.createContent());


        return splitPane;
    }
 
开发者ID:factoryfx,项目名称:factoryfx,代码行数:35,代码来源:TableDataViewWidget.java

示例15: 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);
}
 
开发者ID:qupath,项目名称:qupath,代码行数:14,代码来源:QuPathGUI.java


注:本文中的javafx.scene.control.SplitPane.setDividerPositions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。