本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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);
}
});
}