javafx.scene.text.Text.setStyle()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(123)

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

Text.setStyle介绍

暂无

代码示例

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

public Text createIcon(GlyphIcons icon, String iconSize) {
  Text text = new Text(icon.characterToString());
  text.getStyleClass().add("glyph-icon");
  text.setStyle(String.format("-fx-font-family: %s; -fx-font-size: %s;", icon.getFontFamily(), iconSize));
  return text;
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

/**
 * Constructor
 */
public ErrorPane() {
 rootContainer.setStyle("-fx-background-color: white; " + "-fx-alignment:CENTER;");
 getChildren().add(rootContainer);
 NodeHelper.setHVGrow(rootContainer);
 iconContainer.getChildren().add(icon);
 iconContainer.setStyle("-fx-background-color:white;" + "-fx-alignment:CENTER_LEFT;" + "-icons-color:red");
 label.setText("Oups, error occurs when laoding data :-(.\nIf the problem persist, please contact you admin.");
 label.setStyle("-fx-font-family:'Robotom Medium'; " + "-fx-font-size: 1.4em;" + "-fx-fill:-text-color-900;");
 rootContainer.getChildren().addAll(iconContainer, label, NodeHelper.horizontalSpacer());
}

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

public BadgeCount(int count) {
  text = new Text(Integer.toString(count));
  text.setStyle("-fx-fill: white");
  double height = text.getBoundsInLocal().getHeight();
  double width = Math.max(text.getBoundsInLocal().getWidth(), height);
  double x = getLayoutX() + getWidth() / 2;
  double y = getLayoutY() + getHeight() / 2;
  r1 = new Rectangle(x, y, width * 1.3, height * 1.3);
  r1.setFill(Color.WHITE);
  r1.setArcHeight(15);
  r1.setArcWidth(15);
  r2 = new Rectangle(x, y, width * 1.2, height * 1.2);
  r2.setFill(Color.RED);
  r2.setArcHeight(15);
  r2.setArcWidth(15);
  getChildren().addAll(r1, r2, text);
}

代码示例来源:origin: org.jfxtras/jfxtras-common

label.setStyle("-fx-fill:RED; -fx-effect: dropshadow(gaussian, WHITE, 3,1.0, 0,0);");
label.setManaged(false);
label.setLayoutX(3.0);

相关文章