java.lang.Object
javafx.beans.binding.MapExpression<K,V>
javafx.beans.property.ReadOnlyMapProperty<K,V>
javafx.beans.property.MapProperty<K,V>
javafx.beans.property.MapPropertyBase<K,V>
javafx.beans.property.SimpleMapProperty<K,V>
javafx.beans.property.ReadOnlyMapWrapper<K,V>
- All Implemented Interfaces:
Map<K,V>
,Observable
,Property<ObservableMap<K,V>>
,ReadOnlyProperty<ObservableMap<K,V>>
,ObservableMapValue<K,V>
,ObservableObjectValue<ObservableMap<K,V>>
,ObservableValue<ObservableMap<K,V>>
,WritableMapValue<K,V>
,WritableObjectValue<ObservableMap<K,V>>
,WritableValue<ObservableMap<K,V>>
,ObservableMap<K,V>
public class ReadOnlyMapWrapper<K,V> extends SimpleMapProperty<K,V>
This class provides a convenient class to define read-only properties. It
creates two properties that are synchronized. One property is read-only
and can be passed to external users. The other property is read- and
writable and should be used internally only.
- Since:
- JavaFX 2.1
-
Property Summary
-
Nested Class Summary
-
Constructor Summary
Constructors Constructor Description ReadOnlyMapWrapper()
The constructor ofReadOnlyMapWrapper
ReadOnlyMapWrapper(Object bean, String name)
The constructor ofReadOnlyMapWrapper
ReadOnlyMapWrapper(Object bean, String name, ObservableMap<K,V> initialValue)
The constructor ofReadOnlyMapWrapper
ReadOnlyMapWrapper(ObservableMap<K,V> initialValue)
The constructor ofReadOnlyMapWrapper
-
Method Summary
Modifier and Type Method Description protected void
fireValueChangedEvent()
protected void
fireValueChangedEvent(MapChangeListener.Change<? extends K,? extends V> change)
ReadOnlyMapProperty<K,V>
getReadOnlyProperty()
Returns the readonly property, that is synchronized with thisReadOnlyMapWrapper
.Methods inherited from class javafx.beans.property.MapPropertyBase
addListener, addListener, addListener, bind, emptyProperty, get, invalidated, isBound, removeListener, removeListener, removeListener, set, sizeProperty, toString, unbind
Methods inherited from class javafx.beans.property.MapProperty
bindBidirectional, setValue, unbindBidirectional
Methods inherited from class javafx.beans.property.ReadOnlyMapProperty
bindContent, bindContentBidirectional, equals, hashCode, unbindContent, unbindContentBidirectional
Methods inherited from class javafx.beans.binding.MapExpression
asString, clear, containsKey, containsValue, entrySet, get, getSize, getValue, isEmpty, isEqualTo, isNotEqualTo, isNotNull, isNull, keySet, mapExpression, put, putAll, remove, size, valueAt, valueAt, values
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Constructor Details
-
ReadOnlyMapWrapper
public ReadOnlyMapWrapper()The constructor ofReadOnlyMapWrapper
-
ReadOnlyMapWrapper
The constructor ofReadOnlyMapWrapper
- Parameters:
initialValue
- the initial value of the wrapped value
-
ReadOnlyMapWrapper
The constructor ofReadOnlyMapWrapper
- Parameters:
bean
- the bean of thisReadOnlyMapWrapper
name
- the name of thisReadOnlyMapWrapper
-
ReadOnlyMapWrapper
The constructor ofReadOnlyMapWrapper
- Parameters:
bean
- the bean of thisReadOnlyMapWrapper
name
- the name of thisReadOnlyMapWrapper
initialValue
- the initial value of the wrapped value
-
-
Method Details
-
getReadOnlyProperty
Returns the readonly property, that is synchronized with thisReadOnlyMapWrapper
.- Returns:
- the readonly property
-
fireValueChangedEvent
protected void fireValueChangedEvent()Sends notifications to all attachedInvalidationListeners
,ChangeListeners
, andMapChangeListener
. This method is called when the value is changed, either manually by callingMapPropertyBase.set(javafx.collections.ObservableMap)
or in case of a bound property, if the binding becomes invalid.- Overrides:
fireValueChangedEvent
in classMapPropertyBase<K,V>
-
fireValueChangedEvent
Sends notifications to all attachedInvalidationListeners
,ChangeListeners
, andMapChangeListener
. This method is called when the content of the list changes.- Overrides:
fireValueChangedEvent
in classMapPropertyBase<K,V>
- Parameters:
change
- the change that needs to be propagated
-