當前位置: 首頁>>代碼示例>>Java>>正文


Java TabPane.getTabs方法代碼示例

本文整理匯總了Java中javafx.scene.control.TabPane.getTabs方法的典型用法代碼示例。如果您正苦於以下問題:Java TabPane.getTabs方法的具體用法?Java TabPane.getTabs怎麽用?Java TabPane.getTabs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.control.TabPane的用法示例。


在下文中一共展示了TabPane.getTabs方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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

示例2: 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

示例3: existsTab

import javafx.scene.control.TabPane; //導入方法依賴的package包/類
private boolean existsTab(TabPane znodes, String name) {
	boolean exists = false;
	for (Tab tab : znodes.getTabs()) {
		if(name.equals(tab.getId())){
			return true;
		}
	}
	return exists;
}
 
開發者ID:ajiniesta,項目名稱:zoofx,代碼行數:10,代碼來源:ZNodeCellFactory.java

示例4: addToScriptPane

import javafx.scene.control.TabPane; //導入方法依賴的package包/類
private void addToScriptPane(Block block) {
    BorderPane root = (BorderPane) getScene().getRoot();
    TabPane centerPane = (TabPane) root.getCenter();
    for (Tab t : centerPane.getTabs()) {
        if ("scriptContent".equals(t.getContent().getId())) {
            ResizePane pane = (ResizePane) t.getContent();
            Pane ap = (Pane) pane.getContent();

            // calc position
            pane.resizeContent();
            double h = pane.getContentHeight();
            if (h != 0) {
                h += 10;
            }
            block.setLayoutY(h);

            ap.getChildren().add(block);
        }
    }
}
 
開發者ID:jointry,項目名稱:jointry,代碼行數:21,代碼來源:MenuItem.java

示例5: createCatalogPane

import javafx.scene.control.TabPane; //導入方法依賴的package包/類
private TabPane createCatalogPane() {
	final TabPane catalogPane = new TabPane();
	final ObservableList<Tab> tabs = catalogPane.getTabs();
	tabs.add(createCatalogTab());
	tabs.add(createSnapshotsTab());
	tabs.add(createTagsTab());
	return catalogPane;
}
 
開發者ID:mikelaud,項目名稱:fx-media-catalog,代碼行數:9,代碼來源:FxMediaCatalog.java

示例6: instantiateTabs

import javafx.scene.control.TabPane; //導入方法依賴的package包/類
private void instantiateTabs() {
	developerTabs = new TabPane();
	Tab spriteCreation = new Tab("Sprite creation",new SpriteCreationScreen(myModelData));
	Tab GeneralDataTab = new Tab(myResources.getString(GENERAL_DATA), myGeneralDataCreator);
	//Tab ScreenSettingView = new Tab(myResources.getString(SCREEN_SETTING), new ScreenModelCreator(myModelData.getScreenSprites(),myGeneralDataCreator, new ScreenModelData()));

	ObservableList<Tab> myTabs = developerTabs.getTabs();
	//myTabs.addAll(spriteCreation,GeneralDataTab, ScreenSettingView);
}
 
開發者ID:LtubSalad,項目名稱:voogasalad-ltub,代碼行數:10,代碼來源:MasterDeveloperInterface.java

示例7: instantiateTabs

import javafx.scene.control.TabPane; //導入方法依賴的package包/類
private void instantiateTabs() {
	creationScreens = new TabPane();
	Tab generalSpriteCreation = new Tab("Sprite creation",new SpriteCreationScreen(developerData));
	
	ObservableList<Tab> myTabs = creationScreens.getTabs();
	myTabs.addAll(generalSpriteCreation);
	this.setCenter(creationScreens);
}
 
開發者ID:LtubSalad,項目名稱:voogasalad-ltub,代碼行數:9,代碼來源:SpriteCreationEnvironment.java

示例8: getNodes

import javafx.scene.control.TabPane; //導入方法依賴的package包/類
@Before
@SuppressWarnings("unchecked")
public void getNodes() {
    //System.out.println("running getNodes()");

    ownCloudPath = (Label) find(".ownCloudPath");
    notesTableFXML = (TableView<Map<String, String>>) find(".notesTable");
    groupsPaneFXML = (TabPane) find(".groupsPane");
    noteEditorFXML = (HTMLEditor) find(".noteEditor");
    
    // tabs are not nodes!!! So we have to find them the hard way
    final ObservableList<Tab> tabsList = groupsPaneFXML.getTabs();
    allTab = (OwnNoteTab) tabsList.stream().filter(x -> {
                                                    return ((Label) x.getGraphic()).getText().startsWith(GroupData.ALL_GROUPS);
                                                }).findFirst().orElse(null);
    test1Tab = (OwnNoteTab) tabsList.stream().filter(x -> {
                                                    return ((Label) x.getGraphic()).getText().startsWith("Test1");
                                                }).findFirst().orElse(null);
    test2Tab = (OwnNoteTab) tabsList.stream().filter(x -> {
                                                    return ((Label) x.getGraphic()).getText().startsWith("Test2");
                                                }).findFirst().orElse(null);
    test3Tab = (OwnNoteTab) tabsList.stream().filter(x -> {
                                                    return ((Label) x.getGraphic()).getText().startsWith("Test3");
                                                }).findFirst().orElse(null);
    testPLUSTab = (OwnNoteTab) tabsList.stream().filter(x -> {
                                                    return "+".equals(((Label) x.getGraphic()).getText());
                                                }).findFirst().orElse(null);
}
 
