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