本文整理匯總了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;
}
示例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();
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
};
}
示例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;
}
};
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}