本文整理匯總了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);
}
});
}