當前位置: 首頁>>代碼示例>>Java>>正文


Java Styleable類代碼示例

本文整理匯總了Java中javafx.css.Styleable的典型用法代碼示例。如果您正苦於以下問題:Java Styleable類的具體用法?Java Styleable怎麽用?Java Styleable使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Styleable類屬於javafx.css包,在下文中一共展示了Styleable類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getCssValue

import javafx.css.Styleable; //導入依賴的package包/類
@Override public String getCssValue(String propertyName) {
    List<CssMetaData<? extends Styleable, ?>> cssMetaData = node.getCssMetaData();
    if (propertyName.equals("all")) {
        return cssMetaData.toString();
    }
    for (CssMetaData<? extends Styleable, ?> cssMetaData2 : cssMetaData) {
        if (cssMetaData2.getProperty().equals(propertyName)) {
            Object initialValue = cssMetaData2.getInitialValue(null);
            if (initialValue != null) {
                return initialValue.toString();
            }
            return null;
        }
    }
    return null;
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:17,代碼來源:JavaFXElement.java

示例2: WeatherSymbol

import javafx.css.Styleable; //導入依賴的package包/類
public WeatherSymbol(final ConditionAndIcon CONDITION, final double SIZE, final Color COLOR) {
    condition   = new ObjectPropertyBase<ConditionAndIcon>(null == CONDITION ? ConditionAndIcon.NONE : CONDITION) {
        @Override protected void invalidated() {
            conditionIcon.setId(get().styleClass);
            resize();
        }
        @Override public Object getBean() { return WeatherSymbol.this; }
        @Override public String getName() { return "condition"; }
    };
    symbolColor = new StyleableObjectProperty<Color>(null == COLOR ? Tile.FOREGROUND : COLOR) {
        @Override public Object getBean() { return WeatherSymbol.this; }
        @Override public String getName() { return "symbolColor"; }
        @Override public CssMetaData<? extends Styleable, Color> getCssMetaData() { return SYMBOL_COLOR; }
    };
    size        = SIZE;
    initGraphics();
    registerListeners();
}
 
開發者ID:HanSolo,項目名稱:tilesfx,代碼行數:19,代碼來源:WeatherSymbol.java

示例3: Card

import javafx.css.Styleable; //導入依賴的package包/類
public Card(final String TITLE) {
    getStylesheets().add(Card.class.getResource("card.css").toExternalForm());
    cardColor  = new StyleableObjectProperty<Color>(Color.web("#dae18f")) {
        @Override protected void invalidated() { container.setBackground(new Background(new BackgroundFill(get(), CornerRadii.EMPTY, Insets.EMPTY))); }
        @Override public Object getBean() { return Card.this; }
        @Override public String getName() { return "cardColor"; }
        @Override public CssMetaData<? extends Styleable, Color> getCssMetaData() { return CARD_COLOR; }
    };
    titleColor = new StyleableObjectProperty<Color>(Color.BLACK) {
        @Override protected void invalidated() { titleText.setTextFill(get()); }
        @Override public Object getBean() { return Card.this; }
        @Override public String getName() { return "titleColor"; }
        @Override public CssMetaData<? extends Styleable, Color> getCssMetaData() { return TITLE_COLOR; }
    };
    title      = new StringPropertyBase(TITLE) {
        @Override protected void invalidated() { titleText.setText(get()); }
        @Override public Object getBean() { return Card.this; }
        @Override public String getName() { return "title"; }
    };
    init();
    initGraphics();
    registerListeners();
}
 
開發者ID:HanSolo,項目名稱:cardnav,代碼行數:24,代碼來源:Card.java

示例4: iconCodeProperty

import javafx.css.Styleable; //導入依賴的package包/類
public StyleableObjectProperty<IconCode> iconCodeProperty() {
    if (iconCode == null) {
        iconCode = new StyleableObjectProperty<IconCode>() {
            @Override
            public Object getBean() {
                return IconNode.this;
            }

            @Override
            public String getName() {
                return "iconCode";
            }

            @Override
            public CssMetaData<? extends Styleable, IconCode> getCssMetaData() {
                return IconNode.ICON_CODE_META_DATA;
            }
        };
    }
    return iconCode;
}
 
開發者ID:jIconFont,項目名稱:jiconfont-javafx,代碼行數:22,代碼來源:IconNode.java

示例5: iconSizeProperty

import javafx.css.Styleable; //導入依賴的package包/類
public ObjectProperty<Number> iconSizeProperty() {
    if (iconSize == null) {
        iconSize = new StyleableObjectProperty<Number>(18) {
            @Override
            public Object getBean() {
                return IconNode.this;
            }

            @Override
            public String getName() {
                return "iconSize";
            }

            @Override
            public CssMetaData<? extends Styleable, Number> getCssMetaData() {
                return IconNode.ICON_SIZE_META_DATA;
            }
        };
    }
    return iconSize;
}
 
開發者ID:jIconFont,項目名稱:jiconfont-javafx,代碼行數:22,代碼來源:IconNode.java

示例6: createStyleableDoubleProperty

import javafx.css.Styleable; //導入依賴的package包/類
public static StyleableDoubleProperty createStyleableDoubleProperty(Object bean, String name, CssMetaData<? extends Styleable, Number> cssMetadata) {
    return new StyleableDoubleProperty() {
        @Override
        public Object getBean() {
            return bean;
        }


        @Override
        public String getName() {
            return name;
        }


        @Override
        public CssMetaData<? extends Styleable, Number> getCssMetaData() {
            return cssMetadata;
        }
    };
}
 
開發者ID:dejv78,項目名稱:j.commons,代碼行數:21,代碼來源:CssHelper.java

示例7: createStyleableObjectProperty

import javafx.css.Styleable; //導入依賴的package包/類
public static <T> StyleableObjectProperty<T> createStyleableObjectProperty(Object bean, String name, CssMetaData<? extends Styleable, T> cssMetadata) {
    return new StyleableObjectProperty<T>() {
        @Override
        public Object getBean() {
            return bean;
        }


        @Override
        public String getName() {
            return name;
        }


        @Override
        public CssMetaData<? extends Styleable, T> getCssMetaData() {
            return cssMetadata;
        }
    };
}
 
開發者ID:dejv78,項目名稱:j.commons,代碼行數:21,代碼來源:CssHelper.java

示例8: iconProperty

import javafx.css.Styleable; //導入依賴的package包/類
public ObjectProperty<FontIcon> iconProperty() {
    if (icon == null) {
        icon = new StyleableObjectProperty<FontIcon>() {
            @Override
            public Object getBean() {
                return FontIconView.this;
            }

            @Override
            public String getName() {
                return "icon";
            }

            @Override
            public CssMetaData<? extends Styleable, FontIcon> getCssMetaData() {
                return null;
            }
        };
    }
    return icon;
}
 
開發者ID:guigarage,項目名稱:IconFontFX,代碼行數:22,代碼來源:FontIconView.java

示例9: iconProperty

import javafx.css.Styleable; //導入依賴的package包/類
public final ObjectProperty<MacOSDefaultIcons> iconProperty() {
    if (icon == null) {
        icon = new StyleableObjectProperty<MacOSDefaultIcons>() {

            @Override public CssMetaData<? extends Styleable, MacOSDefaultIcons> getCssMetaData() {
                return StyleableProperties.ICON;
            }

            @Override public Object getBean() {
                return AquaButtonSkin.this;
            }

            @Override public String getName() {
                return "icon";
            }
        };
    }
    return icon;
}
 
開發者ID:cis422s14team5,項目名稱:WatchlistPro,代碼行數:20,代碼來源:AquaButtonSkin.java

示例10: sort

import javafx.css.Styleable; //導入依賴的package包/類
protected void sort(CList<CssMetaData<? extends Styleable,?>> list)
{
	if(sorter == null)
	{
		sorter = new CComparator<CssMetaData<? extends Styleable,?>>()
		{
			public int compare(CssMetaData<? extends Styleable,?> a, CssMetaData<? extends Styleable,?> b)
			{
				return compareAsStrings(a.getProperty(), b.getProperty());
			}
		};
	}
	
	sorter.sort(list);
}
 
開發者ID:andy-goryachev,項目名稱:FxEditor,代碼行數:16,代碼來源:FxDump.java

示例11: getStyles

import javafx.css.Styleable; //導入依賴的package包/類
public static Set<Style> getStyles(ControlPage controlPage, boolean isUsingSetter) {

        Set<Style> list = new TreeSet<Style>();
        List<CssMetaData<? extends Styleable, ?>> controlKeys = getAllKeys(controlPage.keys);
        List<CssMetaData<? extends Styleable, ?>> regionKeys = getAllKeys(Region.getClassCssMetaData());

        Set<CssMetaData> uniqKeys = new HashSet<CssMetaData>(controlKeys); //makes unique keys
        try {
            if (controlPage.factory.createControl() instanceof Control) {
                uniqKeys.addAll(regionKeys);
            }
        } catch (Exception exc) {
            // ignore, this exception only web view , "Not on FX application thread" when code generate
        }
        for (CssMetaData key : uniqKeys) {
            CssStyle[] styles = props2Impls.get(key.getProperty());
            if (styles == null) {
                StyleGenerator.addKey(key); //for map of styles generating
            } else {
                for (CssStyle style : styles) {
                    if (isUsingSetter) {
                        if (style.hasSetter()) {
                            list.add(style);
                        }
                    } else {
                        list.add(style);
                    }
                }
            }
        }
        return list;
    }
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:33,代碼來源:ControlsCssStylesFactory.java

示例12: getAllKeys

import javafx.css.Styleable; //導入依賴的package包/類
private static List<CssMetaData<? extends Styleable, ?>> getAllKeys(List<CssMetaData<? extends Styleable, ?>> props) {
    List<CssMetaData<? extends Styleable, ?>> result = new ArrayList<CssMetaData<? extends Styleable, ?>>(props.size());
    for (CssMetaData key : props) {
        result.addAll(getSubKeys(key));
    }
    return result;

}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:9,代碼來源:ControlsCssStylesFactory.java

示例13: getSubKeys

import javafx.css.Styleable; //導入依賴的package包/類
private static List<CssMetaData<? extends Styleable, ?>> getSubKeys(CssMetaData rootKey) {
    List<CssMetaData<? extends Styleable, ?>> keys = new ArrayList<CssMetaData<? extends Styleable, ?>>();
    keys.add(rootKey);
    List<CssMetaData<? extends Styleable, ?>> subkeys = rootKey.getSubProperties();
    if (subkeys != null) {
        for (CssMetaData subkey : subkeys) {
            keys.addAll(getSubKeys(subkey));
        }
    }
    return keys;
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:12,代碼來源:ControlsCssStylesFactory.java

示例14: getStyleNames

import javafx.css.Styleable; //導入依賴的package包/類
protected Set<String> getStyleNames() {
    List<CssMetaData<? extends Styleable, ?>> stylesList = getListWithSubProperty(getControl().getCssMetaData());
    Set<String> styles = new TreeSet<>();
    for (CssMetaData data : stylesList) {
        styles.add(data.getProperty());
    }
    return styles;
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:9,代碼來源:BaseStyleNodeTest.java

示例15: getListWithSubProperty

import javafx.css.Styleable; //導入依賴的package包/類
private List<CssMetaData<? extends Styleable, ?>> getListWithSubProperty(List<CssMetaData<? extends Styleable, ?>> list) {
    ArrayList<CssMetaData<? extends Styleable, ?>> newList = new ArrayList<>(list);
    for (CssMetaData data : list) {
        List<CssMetaData<? extends Styleable, ?>> sub = data.getSubProperties();
        if (sub != null && sub.size() > 0) {
            newList.addAll(getListWithSubProperty(sub));
        }
    }
    return newList;
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:11,代碼來源:BaseStyleNodeTest.java


注:本文中的javafx.css.Styleable類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。