- 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<K>
,ReadOnlyProperty<K>
,ObservableMapValue<K,V>
,ObservableObjectValue<K>
,ObservableValue<K>
,WritableMapValue<K,V>
,WritableObjectValue<K>
,WritableValue<K>
,ObservableMap<K,V>
public class ReadOnlyMapWrapper<K,V> extends SimpleMapProperty<K,V>
该类提供了一个方便的类来定义只读属性。 它创建两个同步的属性。 一个属性是只读的,可以传递给外部用户。 另一个属性是可读写的,只能在内部使用。- 从以下版本开始:
- JavaFX 2.1
-
-
Property Summary
-
Properties inherited from class javafx.beans.property.MapPropertyBase
empty, size
-
-
构造方法摘要
构造方法 Constructor 描述 ReadOnlyMapWrapper()
构造函数为ReadOnlyMapWrapper
ReadOnlyMapWrapper(Object bean, String name)
构造函数为ReadOnlyMapWrapper
ReadOnlyMapWrapper(Object bean, String name, ObservableMap<K,V> initialValue)
构造函数为ReadOnlyMapWrapper
ReadOnlyMapWrapper(ObservableMap<K,V> initialValue)
构造函数为ReadOnlyMapWrapper
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 protected void
fireValueChangedEvent()
发送通知到所有连接InvalidationListeners
,ChangeListeners
,并MapChangeListener
。protected void
fireValueChangedEvent(MapChangeListener.Change<? extends K,? extends V> change)
发送通知到所有连接InvalidationListeners
,ChangeListeners
,并MapChangeListener
。ReadOnlyMapProperty<K,V>
getReadOnlyProperty()
返回readonly属性,该属性与此ReadOnlyMapWrapper
同步。-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entry, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, of, of, of, of, of, of, of, of, of, of, of, ofEntries, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
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 javafx.beans.property.MapProperty
bindBidirectional, setValue, unbindBidirectional
-
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 java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javafx.beans.value.ObservableValue
getValue
-
Methods inherited from class javafx.beans.property.ReadOnlyMapProperty
bindContent, bindContentBidirectional, equals, hashCode, unbindContent, unbindContentBidirectional
-
Methods inherited from class javafx.beans.property.SimpleMapProperty
getBean, getName
-
Methods inherited from interface javafx.beans.value.WritableValue
getValue
-
-
-
-
构造方法详细信息
-
ReadOnlyMapWrapper
public ReadOnlyMapWrapper()
构造函数为ReadOnlyMapWrapper
-
ReadOnlyMapWrapper
public ReadOnlyMapWrapper(ObservableMap<K,V> initialValue)
构造函数为ReadOnlyMapWrapper
- 参数
-
initialValue
- 包装值的初始值
-
ReadOnlyMapWrapper
public ReadOnlyMapWrapper(Object bean, String name)
构造函数为ReadOnlyMapWrapper
- 参数
-
bean
- 这个ReadOnlyMapWrapper
的豆 -
name
- 这个名字ReadOnlyMapWrapper
-
ReadOnlyMapWrapper
public ReadOnlyMapWrapper(Object bean, String name, ObservableMap<K,V> initialValue)
构造函数为ReadOnlyMapWrapper
- 参数
-
bean
- 这个ReadOnlyMapWrapper
的豆 -
name
- 这个名字ReadOnlyMapWrapper
-
initialValue
- 包装值的初始值
-
-
方法详细信息
-
getReadOnlyProperty
public ReadOnlyMapProperty<K,V> getReadOnlyProperty()
返回readonly属性,该属性与此ReadOnlyMapWrapper
同步。- 结果
- 只读属性
-
fireValueChangedEvent
protected void fireValueChangedEvent()
发送通知到所有连接InvalidationListeners
,ChangeListeners
,并MapChangeListener
。 如果绑定变为无效,则通过调用MapPropertyBase.set(javafx.collections.ObservableMap)
手动或绑定属性的情况下,调用该方法。
-
fireValueChangedEvent
protected void fireValueChangedEvent(MapChangeListener.Change<? extends K,? extends V> change)
发送通知到所有连接InvalidationListeners
,ChangeListeners
,并MapChangeListener
。 当列表的内容更改时调用此方法。- 重写:
-
fireValueChangedEvent
在MapPropertyBase<K,V>
- 参数
-
change
- 需要传播的变化
-
-