本文整理汇总了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);
}
}
示例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;
}
}
示例3: getInstance
import javafx.css.StyleConverter; //导入依赖的package包/类
public static StyleConverter<String, IconCode> getInstance() {
return Holder.INSTANCE;
}
示例4: getInstance
import javafx.css.StyleConverter; //导入依赖的package包/类
public static StyleConverter<String, RipplerMask> getInstance() {
return Holder.INSTANCE;
}
示例5: getInstance
import javafx.css.StyleConverter; //导入依赖的package包/类
public static StyleConverter<String, IndicatorPosition> getInstance() {
return Holder.INSTANCE;
}
示例6: getInstance
import javafx.css.StyleConverter; //导入依赖的package包/类
public static StyleConverter<String, DialogTransition> getInstance() {
return Holder.INSTANCE;
}
示例7: getInstance
import javafx.css.StyleConverter; //导入依赖的package包/类
public static StyleConverter<String, ButtonType> getInstance() {
return Holder.INSTANCE;
}
示例8: getInstance
import javafx.css.StyleConverter; //导入依赖的package包/类
public static StyleConverter<String, MacOSDefaultIcons> getInstance() {
return Holder.ICON_INSTANCE;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}