当前位置: 首页>>代码示例>>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;未经允许,请勿转载。