javafx.scene.control.Tab.setGraphic()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(294)

本文整理了Java中javafx.scene.control.Tab.setGraphic()方法的一些代码示例,展示了Tab.setGraphic()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tab.setGraphic()方法的具体详情如下:
包路径:javafx.scene.control.Tab
类名称:Tab
方法名:setGraphic

Tab.setGraphic介绍

暂无

代码示例

代码示例来源:origin: com.bitplan.gui/com.bitplan.javafx

  1. /**
  2. * set the icon for the tab
  3. *
  4. * @param tab
  5. * @param icon
  6. */
  7. public void setTabIcon(Tab tab, Node icon) {
  8. if (icon != null)
  9. tab.setGraphic(icon);
  10. }

代码示例来源:origin: stackoverflow.com

  1. void loadFavicon(String location, Tab tab) {
  2. try {
  3. String faviconUrl = String.format("http://www.google.com/s2/favicons?domain_url=%s", URLEncoder.encode(location, "UTF-8"));
  4. Image favicon = new Image(faviconUrl, true);
  5. ImageView iv = new ImageView(favicon);
  6. tab.setGraphic(iv);
  7. } catch (UnsupportedEncodingException ex) {
  8. throw new RuntimeException(ex); // not expected
  9. }

代码示例来源:origin: de.jensd/fontawesomefx-common

  1. public void setIcon(Tab tab, GlyphIcons icon, String iconSize) {
  2. tab.setGraphic(createIcon(icon, iconSize));
  3. }

代码示例来源:origin: io.github.factoryfx/javafxDataEditing

  1. public void addIcon(Tab component, FontAwesome.Glyph icon) {
  2. if (icon != null) {
  3. component.setGraphic(getFontAwesome().create(icon));
  4. }
  5. }

代码示例来源:origin: org.gillius/jfxutils

  1. /**
  2. * Helper method to create a new tab with the given label and make it draggable with {@link #makeDraggable}.
  3. */
  4. public static Tab newDraggableTab( String label ) {
  5. Tab rr = new Tab();
  6. rr.setGraphic( new Label( label ) );
  7. makeDraggable( rr );
  8. return rr;
  9. }

代码示例来源:origin: com.github.giulianini.jestures/jestures

  1. private void initGraphic() {
  2. this.tabPane.getTabs().get(0).setGraphic(ViewUtilities.iconSetter(Material.PERSON, IconDim.MEDIUM));
  3. this.tabPane.getTabs().get(1).setGraphic(ViewUtilities.iconSetter(Material.BLUR_ON, IconDim.MEDIUM));
  4. this.tabPane.getTabs().get(2).setGraphic(ViewUtilities.iconSetter(Material.MULTILINE_CHART, IconDim.MEDIUM));
  5. this.tabPane.getTabs().get(3).setGraphic(ViewUtilities.iconSetter(Material.SETTINGS, IconDim.MEDIUM));
  6. this.startButton.setGraphic(ViewUtilities.iconSetter(Material.VISIBILITY, IconDim.MEDIUM));
  7. }

代码示例来源:origin: com.bitplan.gui/com.bitplan.javafx

  1. /**
  2. * create an XYTab Pane with the given iconSize
  3. *
  4. * @param iconSize
  5. * - e.g. 48
  6. */
  7. public XYTabPane(int iconSize) {
  8. super();
  9. this.iconSize = iconSize;
  10. this.currentTab = TabSelection.getInstance();
  11. setvTabPane(this.addTabPane("vTabPane"));
  12. getvTabPane().setSide(Side.LEFT);
  13. Tab filler = new Tab();
  14. topLeftButton = new Button();
  15. int tabSize = getTabSize();
  16. topLeftButton.setMinSize(tabSize, tabSize);
  17. topLeftButton.setMaxSize(tabSize, tabSize);
  18. topLeftButton.setDisable(true);
  19. filler.setGraphic(topLeftButton);
  20. filler.setDisable(true);
  21. getvTabPane().getTabs().add(filler);
  22. this.addToMaps(filler, vTabPane);
  23. fontAwesome = GlyphFontRegistry.font("FontAwesome");
  24. super.getChildren().add(getvTabPane());
  25. }

代码示例来源:origin: com.powsybl/powsybl-gse-security-analysis

  1. preContGraphic.setPrefWrapLength(150);
  2. preContTab = new Tab("", preContResultPane);
  3. preContTab.setGraphic(preContGraphic);
  4. preContTab.setClosable(false);
  5. postContGraphic.setPrefWrapLength(150);
  6. postContTab = new Tab("", postContResultPane);
  7. postContTab.setGraphic(postContGraphic);
  8. postContTab.setClosable(false);

代码示例来源:origin: com.aquafx-project/aquafx

  1. pages.setPreserveRatio(true);
  2. pages.setFitHeight(36);
  3. tab1.setGraphic(pages);
  4. Label label =new Label("Allgemein...");
  5. label.setPadding(new Insets(15));
  6. layout.setPreserveRatio(true);
  7. layout.setFitHeight(36);
  8. tab2.setGraphic(layout);
  9. Label label2 = new Label("Etiketten");
  10. label2.setPadding(new Insets(15));
  11. umbruch.setPreserveRatio(true);
  12. umbruch.setFitHeight(36);
  13. tab3.setGraphic(umbruch);
  14. Label label3 = new Label("seitenleiste...");
  15. label3.setPadding(new Insets(15));
  16. text.setPreserveRatio(true);
  17. text.setFitHeight(36);
  18. tab4.setGraphic(text);

代码示例来源:origin: com.aquafx-project/aquafx

  1. pages.setPreserveRatio(true);
  2. pages.setFitHeight(16);
  3. tab1.setGraphic(pages);
  4. Label label = new Label("Dokument...");
  5. label.setPadding(new Insets(15));
  6. layout.setPreserveRatio(true);
  7. layout.setFitHeight(16);
  8. tab2.setGraphic(layout);
  9. Label label2 = new Label("layout");
  10. label2.setPadding(new Insets(15));
  11. umbruch.setPreserveRatio(true);
  12. umbruch.setFitHeight(16);
  13. tab3.setGraphic(umbruch);
  14. Label label3 = new Label("Zeilenumbruch...");
  15. label3.setPadding(new Insets(15));
  16. text.setPreserveRatio(true);
  17. text.setFitHeight(16);
  18. tab4.setGraphic(text);
  19. Label label4 = new Label("Zeilenumbruch...");
  20. label4.setPadding(new Insets(15));
  21. grafik.setPreserveRatio(true);
  22. grafik.setFitHeight(16);
  23. tab5.setGraphic(grafik);
  24. Label label5 = new Label("Zeilenumbruch...");
  25. label5.setPadding(new Insets(15));

相关文章