開發者ID:ThomasDaheim,項目名稱:ownNoteEditor,代碼行數:29,代碼來源:TestOneNoteLookAndFeel.java

示例9: addToScriptPane

import javafx.scene.control.TabPane; //導入方法依賴的package包/類
private void addToScriptPane(Variable v) {
    BorderPane root = (BorderPane) getScene().getRoot();
    TabPane centerPane = (TabPane) root.getCenter();
    for (Tab t : centerPane.getTabs()) {
        if ("scriptContent".equals(t.getContent().getId())) {
            ResizePane pane = (ResizePane) t.getContent();
            Pane ap = (Pane) pane.getContent();
            ap.getChildren().add(v);
        }
    }
}
 
開發者ID:jointry,項目名稱:jointry,代碼行數:12,代碼來源:MenuItemAdv.java

示例10: getCollision

import javafx.scene.control.TabPane; //導入方法依賴的package包/類
public Connector getCollision() {
    Connector connector = null;
    BorderPane root = (BorderPane) getScene().getRoot();
    TabPane tabs = (TabPane) root.getCenter();

    for (Tab tab : tabs.getTabs()) {
        if (tab == null) {
            continue;
        }
        if (!"scriptContent".equals(tab.getContent().getId())) {
            continue;
        }

        // Inside scriptPane
        ResizePane pane = (ResizePane) tab.getContent();
        Pane scriptPane = (Pane) pane.getContent();
        for (Node node : scriptPane.getChildren()) {
            if (node == myBlock) {
                continue;
            }
            if (!(node instanceof If) && !(node instanceof While)) {
                continue;
            }

            // Inside Block
            Block target = (Block) node;
            for (Node n : target.getChildren()) {
                if (n instanceof Connector) {
                    Connector c = (Connector) n;
                    c.detouch();
                    Shape intersect = null;

                    // 內部の接觸
                    intersect = Shape.intersect(c, myBlock.leftCon);
                    if (intersect.getBoundsInLocal().getWidth() != -1) {
                        if (c.getPosition() == Connector.Position.CENTER) {
                            connector = c;
                            break;
                        }
                    }
                }
            }
        }
    }
    setConnector(connector);
    return connector;
}
 
開發者ID:jointry,項目名稱:jointry,代碼行數:48,代碼來源:Condition.java

示例11: getCollision

import javafx.scene.control.TabPane; //導入方法依賴的package包/類
public Connector getCollision() {
    Connector connector = null;
    BorderPane root = (BorderPane) getScene().getRoot();
    TabPane tabs = (TabPane) root.getCenter();

    for (Tab tab : tabs.getTabs()) {
        if (tab == null) {
            continue;
        }
        if (!"scriptContent".equals(tab.getContent().getId())) {
            continue;
        }

        // Inside scriptPane
        ResizePane pane = (ResizePane) tab.getContent();
        Pane scriptPane = (Pane) pane.getContent();
        for (Node node : scriptPane.getChildren()) {
            if (node == myBlock) {
                continue;
            }
            if (!(node instanceof Statement)) {
                continue;
            }

            // Inside Block
            Statement target = (Statement) node;
            for (Node n : target.getChildren()) {
                if (n instanceof Connector) {
                    Connector c = (Connector) n;
                    c.detouch();
                    Shape intersect = null;

                    // 上下の接觸
                    intersect = Shape.intersect(c, myBlock.topCon);
                    if (intersect.getBoundsInLocal().getWidth() != -1) {
                        connector = c;
                        break;
                    }
                    // 包含の接觸
                    intersect = Shape.intersect(c, myBlock.leftCon);
                    if (intersect.getBoundsInLocal().getWidth() != -1) {
                        connector = c;
                        break;
                    }
                }
            }
        }
    }

    if (connector != null) {
        setConnector(connector);
    }
    return connector;
}
 
開發者ID:jointry,項目名稱:jointry,代碼行數:55,代碼來源:Statement.java

示例12: creatNewTab

import javafx.scene.control.TabPane; //導入方法依賴的package包/類
public void creatNewTab(TabPane tabpane, Tab addNewTab) {

		Tab tab = new Tab("New tab");


		try {
			tab.setContent(FXMLLoader.load(getClass().getResource(Main.FXMLS+"Tab.fxml")));
			// tab.setText(TabController.getWebEngine().getTitle());

		} catch (IOException e) {
			System.out.println("Exception: New tab click but not working in TabPaneView Class");
		}

		tab.getStyleClass().addAll("tab-pane");

		ObservableList<Tab> tabs = tabpane.getTabs();
		
		Platform.runLater(new Runnable() {
			@Override
			public void run() {
				
				tabs.add(tabs.size() - 1, tab);
				
				SingleSelectionModel<Tab> selectedTab = tabpane.getSelectionModel();
				selectedTab.select(tab);

			}
		});

	}
 
開發者ID:badarshahzad,項目名稱:Jfx-Browser,代碼行數:31,代碼來源:MainController.java


注:本文中的javafx.scene.control.TabPane.getTabs方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。