当前位置: 首页>>代码示例>>Java>>正文


Java StyleConverter类代码示例

本文整理汇总了Java中javafx.css.StyleConverter的典型用法代码示例。如果您正苦于以下问题:Java StyleConverter类的具体用法?Java StyleConverter怎么用?Java StyleConverter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: SizeConverter_SequenceConverter_getInstance

import javafx.css.StyleConverter; //导入依赖的package包/类
/**
 * Java 8:  com.sun.javafx.css.converters.SizeConverter.SequenceConverter.getInstance()
 * Java 9+: javafx.css.converter.SizeConverter.SequenceConverter.getInstance()
 */
@SuppressWarnings("unchecked")
static StyleConverter<?, Number[]> SizeConverter_SequenceConverter_getInstance() {
    try {
        if (mSizeConverter_SequenceConverter_getInstance == null) {
            Class<?> c = Class.forName(isJava9orLater
                    ? "javafx.css.converter.SizeConverter$SequenceConverter"
                    : "com.sun.javafx.css.converters.SizeConverter$SequenceConverter");
            mSizeConverter_SequenceConverter_getInstance = c.getMethod("getInstance");
        }
        return (StyleConverter<?, Number[]>) mSizeConverter_SequenceConverter_getInstance.invoke(null);
    } catch (ClassNotFoundException | NoSuchMethodException | SecurityException |
            IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
        e.printStackTrace();
        throw new Error(e);
    }
}
 
开发者ID:FXMisc,项目名称:RichTextFX,代码行数:21,代码来源:JavaFXCompatibility.java

示例2: getValueByType

import javafx.css.StyleConverter; //导入依赖的package包/类
static String getValueByType(StyleConverter type) {
    if (type instanceof BooleanConverter) {
        return "true";
    } else if (type instanceof ColorConverter) {
        return "red";
    } else if (type instanceof SizeConverter) {
        return "40";
    } else if (type instanceof StringConverter) {
        return "Just text";
    } else if (type instanceof InsetsConverter || type.toString().equals("InsetsSequenceConverter") || type.toString().equals("MarginsSequenceConverter")) {
        return "10 5 30 15";
    //} else if (type instanceof BackgroundFillConverter) {
    //    return "linear (0%,0%) to (100%,100%) stops (0.0,yellow) (1.0,red)";
    } else if (type instanceof PaintConverter) {
        return "green , linear (0%,0%) to (100%,100%) stops (0.0,yellow) (1.0,red)";
    //} else if (type instanceof StrokeBorderConverter) {
    //    return "round";
    //} else if (type instanceof LayeredBorderPaintConverter) {
    //    return "green blue yellow red";
    } else if (type instanceof FontConverter) {
        return "15 cursive bolder";
    } else if (type instanceof EnumConverter) {
        return "TODO type " + type.toString();
    } else if (type instanceof PaintConverter) {
        return "ladder black stops (0.49, white) (0.5, black)";
    //} else if (type instanceof URLConverter || type instanceof BackgroundImageConverter || type instanceof BorderImageConverter || type.toString().equals("URLSeqType")) {
    //    return "url(\\\"file:javafx/scene/control/test/css/resources/car.png\\\")";
    } else if (type instanceof CursorConverter) {
        return "crosshair";
    } else {
        return null;
    }
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:34,代码来源:StyleGenerator.java

示例3: getInstance

import javafx.css.StyleConverter; //导入依赖的package包/类
public static StyleConverter<String, IconCode> getInstance() {
    return Holder.INSTANCE;
}
 
开发者ID:jIconFont,项目名称:jiconfont-javafx,代码行数:4,代码来源:IconCodeConverter.java

示例4: getInstance

import javafx.css.StyleConverter; //导入依赖的package包/类
public static StyleConverter<String, RipplerMask> getInstance() {
    return Holder.INSTANCE;
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:4,代码来源:RipplerMaskTypeConverter.java

示例5: getInstance

import javafx.css.StyleConverter; //导入依赖的package包/类
public static StyleConverter<String, IndicatorPosition> getInstance() {
    return Holder.INSTANCE;
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:4,代码来源:IndicatorPositionConverter.java

示例6: getInstance

import javafx.css.StyleConverter; //导入依赖的package包/类
public static StyleConverter<String, DialogTransition> getInstance() {
    return Holder.INSTANCE;
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:4,代码来源:DialogTransitionConverter.java

示例7: getInstance

import javafx.css.StyleConverter; //导入依赖的package包/类
public static StyleConverter<String, ButtonType> getInstance() {
    return Holder.INSTANCE;
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:4,代码来源:ButtonTypeConverter.java

示例8: getInstance

import javafx.css.StyleConverter; //导入依赖的package包/类
public static StyleConverter<String, MacOSDefaultIcons> getInstance() {
    return Holder.ICON_INSTANCE;
}
 
开发者ID:cis422s14team5,项目名称:WatchlistPro,代码行数:4,代码来源:MacOSDefaultIconConverter.java

示例9: CustomCssMetaData

import javafx.css.StyleConverter; //导入依赖的package包/类
CustomCssMetaData(String property, StyleConverter<?, V> converter, V initialValue,
                  Function<S, StyleableObjectProperty<V>> getStyleableProperty) {
    super(property, converter, initialValue);
    this.property = getStyleableProperty;
}
 
开发者ID:FXMisc,项目名称:RichTextFX,代码行数:6,代码来源:CustomCssMetaData.java

示例10: RegisteredCssMetaData

import javafx.css.StyleConverter; //导入依赖的package包/类
public RegisteredCssMetaData(String property, StyleConverter<?, V> converter, Class<S> beanClass, String name) {
	super(property, converter);
	this.name = name;
	CssRegistry.registerMetaData(beanClass, this, name);
}
 
开发者ID:jackmoxley,项目名称:Moxy-Parser,代码行数:6,代码来源:RegisteredCssMetaData.java

示例11: SimpleCssMetaData

import javafx.css.StyleConverter; //导入依赖的package包/类
/**
 * Creates a new simple CSS metadata object.
 *
 * @param property          the CSS property descriptor, eg {@code "-fx-background-color"}
 * @param converter         the style converter
 * @param propertyExtractor the function to use to get the property this metadata should describe
 */
public SimpleCssMetaData(String property,
                         StyleConverter<?, T> converter,
                         Function<? super S, Property<T>> propertyExtractor) {
  super(property, converter);
  this.propertyExtractor = propertyExtractor;
}
 
开发者ID:wpilibsuite,项目名称:shuffleboard,代码行数:14,代码来源:SimpleCssMetaData.java

示例12: SimpleColorCssMetaData

import javafx.css.StyleConverter; //导入依赖的package包/类
/**
 * Creates a new simple color CSS metadata object.
 *
 * @param property          the CSS property descriptor, eg {@code "-fx-background-color"}
 * @param propertyExtractor gets the color property this metadata should describe
 */
public SimpleColorCssMetaData(String property, Function<? super S, Property<Color>> propertyExtractor) {
  super(property, StyleConverter.getColorConverter(), propertyExtractor);
}
 
开发者ID:wpilibsuite,项目名称:shuffleboard,代码行数:10,代码来源:SimpleColorCssMetaData.java


注:本文中的javafx.css.StyleConverter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。