本文整理汇总了Java中javafx.css.StyleableProperty类的典型用法代码示例。如果您正苦于以下问题:Java StyleableProperty类的具体用法?Java StyleableProperty怎么用?Java StyleableProperty使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StyleableProperty类属于javafx.css包,在下文中一共展示了StyleableProperty类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TxConfidenceIndicator
import javafx.css.StyleableProperty; //导入依赖的package包/类
/**
* Creates a new ProgressIndicator with the given progress value.
*/
@SuppressWarnings("unchecked")
public TxConfidenceIndicator(double progress) {
// focusTraversable is styleable through css. Calling setFocusTraversable
// makes it look to css like the user set the value and css will not
// override. Initializing focusTraversable by calling applyStyle with null
// StyleOrigin ensures that css will be able to override the value.
((StyleableProperty) focusTraversableProperty()).applyStyle(null, Boolean.FALSE);
setProgress(progress);
getStyleClass().setAll(DEFAULT_STYLE_CLASS);
// need to initialize pseudo-class state
final int c = Double.compare(INDETERMINATE_PROGRESS, progress);
pseudoClassStateChanged(PSEUDO_CLASS_INDETERMINATE, c == 0);
pseudoClassStateChanged(PSEUDO_CLASS_DETERMINATE, c != 0);
}
示例2: getStyleableProperty
import javafx.css.StyleableProperty; //导入依赖的package包/类
@Override
public StyleableProperty<T> getStyleableProperty(S styleable) {
Property<T> property = propertyExtractor.apply(styleable);
if (property instanceof StyleableProperty) {
// no need to wrap an already styleable property
return (StyleableProperty<T>) property;
} else {
return new SimpleStyleableObjectPropertyWrapper<>(this, property);
}
}
示例3: initialize
import javafx.css.StyleableProperty; //导入依赖的package包/类
default void initialize(String defaultStyle) {
T node = getNode();
node.getStyleClass()
.add(defaultStyle);
// focusTraversable is styleable through css. Calling setFocusTraversable
// makes it look to css like the user set the value and css will not
// override. Initializing focusTraversable by calling set on the
// CssMetaData ensures that css will be able to override the value.
@SuppressWarnings("unchecked")
StyleableProperty<Boolean> styleableProperty = (StyleableProperty<Boolean>) node.focusTraversableProperty();
styleableProperty.applyStyle(null, Boolean.TRUE);
/**
* Indicates whether or not this cell has focus. For example, a ListView
* defines zero or one cell as being the "focused" cell. This cell would
* have focused set to true.
*/
node.focusedProperty()
.addListener((InvalidationListener) property -> {
System.out.println(String.format("Setting focus: %s on %s",
node.isFocused(),
node.getClass()
.getSimpleName()));
node.pseudoClassStateChanged(PSEUDO_CLASS_FOCUSED,
node.isFocused()); // TODO is this necessary??
// The user has shifted focus, so we should cancel the editing on this cell
if (!node.isFocused() && isEditing()) {
cancelEdit();
}
});
// initialize default pseudo-class state
node.pseudoClassStateChanged(PSEUDO_CLASS_EMPTY, true);
}
示例4: getStyleableProperty
import javafx.css.StyleableProperty; //导入依赖的package包/类
@SuppressWarnings("unchecked") @Override public StyleableProperty<Boolean> getStyleableProperty(TextField n) {
Skin<?> skin = n.getSkin();
if (skin != null && skin instanceof AquaTextFieldSkin) {
return (StyleableProperty<Boolean>) ((AquaTextFieldSkin) skin).showSearchIconProperty();
}
return null;
}
示例5: getStyleableProperty
import javafx.css.StyleableProperty; //导入依赖的package包/类
@SuppressWarnings("unchecked") @Override public StyleableProperty<MacOSDefaultIcons> getStyleableProperty(Button n) {
Skin<?> skin = n.getSkin();
if (skin != null && skin instanceof AquaButtonSkin) {
return (StyleableProperty<MacOSDefaultIcons>) ((AquaButtonSkin) skin).iconProperty();
}
return null;
}
示例6: isSettable
import javafx.css.StyleableProperty; //导入依赖的package包/类
@Override
public boolean isSettable(S bean) {
StyleableProperty<?> property = CssRegistry.fetchProperty(bean, name);
if(property instanceof Property){
if(((Property<?>)property).isBound()){
return property == null;
}
}
return true;
}
示例7: registerProperty
import javafx.css.StyleableProperty; //导入依赖的package包/类
public static <S extends Styleable> void registerProperty(RegisteredCssDoubleProperty<S> property){
S bean = property.getBean();
String name = property.getName();
Map<String, StyleableProperty<?>> namedProperties = propertyMap.get(bean);
if(namedProperties == null){
namedProperties = new WeakHashMap<>();
propertyMap.put(bean, namedProperties);
}
namedProperties.put(name, property);
}
示例8: fetchProperty
import javafx.css.StyleableProperty; //导入依赖的package包/类
public static <V> StyleableProperty<V> fetchProperty(Styleable bean, String name){
Map<String, StyleableProperty<?>> namedProperties = propertyMap.get(bean);
if(namedProperties == null){
return null;
}
return (StyleableProperty<V>)namedProperties.get(name);
}
示例9: getStyleableProperty
import javafx.css.StyleableProperty; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public StyleableProperty<Number> getStyleableProperty(AllDayView n) {
return (StyleableProperty<Number>) n.rowHeightProperty();
}
示例10: getStyleableProperty
import javafx.css.StyleableProperty; //导入依赖的package包/类
@Override
public StyleableProperty<Boolean> getStyleableProperty(Pagination n) {
final CPagenationSkin skin = (CPagenationSkin) n.getSkin();
return (StyleableProperty<Boolean>) (WritableValue<Boolean>) skin.arrowsVisibleProperty();
}
示例11: hgapProperty
import javafx.css.StyleableProperty; //导入依赖的package包/类
public StyleableProperty<Number> hgapProperty() {
return hgap;
}
示例12: vgapProperty
import javafx.css.StyleableProperty; //导入依赖的package包/类
public StyleableProperty<Number> vgapProperty() {
return vgap;
}
示例13: getStyleableProperty
import javafx.css.StyleableProperty; //导入依赖的package包/类
@Override
public StyleableProperty<Number> getStyleableProperty(SpecialButton node) {
return (StyleableProperty) node.minSizeProperty();
}
示例14: getStyleableProperty
import javafx.css.StyleableProperty; //导入依赖的package包/类
@Override
public StyleableProperty<IconCode> getStyleableProperty(IconNode styleable) {
return styleable.iconCodeProperty();
}
示例15: getStyleableProperty
import javafx.css.StyleableProperty; //导入依赖的package包/类
@Override
public StyleableProperty<Paint> getStyleableProperty(final GraphEditorGrid node) {
return node.gridColor;
}