當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。