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

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

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

Tab.getGraphic介绍

暂无

代码示例

代码示例来源:origin: jfoenixadmin/JFoenix

tabLabel.setText(tab.getText());
} else if ("GRAPHIC".equals(p)) {
  tabLabel.setGraphic(tab.getGraphic());
} else if ("TOOLTIP".equals(p)) {

代码示例来源:origin: jfoenixadmin/JFoenix

setStyle(tab.getStyle());
tabLabel = new Label(tab.getText(), tab.getGraphic());
tabLabel.getStyleClass().setAll("tab-label");

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

@Override public void run() {
    for (Tab tab : tabPane.getTabs()) {
      if (tab.getGraphic() != null) {
        tab.getGraphic().getStyleClass().add("icon");
      }
    }
  }
});

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

/**
 * Makes the specified tab draggable. It can be dragged to a {@link TabPane} set up by {@link #makeDroppable(TabPane)}.
 * setOnDragDetected on the tab's graphic is called to handle the event.
 */
public static void makeDraggable( final Tab tab ) {
  tab.getGraphic().setOnDragDetected( new EventHandler<MouseEvent>() {
    @Override
    public void handle( MouseEvent event ) {
      Dragboard dragboard = tab.getGraphic().startDragAndDrop( TransferMode.MOVE );
      ClipboardContent clipboardContent = new ClipboardContent();
      clipboardContent.put( TAB_TYPE, 1 );
      dndTab = new WeakReference<>( tab );
      dragboard.setContent( clipboardContent );
      event.consume();
    }
  } );
}

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

@Override
  public void handle( MouseEvent event ) {
    Dragboard dragboard = tab.getGraphic().startDragAndDrop( TransferMode.MOVE );
    ClipboardContent clipboardContent = new ClipboardContent();
    clipboardContent.put( TAB_TYPE, 1 );
    dndTab = new WeakReference<>( tab );
    dragboard.setContent( clipboardContent );
    event.consume();
  }
} );

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

/**
 * set the color of the graphic of the given tab
 *
 * @param tab
 *          - the tab to change
 * @param oldColor
 *          - the old color
 * @param newColor
 *          - the new color
 */
protected void setColor(Tab tab, Color oldColor, Color newColor) {
 if (debug)
  LOGGER.log(Level.INFO, "changing  tab color for " + tab.getId() + " from "
    + oldColor + " to " + newColor);
 Node graphic = tab.getGraphic();
 if (graphic instanceof Glyph) {
  Glyph glyph = (Glyph) graphic;
  glyph.setColor(newColor);
 } else if (graphic instanceof ImageView) {
  // https://docs.oracle.com/javafx/2/image_ops/jfxpub-image_ops.htm
  ImageView imageView = (ImageView) graphic;
  imageView.setImage(reColor(imageView.getImage(), oldColor, newColor));
 }
}

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

if (tab.getGraphic() == null) {
 tab.setText(title);

代码示例来源:origin: com.jfoenix/jfoenix

setStyle(tab.getStyle());
tabLabel = new Label(tab.getText(), tab.getGraphic());
tabLabel.getStyleClass().setAll("tab-label");
});
listener.registerChangeListener(tab.textProperty(), obs-> tabLabel.setText(tab.getText()));
listener.registerChangeListener(tab.graphicProperty(), obs-> tabLabel.setGraphic(tab.getGraphic()));
listener.registerChangeListener(widthProperty(), obs-> header.updateSelectionLine(true));
listener.registerChangeListener(tab.tooltipProperty(), obs->{

相关文章