java.lang.Object
org.jhotdraw8.fxcollection.typesafekey.AbstractKey<@NonNull CssDefaultableValue<T>>
org.jhotdraw8.draw.key.AbstractStyleableKey<@NonNull CssDefaultableValue<T>>
org.jhotdraw8.draw.key.DefaultableStyleableKey<T>
- Type Parameters:
T- the value type
- All Implemented Interfaces:
Serializable,DefaultableStyleableMapAccessor<T>,ReadOnlyStyleableMapAccessor<@NonNull CssDefaultableValue<T>>,WritableStyleableMapAccessor<@NonNull CssDefaultableValue<T>>,Key<CssDefaultableValue<T>>,MapAccessor<@NonNull CssDefaultableValue<T>>,NonNullKey<CssDefaultableValue<T>>,NonNullMapAccessor<CssDefaultableValue<T>>
public class DefaultableStyleableKey<T>
extends AbstractStyleableKey<@NonNull CssDefaultableValue<T>>
implements WritableStyleableMapAccessor<@NonNull CssDefaultableValue<T>>, DefaultableStyleableMapAccessor<T>, NonNullKey<CssDefaultableValue<T>>
DefaultableStyleableKey.
- Author:
- Werner Randelshofer
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultableStyleableKey(@NonNull String name, @NonNull Type type, @NonNull CssConverter<T> converter, @NonNull CssDefaultableValue<T> initialDefaultingValue, @Nullable T initialValue) Creates a new instance with the specified name, mask and default value. -
Method Summary
Modifier and TypeMethodDescription@NonNull org.jhotdraw8.base.converter.Converter<CssDefaultableValue<T>> Returns the initial value of the attribute.Methods inherited from class org.jhotdraw8.draw.key.AbstractStyleableKey
getCssName, getCssNamespaceMethods inherited from class org.jhotdraw8.fxcollection.typesafekey.AbstractKey
getDefaultValue, getName, getValueType, isNullable, isTransient, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jhotdraw8.fxcollection.typesafekey.Key
cast, containsKey, getValue, getValueProperty, isAssignable, isDefault, isNullable, propertyAt, put, put, putValue, readOnlyPropertyAt, remove, remove, valueAtMethods inherited from interface org.jhotdraw8.fxcollection.typesafekey.MapAccessor
getDefaultValue, getName, getRawValueType, getValueType, isTransient, setMethods inherited from interface org.jhotdraw8.fxcollection.typesafekey.NonNullKey
get, getMethods inherited from interface org.jhotdraw8.fxcollection.typesafekey.NonNullMapAccessor
getDefaultValueNonNull, getNonNull, getNonNull, putNonNullMethods inherited from interface org.jhotdraw8.fxbase.styleable.ReadOnlyStyleableMapAccessor
getCssName, getCssNamespaceMethods inherited from interface org.jhotdraw8.fxbase.styleable.WritableStyleableMapAccessor
getExamples
-
Constructor Details
-
DefaultableStyleableKey
public DefaultableStyleableKey(@NonNull String name, @NonNull Type type, @NonNull CssConverter<T> converter, @NonNull CssDefaultableValue<T> initialDefaultingValue, @Nullable T initialValue) Creates a new instance with the specified name, mask and default value.- Parameters:
name- The name of the key.type- The full typeconverter- String converter for a list elementinitialDefaultingValue- The default value.
-
-
Method Details
-
getCssConverter
- Specified by:
getCssConverterin interfaceReadOnlyStyleableMapAccessor<T>
-
getInitialValue
Returns the initial value of the attribute.We use the definition from CSS initial value:
"Each property has an initial value, defined in the property's definition table. If the property is not an inherited property, and the cascade does not result in a value, then the specified value of the property is its initial value."
We intentionally do not use the definition from SVG initial value:
"The initial value of an attribute or property is the value used when that attribute or property is not specified, or when it has an invalid value."References:
- Specified by:
getInitialValuein interfaceDefaultableStyleableMapAccessor<T>- Returns:
- the initial value.
-