當前位置: 首頁>>代碼示例>>Java>>正文


Java SplitPane類代碼示例

本文整理匯總了Java中javafx.scene.control.SplitPane的典型用法代碼示例。如果您正苦於以下問題:Java SplitPane類的具體用法?Java SplitPane怎麽用?Java SplitPane使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SplitPane類屬於javafx.scene.control包,在下文中一共展示了SplitPane類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getText

import javafx.scene.control.SplitPane; //導入依賴的package包/類
@Test public void getText() {
    SplitPane splitPane = (SplitPane) getPrimaryStage().getScene().getRoot().lookup(".split-pane");
    LoggingRecorder lr = new LoggingRecorder();
    List<String> text = new ArrayList<>();
    Platform.runLater(() -> {
        RFXSplitPane rfxSplitPane = new RFXSplitPane(splitPane, null, null, lr);
        splitPane.setDividerPosition(0, 0.6);
        rfxSplitPane.mouseReleased(null);
        text.add(rfxSplitPane.getAttribute("text"));
    });
    new Wait("Waiting for split pane text.") {
        @Override public boolean until() {
            return text.size() > 0;
        }
    };
    AssertJUnit.assertEquals("[0.6,0.6008064516129032]", text.get(0));
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:18,代碼來源:RFXSplitPaneTest.java

示例2: initComponents

import javafx.scene.control.SplitPane; //導入依賴的package包/類
private void initComponents() {
    LOGGER_UI.trace(":initComps");
    reqTableView = new RequirementTableView();
    reqTableView.setOnAdd(handler::handleCreation);
    reqTableView.setOnRemove(handler::handleDeletion);
    reqTableView.setOnModify(handler::handleModification);

    msView = new MilestonesListView(handler);

    catInfo = new CatalogueInfoPane();


    splitter = new SplitPane();

    splitter.prefWidthProperty().bind(widthProperty());
    splitter.prefHeightProperty().bind(heightProperty());
}
 
開發者ID:dbisUnibas,項目名稱:ReqMan,代碼行數:18,代碼來源:EditorView.java

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

示例4: createChartPane

import javafx.scene.control.SplitPane; //導入依賴的package包/類
private SplitPane createChartPane() {
    CategoryDataset3D dataset = SampleData.createCompanyRevenueDataset();
    Chart3D chart = AreaChart3DFXDemo1.createChart(dataset);
    Chart3DViewer viewer = new Chart3DViewer(chart);
  
    this.splitter = new SplitPane();
    splitter.setOrientation(Orientation.VERTICAL);
    final BorderPane borderPane = new BorderPane();
    borderPane.setCenter(viewer);
    
   // Bind canvas size to stack pane size.
    viewer.prefWidthProperty().bind(borderPane.widthProperty());
    viewer.prefHeightProperty().bind(borderPane.heightProperty());

    final StackPane sp2 = new StackPane();
    
    this.chartDescription = new WebView();
    WebEngine webEngine = chartDescription.getEngine();
    webEngine.load(AreaChart3DFXDemo1.class.getResource("AreaChart3DFXDemo1.html").toString());
    
    sp2.getChildren().add(chartDescription);  
    splitter.getItems().addAll(borderPane, sp2);
    splitter.setDividerPositions(0.70f, 0.30f);
    return splitter;
}
 
開發者ID:jfree,項目名稱:jfree-fxdemos,代碼行數:26,代碼來源:OrsonChartsFXDemo.java

示例5: TablePanel

import javafx.scene.control.SplitPane; //導入依賴的package包/類
public TablePanel(UIProperties uiProperties, MessageByLocaleService localeService, MainController controller) {
    this.controller = controller;
    setPrefHeight(uiProperties.getTablesPrefHeight());
    setPrefWidth(uiProperties.getTablesPrefWidth());

    buttons = new TableButtons();
    tableListView = new TableListView();
    tableListView.onMouseClick(buttons::enableButtons, buttons::disableButtons);
    tableListView.setOnContextMenuRequested(this::onTableContextMenu);

    SplitPane splitPane = splitPane(uiProperties);
    UIUtil.fillParent(splitPane);
    getChildren().add(splitPane);

    tableContext = new TableListContext(localeService, this::tryLoadDDL, this::tryLoadData);
}
 
開發者ID:Kindrat,項目名稱:cassandra-client,代碼行數:17,代碼來源:TablePanel.java

示例6: createExtractedVarsTextArea

import javafx.scene.control.SplitPane; //導入依賴的package包/類
private Node createExtractedVarsTextArea(VariableCollectionController controller, FreeVariableListValidator validator) {
  final TextArea textArea = new TextArea();
  textArea.getStyleClass().addAll("model-text-area");
  textArea.setEditable(false);

  FreeVariableList set = controller.getFreeVariableList();

  updateText(textArea, set.getVariables());
  set.getVariables().addListener((ListChangeListener<? super FreeVariable>) c ->
      updateText(textArea, set.getVariables()));

  final TextArea problemsArea = new TextArea();
  problemsArea.getStyleClass().addAll("model-text-area");
  textArea.setEditable(false);

  updateProblemsText(problemsArea, validator);

  validator.problemsProperty().addListener((Observable o) -> updateProblemsText(problemsArea, validator));

  SplitPane splitPane = new SplitPane(textArea, problemsArea);
  splitPane.setOrientation(Orientation.VERTICAL);

  return splitPane;
}
 
開發者ID:VerifAPS,項目名稱:stvs,代碼行數:25,代碼來源:VariableCollectionDemo.java

示例7: initTDDTrainerViewNormalMode

import javafx.scene.control.SplitPane; //導入依賴的package包/類
/**
 * laedt eine FXML auf die stage , welche nach auswahl einer Uebung erscheint
 * layout beeinhaltet save buttons und textareas und eine men�bar mit verschiedenen optionen 
 */
public static void initTDDTrainerViewNormalMode(String testcode,String sourcecode) { //komisch gemacht doch die textarea laesst sich veraendern beim start
	try {
		FXMLLoader loader = new FXMLLoader();
		loader.setLocation(TDDTMain.class.getResource("layout/TDDTrainerViewNormalMode.fxml"));
		tddtrainerview = (BorderPane) loader.load();
		
		SplitPane splitpanewithtextareas = (SplitPane) tddtrainerview.getChildren().get(1);
		AnchorPane anchorpanewithsourcecodearea = (AnchorPane) splitpanewithtextareas.getItems().get(0);
		AnchorPane anchorpanewithtestcodearea = (AnchorPane) splitpanewithtextareas.getItems().get(1);
		TextArea textareasourcecode = (TextArea) anchorpanewithsourcecodearea.getChildren().get(0); 
		TextArea textareatestcode = (TextArea) anchorpanewithtestcodearea.getChildren().get(0); 
		textareatestcode.setText(testcode);
		textareasourcecode.setText(sourcecode);
		scene = new Scene(tddtrainerview);
					
		primarystage.setScene(scene);
		primarystage.show();
	} catch(IOException e) {
		e.printStackTrace();
	
	}
}
 
開發者ID:ProPra16,項目名稱:programmierpraktikum-abschlussprojekt-team-immortalsgg,代碼行數:27,代碼來源:TDDTMain.java

示例8: MainPane

import javafx.scene.control.SplitPane; //導入依賴的package包/類
public MainPane()
{
	detailPane = new CPane();
	
	table = new FxTable();
	table.addColumn("Example");
	table.setResizePolicyConstrained();
	
	table.getItems().setAll(AllPages.get());
	table.selectedItemProperty().addListener((s) -> updateSelection());
	
	split = new SplitPane(table, detailPane);
	split.setOrientation(Orientation.HORIZONTAL);
	
	setCenter(split);
	
	table.selectFirst();
}
 
開發者ID:andy-goryachev,項目名稱:FxEditor,代碼行數:19,代碼來源:MainPane.java

示例9: restoreSplitPane

import javafx.scene.control.SplitPane; //導入依賴的package包/類
private static void restoreSplitPane(String prefix, SplitPane sp)
{
	String k = prefix + SFX_DIVIDERS;
	SStream s = GlobalSettings.getStream(k);
	
	// must run later because of FX split pane inability to set divider positions exactly
	FX.later(() ->
	{
		int ct = s.nextInt();
		if(sp.getDividers().size() == ct)
		{
			for(int i=0; i<ct; i++)
			{
				double div = s.nextDouble();
				sp.setDividerPosition(i, div);
			}
		}
	});
}
 
開發者ID:andy-goryachev,項目名稱:FxEditor,代碼行數:20,代碼來源:FxSchema.java

示例10: start

import javafx.scene.control.SplitPane; //導入依賴的package包/類
@Override
public void start(Stage primaryStage) throws Exception {

	CheckBoxFxControlTreeView checkedNodeTreeView = new CheckBoxFxControlTreeView(getTestNod());
	checkedNodeTreeView.setOnMouseClicked(event -> {
		System.out.println(checkedNodeTreeView.getCheckModel().getCheckedItems());
	});

	FxControlTreeView simpleNodeTreeView = new FxControlTreeView(getTestNod());
	simpleNodeTreeView.setOnMouseClicked(event -> {
		System.out.println(simpleNodeTreeView.getSelectionModel().getSelectedItems());
	});

	Scene scene = new Scene(new SplitPane(simpleNodeTreeView, checkedNodeTreeView));
	primaryStage.setScene(scene);
	primaryStage.show();
}
 
開發者ID:callakrsos,項目名稱:Gargoyle,代碼行數:18,代碼來源:FxControlsTreeViewExam.java

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

示例12: drawNode

import javafx.scene.control.SplitPane; //導入依賴的package包/類
@Override
public Node drawNode() {
    SplitPane split_pane = new SplitPane();
    Rectangle blue_rect = new Rectangle(SLOT_WIDTH, SLOT_HEIGHT);
    blue_rect.setFill(new Color(0, 0, 1, 1));
    Rectangle red_rect = new Rectangle(SLOT_WIDTH, SLOT_HEIGHT);
    red_rect.setFill(new Color(1, 0, 0, 1));

    split_pane.getItems().add(blue_rect);
    split_pane.getItems().add(red_rect);

    split_pane.setMaxSize(SLOT_WIDTH, SLOT_HEIGHT);
    split_pane.setPrefSize(SLOT_WIDTH, SLOT_HEIGHT);
    split_pane.setMinSize(SLOT_WIDTH, SLOT_HEIGHT);

    split_pane.setStyle("-fx-border-color: darkgray;");

    split_pane.setOrientation(orientation);
    return split_pane;
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:21,代碼來源:SplitPaneApp.java

示例13: createNested

import javafx.scene.control.SplitPane; //導入依賴的package包/類
protected SplitPane createNested() {
    SplitPane nested_split_pane = (SplitPane) createObject();
    nested_split_pane.setId(NESTED_SPLIT);

    boolean resizable = false;
    for (Node node : nested_split_pane.getItems()) {
        SplitPane.setResizableWithParent(node, resizable);
        if (SplitPane.isResizableWithParent(node) != resizable) {
            reportGetterFailure("SplitPane.isResizableWithParent(node)");
            break;
        }
        resizable = !resizable;
    }
    nested_split_pane.setOrientation(orientation);

    nested_split_pane.setMaxSize(-1, -1);
    nested_split_pane.setPrefSize(-1, -1);
    nested_split_pane.setMinSize(-1, -1);

    return nested_split_pane;
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:22,代碼來源:SplitPaneApp.java

示例14: 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;
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:21,代碼來源:SplitPaneApp.java

示例15: resizableCheck

import javafx.scene.control.SplitPane; //導入依賴的package包/類
protected void resizableCheck(final Wrap<? extends SplitPane> split_wrap) {
    Parent<Node> split_as_parent = split_wrap.as(Parent.class, Node.class);
    Lookup<SplitPane> split_lookup = split_as_parent.lookup(SplitPane.class, new ByID<SplitPane>(SplitPaneApp.NESTED_SPLIT));
    for (int i = 0; i < split_lookup.size(); i++) {
        Wrap<? extends SplitPane> split = split_lookup.wrap(i);
        List<Wrap> split_pane_wraps = getSplitPanes(split);
        List<Boolean> resizable_flags = getResizableFlags(split);
        List<Double> initial_split_sizes = getSplitSizes(split_pane_wraps, isVertical(split));
        Wrap<? extends Node> divider = split_as_parent.lookup(Node.class, new ByStyleClass<Node>("split-pane-divider") {
            @Override
            public boolean check(Node cntrl) {
                return super.check(cntrl) && cntrl.getParent().getId().contentEquals(SplitPaneApp.PARENT_SPLIT);
            }
        }).wrap();
        Point start_point = getCenterPoint(divider.getScreenBounds());
        Point end_point1 = getDragPoint1(split_wrap);
        Point end_point2 = getDragPoint2(split_wrap);
        drag(start_point, end_point1);
        List<Double> split_sizes = getSplitSizes(split_pane_wraps, isVertical(split));
        checkSizes(initial_split_sizes, split_sizes, resizable_flags);
        drag(getCenterPoint(divider.getScreenBounds()), end_point2);
        split_sizes = getSplitSizes(split_pane_wraps, isVertical(split));
        checkSizes(initial_split_sizes, split_sizes, resizable_flags);
        drag(getCenterPoint(divider.getScreenBounds()), start_point);
    }
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:27,代碼來源:SplitPaneTest.java


注:本文中的javafx.scene.control.SplitPane類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。