本文整理汇总了Java中javafx.scene.control.TabPane类的典型用法代码示例。如果您正苦于以下问题:Java TabPane类的具体用法?Java TabPane怎么用?Java TabPane使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TabPane类属于javafx.scene.control包,在下文中一共展示了TabPane类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import javafx.scene.control.TabPane; //导入依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
Properties properties = new Properties();
properties.put(JavaSVNManager.SVN_URL, "svn://10.40.41.49");
// properties.put(JavaSVNManager.SVN_USER_ID, "kyjun.kim");
// properties.put(JavaSVNManager.SVN_USER_PASS, "kyjun.kim");
FxSVNHistoryDataSupplier svnDataSupplier = new FxSVNHistoryDataSupplier(new JavaSVNManager(properties));
SvnChagnedCodeComposite svnChagnedCodeComposite = new SvnChagnedCodeComposite(svnDataSupplier);
ScmCommitComposite scmCommitComposite = new ScmCommitComposite(svnDataSupplier);
TabPane tabPane = new TabPane();
tabPane.getTabs().addAll(new Tab("Chagned Codes.", svnChagnedCodeComposite), new Tab("Commit Hist.", scmCommitComposite));
primaryStage.setScene(new Scene(tabPane));
primaryStage.show();
}
示例2: marathon_select
import javafx.scene.control.TabPane; //导入依赖的package包/类
@Override public boolean marathon_select(String tab) {
Matcher matcher = CLOSE_PATTERN.matcher(tab);
boolean isCloseTab = matcher.matches();
tab = isCloseTab ? matcher.group(1) : tab;
TabPane tp = (TabPane) node;
ObservableList<Tab> tabs = tp.getTabs();
for (int index = 0; index < tabs.size(); index++) {
String current = getTextForTab(tp, tabs.get(index));
if (tab.equals(current)) {
if (isCloseTab) {
((TabPaneSkin) tp.getSkin()).getBehavior().closeTab(tabs.get(index));
return true;
}
tp.getSelectionModel().select(index);
return true;
}
}
return false;
}
示例3: start
import javafx.scene.control.TabPane; //导入依赖的package包/类
@Override
public void start(Stage mainWin) throws IOException {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
DEFAULT_HEIGHT = screenSize.height - 100;
DEFAULT_WIDTH = screenSize.width - 100;
teamTabs = new TabPane(); // Initialize the pane with for the tabs
setUpHelp = new GUIHelper(this); // Initialize the GUI helper class
info = setUpHelp.createTextBox("Server not configured!"); // Initialize the textbox
menuBar = setUpHelp.getMenu(info); // Initialize the menubar and the menus
elementSect = new StackPane(); // Initialize the element stackpane
elementSect.getChildren().add(teamTabs); // Add the tabs from teamtabs there
borderPane = new BorderPane(); // Add the border pane
borderPane.setTop(menuBar); // Add stuff to the borders
borderPane.setCenter(elementSect); // But the elementSect in the middle
borderPane.setBottom(info); // Put the textpane in the bottom
Scene scene = new Scene(borderPane, DEFAULT_WIDTH, DEFAULT_HEIGHT); // Create the scene for the height
mainWin.getIcons().add(new Image(ICON_LOC)); // Set the icon as the CyberTiger icon
mainWin.setTitle("CyberTiger Scoreboard"); // Get the window name
mainWin.setScene(scene); // Set the window
mainWin.show(); // Show the window
refreshData(); // Refresh the data since this creates the rest of teh GUI
Timeline scoreboardRefresh = new Timeline(new KeyFrame(Duration.seconds(REFRESH_TIMEOUT), (ActionEvent event) -> {
try {
refreshData(); // Put the refresh method in this method to autorefresh every minute
} catch (IOException ex) { // Catch the exception from the database conn
info.setText("Error refreshing scores! " + ex); // Show the errors
}
}));
scoreboardRefresh.setCycleCount(Timeline.INDEFINITE); // Set the number of times to run
scoreboardRefresh.play(); // Run the timer
}
示例4: start
import javafx.scene.control.TabPane; //导入依赖的package包/类
public void start(Stage primaryStage, TabPane rootLayout){
tabPane = rootLayout;
primaryStage.setTitle("Statblock");
Scene myScene = new Scene(rootLayout);
App.getHotkeyController().giveGlobalHotkeys(myScene);
App.getHotkeyController().giveStatblockHotkeys(myScene);
primaryStage.setScene(myScene);
primaryStage.show();
primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() {
public void handle(WindowEvent we) {
log.debug("Statblock Controller is closing");
started = false;
}
});
ourStage = primaryStage;
startAutoUpdateTabs();
started = true;
log.debug("started statblock controller.");
}
示例5: getChildren
import javafx.scene.control.TabPane; //导入依赖的package包/类
private ObservableList<Node> getChildren(Node node) {
if (node instanceof ButtonBar) {
return ((ButtonBar) node).getButtons();
}
if (node instanceof ToolBar) {
return ((ToolBar) node).getItems();
}
if (node instanceof Pane) {
return ((Pane) node).getChildren();
}
if (node instanceof TabPane) {
ObservableList<Node> contents = FXCollections.observableArrayList();
ObservableList<Tab> tabs = ((TabPane) node).getTabs();
for (Tab tab : tabs) {
contents.add(tab.getContent());
}
return contents;
}
return FXCollections.observableArrayList();
}
示例6: initComponents
import javafx.scene.control.TabPane; //导入依赖的package包/类
private void initComponents() {
optionBox.setItems(model);
optionBox.getSelectionModel().selectedItemProperty().addListener((observableValue, oldValue, newValue) -> {
if (newValue != null) {
updateTabPane();
}
});
optionBox.setCellFactory(new Callback<ListView<PlugInModelInfo>, ListCell<PlugInModelInfo>>() {
@Override public ListCell<PlugInModelInfo> call(ListView<PlugInModelInfo> param) {
return new LauncherCell();
}
});
optionTabpane.setId("CompositeTabPane");
optionTabpane.setTabClosingPolicy(TabClosingPolicy.UNAVAILABLE);
optionTabpane.getStyleClass().add(TabPane.STYLE_CLASS_FLOATING);
VBox.setVgrow(optionTabpane, Priority.ALWAYS);
}
示例7: 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);
}
示例8: getText
import javafx.scene.control.TabPane; //导入依赖的package包/类
@Test public void getText() throws Throwable {
TabPane tabPane = (TabPane) getPrimaryStage().getScene().getRoot().lookup(".tab-pane");
LoggingRecorder lr = new LoggingRecorder();
List<String> text = new ArrayList<>();
Platform.runLater(new Runnable() {
@Override public void run() {
RFXTabPane rfxTabPane = new RFXTabPane(tabPane, null, null, lr);
tabPane.getSelectionModel().select(1);
rfxTabPane.mouseClicked(null);
text.add(rfxTabPane.getAttribute("text"));
}
});
new Wait("Waiting for tab pane text.") {
@Override public boolean until() {
return text.size() > 0;
}
};
AssertJUnit.assertEquals("Tab 2", text.get(0));
}
示例9: TabsMenu
import javafx.scene.control.TabPane; //导入依赖的package包/类
public TabsMenu(TabPane tabPane)
{
super("Tabs");
tabPaneToAddTo = tabPane;
tabs = tabPane.getTabs().toArray(new Tab[tabPane.getTabs().size()]);
handler = new MenuHandler(tabs);
for(int i = 0; i < tabs.length; i++)
{
MenuItem tmp = new MenuItem(tabs[i].getText());
tmp.setOnAction(handler);
super.getItems().add(tmp);
}
tabPaneToAddTo.getTabs().remove(3, 5);
}
示例10: init
import javafx.scene.control.TabPane; //导入依赖的package包/类
@Override
public void init () {
TabViewer charTabView = new CharTabViewer();
TabViewer levelTabView = new LevelTabViewer();
TabPane tabPane = new TabPane();
Tab charTab = new Tab();
Tab levelTab = new Tab();
charTab.setContent(charTabView.draw());
levelTab.setContent(levelTabView.draw());
tabPane.getTabs().add(charTab);
tabPane.getTabs().add(levelTab);
}
示例11: SettingsWindow
import javafx.scene.control.TabPane; //导入依赖的package包/类
public SettingsWindow(Stage parent) throws IOException {
super(StageStyle.UNDECORATED);
prefs = Preferences.userNodeForPackage(App.class);
// Load root layout from fxml file.
FXMLLoader loader = new FXMLLoader(getClass().getResource("fxml/settings_menu.fxml"));
loader.setController(this);
this.initModality(Modality.WINDOW_MODAL);
this.initOwner(parent);
this.setAlwaysOnTop(true);
TabPane layout = loader.load();
Scene scene2 = new Scene(layout);
this.setScene(scene2);
this.setTitle("LMSGrabber Settings");
min_delay_slider.setValue(prefs.getDouble("min_delay", 1.0));
max_delay_slider.setValue(prefs.getDouble("max_delay", 3.0));
input_proxy.setText(prefs.get("proxy", ""));
multithreaded_check.setSelected(prefs.getBoolean("multithreaded", true));
}
示例12: addTab
import javafx.scene.control.TabPane; //导入依赖的package包/类
public void addTab(final String name, final String id, final Node content)
{
final Tab tab = TabHelper.createTabWithContextMenu(name, id, "/mineide/img/addIcon.png");
final TabPane tabs = this.tabPanes.get(0);
int index = tabs.getTabs().indexOf(tab);
if (index == -1)
{
final BorderPane borderPane = new BorderPane();
tab.setContent(borderPane);
if (content != null)
borderPane.setCenter(content);
tabs.getTabs().add(tab);
tabs.getSelectionModel().select(tab);
}
else
tabs.getSelectionModel().select(index);
}
示例13: start
import javafx.scene.control.TabPane; //导入依赖的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();
}
示例14: loopTabs
import javafx.scene.control.TabPane; //导入依赖的package包/类
public void loopTabs(JFXTripletDisplay jfxDisplay) {
XYTabPane xyTabPane = jfxDisplay.getXyTabPane();
ObservableList<Tab> vtabs = xyTabPane.getvTabPane().getTabs();
for (Tab vtab : vtabs) {
xyTabPane.getvTabPane().getSelectionModel().select(vtab);
TabPane hTabPane = xyTabPane.getSelectedTabPane();
ObservableList<Tab> htabs = hTabPane.getTabs();
if (vtab.getTooltip() != null) {
String vTitle = vtab.getTooltip().getText();
for (Tab htab : htabs) {
hTabPane.getSelectionModel().select(htab);
String title = htab.getTooltip().getText();
System.out.println(vTitle + "_" + title);
snapShot(jfxDisplay.getStage(),vTitle+"_"+title);
}
}
}
done=true;
}
示例15: SpecificationsPane
import javafx.scene.control.TabPane; //导入依赖的package包/类
/**
* Creates an empty instance.
*/
public SpecificationsPane() {
this.tabPane = new TabPane();
this.addButton = new Button("+");
ViewUtils.setupClass(this);
AnchorPane.setTopAnchor(tabPane, 0.0);
AnchorPane.setLeftAnchor(tabPane, 0.0);
AnchorPane.setRightAnchor(tabPane, 0.0);
AnchorPane.setBottomAnchor(tabPane, 0.0);
AnchorPane.setTopAnchor(addButton, 5.0);
AnchorPane.setRightAnchor(addButton, 5.0);
this.getChildren().addAll(tabPane, addButton);
}