Java FontWeight.findByName方法代码示例(javafontweight.findbyname方法的典型用法代码示例)

本文整理汇总了Java中javafx.scene.text.FontWeight.findByName方法的典型用法代码示例。如果您正苦于以下问题:Java FontWeight.findByName方法的具体用法?Java FontWeight.findByName怎么用?Java FontWeight.findByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.text.FontWeight的用法示例。


Java FontWeight.findByName方法代码示例(javafontweight.findbyname方法的典型用法代码示例)

在下文中一共展示了FontWeight.findByName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: init

import javafx.scene.text.FontWeight; //导入方法依赖的package包/类
private void init() {
    val map = super.getMap();
    map.put("family", new StringValue(font.getFamily()));
    map.put("isItalic", NumberValue.fromBoolean(font.getStyle().toLowerCase().contains("italic")));
    val weight = FontWeight.findByName(font.getStyle());
    map.put("weight", NumberValue.of(weight != null
            ? (weight.getWeight())
            : FontWeight.NORMAL.getWeight()));
    map.put("size", NumberValue.of(font.getSize()));
} 
开发者ID:aNNiMON,项目名称:HotaruFX,代码行数:11,代码来源:FontValue.java

示例2: extractWeight

import javafx.scene.text.FontWeight; //导入方法依赖的package包/类
private static FontWeight extractWeight(String style) {
    for (String styleWord : style.split("\\s")) {
        FontWeight weight = FontWeight.findByName(styleWord);
        if (weight != null && weight != FontWeight.NORMAL) {
            return weight;
        }
    }
    return FontWeight.NORMAL;
} 
开发者ID:joffrey-bion,项目名称:fx-gson,代码行数:10,代码来源:FontTypeAdapter.java

示例3: testFont

import javafx.scene.text.FontWeight; //导入方法依赖的package包/类
@Theory
public void testFont(@FromDataPoints("extra") Gson gson) {
    String family = "SansSerif";
    FontWeight weight = FontWeight.findByName("Regular");
    double size = 11.0;
    Font font = Font.font(family, weight, size);

    Function<WithFont, Font> getter = o -> o.font;
    BiConsumer<WithFont, Font> setter = (o, f) -> o.font = f;

    testValue(WithFont.class, null, "{\"font\":null}", getter, setter, gson);
    testValue(WithFont.class, font, "{\"font\":\"SansSerif,Regular,11.0\"}", getter, setter, gson);
} 
开发者ID:joffrey-bion,项目名称:fx-gson,代码行数:14,代码来源:FxGsonTest.java

示例4: testFontProperty

import javafx.scene.text.FontWeight; //导入方法依赖的package包/类
@Theory
public void testFontProperty(@FromDataPoints("extra") Gson gson) {
    String family = "SansSerif";
    FontWeight weight = FontWeight.findByName("Regular");
    double size = 11.0;
    Font font = Font.font(family, weight, size);

    testProperty(WithFontProp.class, null, "{\"prop\":null}", o -> o.prop, gson);
    testProperty(WithFontProp.class, font, "{\"prop\":\"SansSerif,Regular,11.0\"}", o -> o.prop, gson);
} 
开发者ID:joffrey-bion,项目名称:fx-gson,代码行数:11,代码来源:FxGsonTest.java

示例5: FontStyle

import javafx.scene.text.FontWeight; //导入方法依赖的package包/类
public FontStyle(String styles) {
	this();
	String[] fontStyles = (styles == null ? "" : styles.trim().toUpperCase()).split(" "); //$NON-NLS-1$ //$NON-NLS-2$
	for (String style : fontStyles) {
		FontWeight w = FontWeight.findByName(style);
		if (w != null) {
			weight = w;
		} else {
			FontPosture p = FontPosture.findByName(style);
			if (p != null)
				posture = p;
		}
	}
} 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:15,代码来源:FontViewComposite.java

本文标签属性:

示例:示例英文

代码:代码大全可复制

java:java模拟器

FontWeight:fontweight600

findByName:findByName

上一篇:红柳是什么植物(红柳是什么植物)(红柳是什么植物,)
下一篇:Java Backend.clearStorage方法代码示例

为您推荐