public final class SwingPropertyChangeSupport extends PropertyChangeSupport
java.beans.PropertyChangeSupport功能几乎是相同的。唯一的区别是如果采用
SwingPropertyChangeSupport(sourceBean, true)确保听众只通知在事件调度线程。
| Constructor and Description |
|---|
SwingPropertyChangeSupport(Object sourceBean)
构建了一个swingpropertychangesupport对象。
|
SwingPropertyChangeSupport(Object sourceBean, boolean notifyOnEDT)
构建了一个swingpropertychangesupport对象。
|
| Modifier and Type | Method and Description |
|---|---|
void |
firePropertyChange(PropertyChangeEvent evt)
向已注册的侦听器发射属性更改事件,以跟踪所有属性或具有指定名称的属性的更新。
|
boolean |
isNotifyOnEDT()
notifyOnEDT财产收益。
|
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, removePropertyChangeListener, removePropertyChangeListenerpublic SwingPropertyChangeSupport(Object sourceBean)
sourceBean -豆给任何事件源。
null
sourceBean
NullPointerException
public SwingPropertyChangeSupport(Object sourceBean, boolean notifyOnEDT)
sourceBean -豆给任何事件源
notifyOnEDT -是否通知听众在事件调度线程只
null
sourceBean
NullPointerException
public void firePropertyChange(PropertyChangeEvent evt)
如果给定的事件的旧值和新值是相等的和非空值,则不发射任何事件。
如果isNotifyOnEDT()是true取消事件调度线程这实现使用SwingUtilities.invokeLater发出通知的事件调度线程。这确保听众只通知在事件调度线程。
firePropertyChange 方法重写,继承类
PropertyChangeSupport
evt -
PropertyChangeEvent被解雇
null
evt
NullPointerException
public final boolean isNotifyOnEDT()
notifyOnEDT财产收益。
notifyOnEDT财产
SwingPropertyChangeSupport(Object sourceBean, boolean notifyOnEDT)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.