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


Java StyleableProperty类代码示例

本文整理汇总了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);
}
 
开发者ID:bisq-network,项目名称:exchange,代码行数:19,代码来源:TxConfidenceIndicator.java

示例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);
  }
}
 
开发者ID:wpilibsuite,项目名称:shuffleboard,代码行数:11,代码来源:SimpleCssMetaData.java

示例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);
}
 
开发者ID:ChiralBehaviors,项目名称:Kramer,代码行数:37,代码来源:LayoutCell.java

示例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;
}
 
开发者ID:cis422s14team5,项目名称:WatchlistPro,代码行数:8,代码来源:AquaTextFieldSkin.java

示例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;
}
 
开发者ID:cis422s14team5,项目名称:WatchlistPro,代码行数:8,代码来源:AquaButtonSkin.java

示例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;
}
 
开发者ID:jackmoxley,项目名称:Moxy-Parser,代码行数:11,代码来源:RegisteredCssMetaData.java

示例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);
}
 
开发者ID:jackmoxley,项目名称:Moxy-Parser,代码行数:11,代码来源:CssRegistry.java

示例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);
}
 
开发者ID:jackmoxley,项目名称:Moxy-Parser,代码行数:8,代码来源:CssRegistry.java

示例9: getStyleableProperty

import javafx.css.StyleableProperty; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public StyleableProperty<Number> getStyleableProperty(AllDayView n) {
    return (StyleableProperty<Number>) n.rowHeightProperty();
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:6,代码来源:AllDayView.java

示例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();
}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:6,代码来源:CPagenationSkin.java

示例11: hgapProperty

import javafx.css.StyleableProperty; //导入依赖的package包/类
public StyleableProperty<Number> hgapProperty() {
	return hgap;
}
 
开发者ID:edvin,项目名称:tornadofx-controls,代码行数:4,代码来源:MultiSelect.java

示例12: vgapProperty

import javafx.css.StyleableProperty; //导入依赖的package包/类
public StyleableProperty<Number> vgapProperty() {
	return vgap;
}
 
开发者ID:edvin,项目名称:tornadofx-controls,代码行数:4,代码来源:MultiSelect.java

示例13: getStyleableProperty

import javafx.css.StyleableProperty; //导入依赖的package包/类
@Override
public StyleableProperty<Number> getStyleableProperty(SpecialButton node) {
    return (StyleableProperty) node.minSizeProperty();
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:5,代码来源:CustomStyleApp.java

示例14: getStyleableProperty

import javafx.css.StyleableProperty; //导入依赖的package包/类
@Override
public StyleableProperty<IconCode> getStyleableProperty(IconNode styleable) {
    return styleable.iconCodeProperty();
}
 
开发者ID:jIconFont,项目名称:jiconfont-javafx,代码行数:5,代码来源:IconNode.java

示例15: getStyleableProperty

import javafx.css.StyleableProperty; //导入依赖的package包/类
@Override
public StyleableProperty<Paint> getStyleableProperty(final GraphEditorGrid node) {
    return node.gridColor;
}
 
开发者ID:Heverton,项目名称:grapheditor,代码行数:5,代码来源:GraphEditorGrid.java


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