When the operating system signals that a preference has changed, the mappings are updated
by calling the update(Map) method.
| Modifier and Type | Field and Description |
|---|---|
| private final Map | effectivePreferences
Contains the current set of effective preferences, i.e. the set of preferences that we know to be the current state of the world, and are exposed to users of this map. |
| private final List | |
| private final List | |
| private final Map | platformKeyMappings
Contains mappings from platform-specific keys to well-known keys, which are used
in the implementation of the property-based API in |
| private final Map | platformKeys
Contains mappings from platform-specific keys to their types. |
| private final PreferenceProperties | properties
Contains the implementation of the property-based API. |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public | PlatformPreferences(Map<String, Class<?>>
the platform-specific keys and the types of their values platformKeys, Map<String, PreferenceMapping<?, ?>> the platform-specific key mappings platformKeyMappings)Initializes a new |
| Modifier and Type | Method and Description |
|---|---|
| public ReadOnlyObjectProperty | accentColorProperty()
Implements javafx. The accent color, which can be used to highlight the active or important part of a control and make it stand out from the rest of the user interface. |
| public void | addListener(InvalidationListener
The listener to register listener)Implements javafx. Adds an |
| public void | addListener(MapChangeListener<? super String, ? super Object>
the listener for listening to the list changes listener)Implements javafx. Add a listener to this observable map. |
| public ReadOnlyObjectProperty | backgroundColorProperty()
Implements javafx. The color used for background regions. |
| public ReadOnlyObjectProperty | colorSchemeProperty()
Implements javafx. The platform color scheme, which specifies whether applications should prefer light text on dark backgrounds, or dark text on light backgrounds. |
| public Set | entrySet()
Implements abstract java. Implements java. Returns a |
| private void | |
| public ReadOnlyObjectProperty | foregroundColorProperty()
Implements javafx. The color used for foreground elements like text. |
| public Color | |
| public Color | |
| public Optional | getBoolean(String
the key key)Implements javafx. Returns an optional |
| public Optional | getColor(String
the key key)Implements javafx. Returns an optional |
| public ColorScheme | |
| public Optional | getDouble(String
the key key)Implements javafx. Returns an optional |
| public Color | |
| public Optional | getInteger(String
the key key)Implements javafx. Returns an optional |
| public Optional | getString(String
the key key)Implements javafx. Returns an optional |
| public <T> Optional | getValue(String
the key key, Class<T> the type of the value type)Implements javafx. Returns an optional value to which the specified key is mapped. |
| private boolean | |
| private boolean | |
| private boolean | Returns: true if a casting conversion exists, false otherwisethe source type source, Class<?> the target type target)Determines whether a compile-time casting conversion exists from |
| private boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public ReadOnlyBooleanProperty | persistentScrollBarsProperty()
Implements javafx. Specifies whether applications should always show scroll bars. |
| public ReadOnlyBooleanProperty | reducedDataProperty()
Implements javafx. Specifies whether applications should minimize the amount of internet traffic, which users might request because they are on a metered network or a limited data plan. |
| public ReadOnlyBooleanProperty | reducedMotionProperty()
Implements javafx. Specifies whether applications should minimize the amount of non-essential animations, reducing discomfort for users who experience motion sickness or vertigo. |
| public ReadOnlyBooleanProperty | reducedTransparencyProperty()
Implements javafx. Specifies whether applications should minimize the amount of transparent or translucent layer effects, which can help to increase contrast and readability for some users. |
| public Object | remove(Object
key whose mapping is to be removed from the map key)Overrides java. Implements java. Removes the mapping for a key from this map if it is present (optional operation). |
| public void | removeListener(InvalidationListener
The listener to remove listener)Implements javafx. Removes the given listener from the list of listeners, that are notified
whenever the value of the |
| public void | removeListener(MapChangeListener<? super String, ? super Object>
a listener to remove listener)Implements javafx. Tries to removed a listener from this observable map. |
| public void |
| effectivePreferences | back to summary |
|---|---|
| private final Map<String, Object> effectivePreferences Contains the current set of effective preferences, i.e. the set of preferences that we know to be the current state of the world, and are exposed to users of this map. | |
| invalidationListeners | back to summary |
|---|---|
| private final List<InvalidationListener> invalidationListeners | |
| mapChangeListeners | back to summary |
|---|---|
| private final List<MapChangeListener<? super String, Object>> mapChangeListeners | |
| platformKeyMappings | back to summary |
|---|---|
| private final Map<String, PreferenceMapping<?, ?>> platformKeyMappings Contains mappings from platform-specific keys to well-known keys, which are used
in the implementation of the property-based API in | |
| platformKeys | back to summary |
|---|---|
| private final Map<String, Class<?>> platformKeys Contains mappings from platform-specific keys to their types. This information is used to catch misuse of typed getters even if the preferences map doesn't contain the preference mapping at runtime. | |
| properties | back to summary |
|---|---|
| private final PreferenceProperties properties Contains the implementation of the property-based API. | |
| unmodifiableEffectivePreferences | back to summary |
|---|---|
| private final Map<String, Object> unmodifiableEffectivePreferences | |
| PlatformPreferences | back to summary |
|---|---|
| public PlatformPreferences(Map<String, Class<?>> platformKeys, Map<String, PreferenceMapping<?, ?>> platformKeyMappings) Initializes a new
| |
| accentColorProperty | back to summary |
|---|---|
| public ReadOnlyObjectProperty Implements javafx. Doc from javafx. The accent color, which can be used to highlight the active or important part of a control and make it stand out from the rest of the user interface. It is usually a vivid color that contrasts with the foreground and background colors.
If the platform does not report an accent color, this property defaults to vivid blue
(corresponding to the hex color value
| |
| addListener | back to summary |
|---|---|
| public void addListener(InvalidationListener listener) Implements javafx. Doc from javafx. Adds an
Note that the same actual
The
| |
| addListener | back to summary |
|---|---|
| public void addListener(MapChangeListener<? super String, ? super Object> listener) Implements javafx. Doc from javafx. Add a listener to this observable map.
| |
| backgroundColorProperty | back to summary |
|---|---|
| public ReadOnlyObjectProperty Implements javafx. Doc from javafx. The color used for background regions.
If the platform does not report a background color, this property defaults to
| |
| colorSchemeProperty | back to summary |
|---|---|
| public ReadOnlyObjectProperty Implements javafx. Doc from javafx. The platform color scheme, which specifies whether applications should prefer light text on dark backgrounds, or dark text on light backgrounds.
If the platform does not report color preferences, this property defaults to
| |
| entrySet | back to summary |
|---|---|
| public Set Implements abstract java. Implements java. Doc from java. Returns a | |
| fireValueChangedEvent | back to summary |
|---|---|
| private void fireValueChangedEvent(Map<String, ChangedValue> changedEntries) | |
| foregroundColorProperty | back to summary |
|---|---|
| public ReadOnlyObjectProperty Implements javafx. Doc from javafx. The color used for foreground elements like text.
If the platform does not report a foreground color, this property defaults to
| |
| getAccentColor | back to summary |
|---|---|
| public Color getAccentColor() Implements javafx.
| |
| getBackgroundColor | back to summary |
|---|---|
| public Color getBackgroundColor() Implements javafx.
| |
| getBoolean | back to summary |
|---|---|
| public Optional Implements javafx. Doc from javafx. Returns an optional | |
| getColor | back to summary |
|---|---|
| public Optional Implements javafx. Doc from javafx. Returns an optional | |
| getColorScheme | back to summary |
|---|---|
| public ColorScheme getColorScheme() Implements javafx.
| |
| getDouble | back to summary |
|---|---|
| public Optional Implements javafx. Doc from javafx. Returns an optional | |
| getForegroundColor | back to summary |
|---|---|
| public Color getForegroundColor() Implements javafx.
| |
| getInteger | back to summary |
|---|---|
| public Optional Implements javafx. Doc from javafx. Returns an optional | |
| getString | back to summary |
|---|---|
| public Optional Implements javafx. Doc from javafx. Returns an optional | |
| getValue | back to summary |
|---|---|
| public <T> Optional Implements javafx. Doc from javafx. Returns an optional value to which the specified key is mapped. | |
| isArrayConvertible | back to summary |
|---|---|
| private boolean isArrayConvertible(Class<?> source, Class<?> target) | |
| isClassConvertible | back to summary |
|---|---|
| private boolean isClassConvertible(Class<?> source, Class<?> target) | |
| isConvertible | back to summary |
|---|---|
| private boolean isConvertible(Class<?> source, Class<?> target) Determines whether a compile-time casting conversion exists from | |
| isInterfaceConvertible | back to summary |
|---|---|
| private boolean isInterfaceConvertible(Class<?> source, Class<?> target) | |
| isPersistentScrollBars | back to summary |
|---|---|
| public boolean isPersistentScrollBars() Implements javafx.
| |
| isReducedData | back to summary |
|---|---|
| public boolean isReducedData() Implements javafx.
| |
| isReducedMotion | back to summary |
|---|---|
| public boolean isReducedMotion() Implements javafx.
| |
| isReducedTransparency | back to summary |
|---|---|
| public boolean isReducedTransparency() Implements javafx.
| |
| persistentScrollBarsProperty | back to summary |
|---|---|
| public ReadOnlyBooleanProperty persistentScrollBarsProperty() Implements javafx. Doc from javafx. Specifies whether applications should always show scroll bars. If not set, an application may choose to hide scroll bars that are not actively used, or make them smaller or less noticeable.
If the platform does not report this preference, this property defaults to
| |
| reducedDataProperty | back to summary |
|---|---|
| public ReadOnlyBooleanProperty reducedDataProperty() Implements javafx. Doc from javafx. Specifies whether applications should minimize the amount of internet traffic, which users might request because they are on a metered network or a limited data plan.
If the platform does not report this preference, this property defaults to
| |
| reducedMotionProperty | back to summary |
|---|---|
| public ReadOnlyBooleanProperty reducedMotionProperty() Implements javafx. Doc from javafx. Specifies whether applications should minimize the amount of non-essential animations, reducing discomfort for users who experience motion sickness or vertigo.
If the platform does not report this preference, this property defaults to
| |
| reducedTransparencyProperty | back to summary |
|---|---|
| public ReadOnlyBooleanProperty reducedTransparencyProperty() Implements javafx. Doc from javafx. Specifies whether applications should minimize the amount of transparent or translucent layer effects, which can help to increase contrast and readability for some users.
If the platform does not report this preference, this property defaults to
| |
| remove | back to summary |
|---|---|
| public Object remove(Object key) Overrides java. Implements java. Doc from java. Removes the mapping for a key from this map if it is present
(optional operation). More formally, if this map contains a mapping
from key Returns the value to which this map previously associated the key,
or If this map permits null values, then a return value of
The map will not contain a mapping for the specified key once the call returns. | |
| removeListener | back to summary |
|---|---|
| public void removeListener(InvalidationListener listener) Implements javafx. Doc from javafx. Removes the given listener from the list of listeners, that are notified
whenever the value of the If the given listener has not been previously registered (i.e. it was never added) then this method call is a no-op. If it had been previously added then it will be removed. If it had been added more than once, then only the first occurrence will be removed.
| |
| removeListener | back to summary |
|---|---|
| public void removeListener(MapChangeListener<? super String, ? super Object> listener) Implements javafx. Doc from javafx. Tries to removed a listener from this observable map. If the listener is not attached to this map, nothing happens.
| |
| update | back to summary |
|---|---|
| public void update(Map<String, Object> preferences) Updates this map of preferences with a new set of platform preferences.
The specified preferences may include all available preferences, or only the changed preferences.
The absence of a mapping in the specified preferences does not indicate that it should be removed;
instead, a key must be explicitly mapped to
| |