当前位置: 首页>>代码示例>>Java>>正文


Java TabPane类代码示例

本文整理汇总了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();
	}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:17,代码来源:ScmCommitCompositeExam.java

示例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;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:20,代码来源:JavaFXTabPaneElement.java

示例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
}
 
开发者ID:billwi,项目名称:CyberTigerScoreboard,代码行数:35,代码来源:CPscorereport.java

示例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.");
}
 
开发者ID:ForJ-Latech,项目名称:fwm,代码行数:20,代码来源:StatBlockController.java

示例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();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:21,代码来源:ModalDialog.java

示例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);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:18,代码来源:CompositeLayout.java

示例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);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:19,代码来源:TabSample.java

示例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));
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:20,代码来源:RFXTabPaneTest.java

示例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);
}
 
开发者ID:BlueGoliath,项目名称:Goliath-Overclocking-Utility-FX,代码行数:18,代码来源:TabsMenu.java

示例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);

}
 
开发者ID:tomrom95,项目名称:GameAuthoringEnvironment,代码行数:18,代码来源:GameAuthoringInitUseCase.java

示例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));
}
 
开发者ID:LMSGrabber,项目名称:LMSGrabber,代码行数:26,代码来源:SettingsWindow.java

示例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);
}
 
开发者ID:Leviathan-Studio,项目名称:MineIDE,代码行数:19,代码来源:TabManagement.java

示例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();
}
 
开发者ID:jfree,项目名称:jfree-fxdemos,代码行数:35,代码来源:OrsonChartsFXDemo.java

示例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;

}
 
开发者ID:BITPlan,项目名称:can4eve,代码行数:22,代码来源:TestHelpPages.java

示例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);
}
 
开发者ID:VerifAPS,项目名称:stvs,代码行数:19,代码来源:SpecificationsPane.java


注:本文中的javafx.scene.control.TabPane类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。