當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。