本文整理汇总了Java中javafx.scene.control.TabPane.setSide方法的典型用法代码示例。如果您正苦于以下问题:Java TabPane.setSide方法的具体用法?Java TabPane.setSide怎么用?Java TabPane.setSide使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.TabPane
的用法示例。
在下文中一共展示了TabPane.setSide方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TabSample
import javafx.scene.control.TabPane; //导入方法依赖的package包/类
public TabSample() {
BorderPane borderPane = new BorderPane();
final TabPane tabPane = new TabPane();
tabPane.setPrefSize(400, 400);
tabPane.setSide(Side.TOP);
tabPane.setTabClosingPolicy(TabPane.TabClosingPolicy.UNAVAILABLE);
final Tab tab1 = new Tab();
tab1.setText("Tab 1");
final Tab tab2 = new Tab();
tab2.setText("Tab 2");
final Tab tab3 = new Tab();
tab3.setText("Tab 3");
final Tab tab4 = new Tab();
tab4.setText("Tab 4");
tabPane.getTabs().addAll(tab1, tab2, tab3, tab4);
borderPane.setCenter(tabPane);
getChildren().add(borderPane);
}
示例2: DemoTab
import javafx.scene.control.TabPane; //导入方法依赖的package包/类
private DemoTab(String title, String sourceFile) throws Exception {
super(title);
setClosable(false);
TabPane content = new TabPane();
setContent(content);
content.setSide(Side.BOTTOM);
Tab widgets = new Tab("Widgets");
widgets.setClosable(false);
URL location = getClass().getResource(sourceFile);
FXMLLoader fxmlLoader = new FXMLLoader(location);
Node node = fxmlLoader.load();
widgets.setContent(node);
Tab source = new Tab("Source");
source.setClosable(false);
XMLEditor editor = new XMLEditor();
editor.setEditable(false);
String text = lines(Paths.get(getClass().getResource(sourceFile).toURI())).collect(joining("\n"));
editor.setText(text);
source.setContent(editor);
content.getTabs().addAll(widgets, source);
}
示例3: createDescriptionPane
import javafx.scene.control.TabPane; //导入方法依赖的package包/类
private TabPane createDescriptionPane() {
final TabPane descriptionPane = new TabPane();
descriptionPane.getTabs().add(createSnapshots2Tab());
descriptionPane.getTabs().add(createDescriptionTab());
descriptionPane.setSide(Side.LEFT);
return descriptionPane;
}
示例4: ExcelTemplateSkin
import javafx.scene.control.TabPane; //导入方法依赖的package包/类
/**
* @param excelTemplateControl
*/
public ExcelTemplateSkin(ExcelTemplateControl control) {
super(control, new ExcelTemplateBehavior(control));
this.control = control;
root = new TabPane();
root.setSide(Side.BOTTOM);
getChildren().add(root);
}
示例5: start
import javafx.scene.control.TabPane; //导入方法依赖的package包/类
@Override
public void start(Stage stage, Scene scene, StackPane root, BorderPane border) throws Exception {
OptionMenu.init();
tb = new TabPane();
menuBar = new MenuBar();
bmread = new Reader(menuBook);
bmread.refresh();
mkDirs(home, saveDir, temp, cssDir);
stage.getIcons().add(new Image(ZunoZap.class.getClassLoader().getResourceAsStream("zunozaplogo.gif")));
tb.setPrefSize(1365, 768);
tb.setSide(Side.TOP);
/// Setup tabs
Tab newtab = new Tab(" + ");
newtab.setClosable(false);
tb.getTabs().add(newtab);
createTab(true);
tb.getSelectionModel().selectedItemProperty().addListener((a,b,c) -> { if (c == newtab) createTab(false); });
border.setCenter(tb);
border.setTop(menuBar);
border.autosize();
WebView dummy = new WebView();
setUserAgent(dummy.getEngine());
regMenuItems(bmread, menuFile, menuBook, aboutPageHTML("Java WebView", dummy.getEngine().getUserAgent(), "ZunoZap/zunozap/master/LICENCE", "LGPLv3", "N/A"), tb, Engine.WEBKIT);
menuBar.getMenus().addAll(menuFile, menuBook);
sm = new StyleManager(cssDir, scene);
scene.getStylesheets().add(ZunoAPI.stylesheet.toURI().toURL().toExternalForm());
p.loadPlugins();
if (allowPluginEvents()) for (PluginBase pl : p.plugins) pl.onLoad(stage, scene, tb);
}
示例6: generateScene
import javafx.scene.control.TabPane; //导入方法依赖的package包/类
private Scene generateScene() {
final TabPane tabPane = new TabPane();
tabPane.setSide(Side.LEFT);
this.log = new TextArea();
final Tab logTab = new Tab("Log");
logTab.setContent(this.log);
logTab.setClosable(false);
final Tab networkTab = new Tab("Network");
networkTab.setClosable(false);
final ScrollPane scrollPane = new ScrollPane();
networkTab.setContent(scrollPane);
this.networkVisualisation = new NetworkVisualisation(this.jamocha.getNetwork());
this.networkVisualisation.setTranslateX(10);
this.networkVisualisation.setTranslateY(10);
this.networkVisualisation.update();
scrollPane.setContent(this.networkVisualisation);
tabPane.getTabs().addAll(logTab, networkTab);
final Scene scene = new Scene(tabPane);
tabPane.prefHeightProperty().bind(scene.heightProperty());
tabPane.prefWidthProperty().bind(scene.widthProperty());
return scene;
}
示例7: DCPlots
import javafx.scene.control.TabPane; //导入方法依赖的package包/类
public DCPlots(DCThreadManager dc) {
this.dc = dc;
// tab pane
final TabPane tabPane = new TabPane();
tabPane.setSide(Side.TOP);
tabPane.setTabClosingPolicy(TabPane.TabClosingPolicy.UNAVAILABLE);
// charts
for (JFreeChart lc : this.dc.getPlotter().getAllCharts()) {
final Tab lcTab = new Tab();
final StackPane lcSpane = new StackPane();
lcTab.setText( lc.getTitle().getText() );
lcTab.setContent(lcSpane);
// Using java2d in javafx
// Bind canvas size to stack pane size.
// ChartCanvas canvas = new ChartCanvas(lc);
final SwingNode chartSwingNode = new SwingNode();
chartSwingNode.setContent( new ChartPanel(lc) );
lcSpane.getChildren().add(chartSwingNode);
// canvas.widthProperty().bind(lcSpane.widthProperty());
// canvas.heightProperty().bind(lcSpane.heightProperty());
tabPane.getTabs().add(lcTab);
}
final Stage stage = new Stage();
stage.setTitle("Results");
//create scene with set width, height and color
Scene scene = new Scene(tabPane, 1000, 600, Color.WHITESMOKE);
//set scene to stage
stage.setScene(scene);
//center stage on screen
stage.centerOnScreen();
//show the stage
stage.show();
}
示例8: initComponents
import javafx.scene.control.TabPane; //导入方法依赖的package包/类
public void initComponents()
{
tabPane = new TabPane();
tabPane.setSide(Side.LEFT);
root = new Group();
novoVeiculoTab = new NovoVeiculoTab();
listaVeiculoTab = new ListagemVeiculoTab();
fichaVeiculoTab = new FichaVeiculoTab();
vendaVeiculoTab = new VendaVeiculoTab();
aboutTab = new AboutTab();
tabPane.getTabs().addAll(novoVeiculoTab, listaVeiculoTab,
fichaVeiculoTab, aboutTab);
tabPane.getSelectionModel().select(aboutTab);
tabPane.setMinSize(WIDTH, HEIGHT);
tabPane.setMaxSize(WIDTH, HEIGHT);
/* Mudar */
t = new BoasVindasNode();
/* Mudar */
root.getChildren().addAll(tabPane, t);
root.setAutoSizeChildren(true);
}
示例9: start
import javafx.scene.control.TabPane; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
BorderPane rootPane = new BorderPane();
rootPane.setId("root");
TabPane rootTabPane = new TabPane();
rootTabPane.setSide(Side.BOTTOM);
rootTabPane.setTabClosingPolicy(TabClosingPolicy.UNAVAILABLE);
rootPane.setCenter(rootTabPane);
Controller[] controllers = new Controller[4];
rootTabPane.getSelectionModel().selectedIndexProperty().addListener((o, oldVal, newVal) -> {
if (oldVal.intValue() >= 0 && controllers[oldVal.intValue()] != null) {
controllers[oldVal.intValue()].afterHide();
}
if (controllers[newVal.intValue()] != null) {
controllers[newVal.intValue()].beforeShow();
}
});
FXMLLoader loader = null;
loader = new FXMLLoader();
loader.setLocation(ContractRFXApp.class.getResource("SelectTask.fxml"));
loader.load();
SelectTaskController selectTaskController = loader.getController();
selectTaskController.init(clientModel, taskModel);
loader = new FXMLLoader();
loader.setLocation(ContractRFXApp.class.getResource("Work.fxml"));
Parent workPane = (Parent) loader.load();
WorkController workController = loader.getController();
workController.init(taskModel, selectTaskController);
controllers[0] = workController;
loader = new FXMLLoader();
loader.setLocation(ContractRFXApp.class.getResource("Clients.fxml"));
Parent clientsPane = (Parent) loader.load();
ClientsController clientsController = loader.getController();
clientsController.init(clientModel);
controllers[2] = clientsController;
loader = new FXMLLoader();
loader.setLocation(ContractRFXApp.class.getResource("Tasks.fxml"));
Parent tasksPane = (Parent) loader.load();
TasksController tasksController = loader.getController();
tasksController.init(clientModel, taskModel);
controllers[3] = tasksController;
Font iconFont = Font.loadFont(ContractRFXApp.class.getResource("ionicons.ttf").toExternalForm(), 10);
Tab workTab = createIconTab(iconFont, '\uf1e1', "Work");
rootTabPane.getTabs().add(workTab);
workTab.setContent(workPane);
Tab reportsTab = createIconTab(iconFont, '\uf2b5', "Reports");
rootTabPane.getTabs().add(reportsTab);
Tab clientsTab = createIconTab(iconFont, '\uf1bf', "Clients");
rootTabPane.getTabs().add(clientsTab);
clientsTab.setContent(clientsPane);
Tab tasksTab = createIconTab(iconFont, '\uf16c', "Tasks");
rootTabPane.getTabs().add(tasksTab);
tasksTab.setContent(tasksPane);
Scene scene = new Scene(rootPane);
rootTabPane.tabMinWidthProperty().bind(scene.widthProperty().divide(4.0).subtract(5));
rootTabPane.tabMaxWidthProperty().bind(rootTabPane.tabMinWidthProperty());
primaryStage.setTitle("ContractR");
primaryStage.setScene(scene);
primaryStage.show();
}