ParsedValue<F,T>
from type F to type T. The
CssMetaData API requires a StyleConverter which is used
when computing a value for the StyleableProperty. There are
a number of predefined converters which are accessible by the static
methods of this class.
F is the type of the parsed value and T is the converted type of
the ParsedValueImpl. For example, a converter from String to Color would
be declared
public Color convert(ParsedValueImpl<String,Color> value, Font font)
ParsedValue, StyleableProperty
| Modifier and Type | Class and Description |
|---|---|
| public static class | StyleConverter.
The StringStore class. |
| Modifier and Type | Field and Description |
|---|---|
| private static Map | |
| private static Map |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | cacheValue(ParsedValue<V, T>
the key key, Object the value value)Cache the value for the specified key. |
| public static void | |
| public T | Returns: the converted target property typeThe value, Font font)ParsedValue to convertConvert from the parsed CSS value to the target property type. |
| public T | Returns: the target property typethe constituent values convertedValues)Convert from the constituent values to the target property type. |
| public static StyleConverter | Returns: AStyleConverter that converts "true" or "false" to BooleanReturn a |
| protected T | Returns: the cached valuethe key key)Get the cached value for the specified key. |
| public static StyleConverter | Returns: AStyleConverter that converts a String
representation of a web color to a ColorReturn a |
| public static StyleConverter | getDurationConverter()
Return a |
| public static StyleConverter | Returns: AStyleConverter that converts a parsed representation
of an Effect to an EffectReturn a |
| public static < the type of the E extends EnumEnum | Returns: AStyleConverter that converts a String representation
of an Enum to an Enumthe enum Class enumClass)Return a |
| public static StyleConverter | Returns: AStyleConverter that converts a parsed representation
of a Font to an FontReturn a |
| public static StyleConverter | Returns: AStyleConverter that converts a [<length> |
<percentage>]{1,4} to an InsetsReturn a |
| pack-priv static StyleConverter | |
| public static StyleConverter | Returns: AStyleConverter that converts a parsed representation
of a Paint to a PaintReturn a |
| public static StyleConverter | Returns: AStyleConverter that converts a parsed representation
of a CSS length or number value to a Number that is an instance
of DoubleCSS length and number values are parsed into a Size object that is converted to a Number before the value is applied. |
| public static StyleConverter | Returns: AStyleConverter that converts a representation of a
CSS string value to a StringA converter for quoted strings which may have embedded unicode characters. |
| public static StyleConverter | Returns: AStyleConverter that converts a representation of a
CSS URL value to a StringA converter for URL strings. |
| public static StyleConverter | Returns: the style converterthe data input stream is, String[] the strings strings)Read binary data stream. |
| public void | writeBinary(DataOutputStream
the data output stream os, StyleConverter.the string store sstoreWrite binary data. |
| cache | back to summary |
|---|---|
| private static Map<ParsedValue<V, T>, Object> cache | |
| tmap | back to summary |
|---|---|
| private static Map<String, StyleConverter<?, ?>> tmap | |
| StyleConverter | back to summary |
|---|---|
| public StyleConverter() Creates a | |
| cacheValue | back to summary |
|---|---|
| protected void cacheValue(ParsedValue<V, T> key, Object value) Cache the value for the specified key.
| |
| clearCache | back to summary |
|---|---|
| public static void clearCache() Clear the cache.
| |
| convert | back to summary |
|---|---|
| public T convert(ParsedValue<F, T> value, Font font) Convert from the parsed CSS value to the target property type.
| |
| convert | back to summary |
|---|---|
| public T convert(Map<CssMetaData<? extends Styleable, ?>, Object> convertedValues) Convert from the constituent values to the target property type. Implemented by Types that have Keys with subKeys.
| |
| getBooleanConverter | back to summary |
|---|---|
| public static StyleConverter Return a
| |
| getCachedValue | back to summary |
|---|---|
| protected T getCachedValue(ParsedValue<V, T> key) Get the cached value for the specified key.
| |
| getColorConverter | back to summary |
|---|---|
| public static StyleConverter Return a
| |
| getDurationConverter | back to summary |
|---|---|
| public static StyleConverter Return a
| |
| getEffectConverter | back to summary |
|---|---|
| public static StyleConverter Return a
| |
| getEnumConverter | back to summary |
|---|---|
| public static <E extends Enum Return a
| |
| getFontConverter | back to summary |
|---|---|
| public static StyleConverter Return a
| |
| getInsetsConverter | back to summary |
|---|---|
| public static StyleConverter Return a
| |
| getInstance | back to summary |
|---|---|
| pack-priv static StyleConverter | |
| getPaintConverter | back to summary |
|---|---|
| public static StyleConverter Return a
| |
| getSizeConverter | back to summary |
|---|---|
| public static StyleConverter CSS length and number values are parsed into a Size object that is
converted to a Number before the value is applied. If the property is
a
| |
| getStringConverter | back to summary |
|---|---|
| public static StyleConverter A converter for quoted strings which may have embedded unicode characters.
| |
| getUrlConverter | back to summary |
|---|---|
| public static StyleConverter A converter for URL strings.
| |
| readBinary | back to summary |
|---|---|
| public static StyleConverter Read binary data stream.
| |
| writeBinary | back to summary |
|---|---|
| public void writeBinary(DataOutputStream os, StyleConverter. Write binary data.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| public final List | strings
List of strings of this |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public static String[] | Returns: aString array constructed by reading DataInputStreamDataInputStream from where StringStore strings need to be read fromRead the StringStore strings from a given |
| public void | writeBinary(DataOutputStream
DataOutputStream where the StringStore strings need to be writtenWrites the |
| stringMap | back to summary |
|---|---|
| private final Map<String, Integer> stringMap | |
| strings | back to summary |
|---|---|
| public final List<String> strings List of strings of this | |
| StringStore | back to summary |
|---|---|
| public StringStore() Creates a | |
| addString | back to summary |
|---|---|
| public int addString(String s) Adds given string to the
| |
| readBinary | back to summary |
|---|---|
| public static String[] readBinary(DataInputStream is) throws IOException Read the StringStore strings from a given
| |
| writeBinary | back to summary |
|---|---|
| public void writeBinary(DataOutputStream os) throws IOException Writes the
| |