public class ChangesSupport
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROP_PENDINGCHANGES |
static java.lang.String |
PROP_VALUEADJUSTING |
Constructor and Description |
---|
ChangesSupport(java.beans.PropertyChangeSupport pcs,
java.lang.Object parent)
if the propertyChangeSupport is provided, then change messages will be sent to
it directly.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener) |
void |
changePerformed(java.lang.Object client,
java.lang.Object lockObject)
the change is complete, and as far as the client is concerned,
the canvas is valid.
|
java.util.Map |
getChangesPending()
return a map listing the pending changes.
|
boolean |
isPendingChanges()
true if someone has registered a pending change.
|
boolean |
isPendingChanges(java.lang.Object lockObject)
allow check for particular change.
|
boolean |
isValueAdjusting()
true when the bean state is rapidly changing.
|
java.util.concurrent.locks.Lock |
mutatorLock()
one client will have write access to the bean, and when unlock
is called, a "valueAdjusting" property change event is fired.
|
void |
pendingChanges(java.util.Map<java.lang.Object,java.lang.Object> changes)
return a list of all the pending changes.
|
void |
performingChange(java.lang.Object client,
java.lang.Object lockObject)
performingChange tells that the change is about to be performed.
|
void |
registerPendingChange(java.lang.Object client,
java.lang.Object lockObject)
the client knows a change will be coming, and the canvas' clients should
know that its current state will change soon.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener) |
public static final java.lang.String PROP_PENDINGCHANGES
public static final java.lang.String PROP_VALUEADJUSTING
public ChangesSupport(java.beans.PropertyChangeSupport pcs, java.lang.Object parent)
pcs
- the PropertyChangeSupportparent
- the object this is supporting, for debugging purposes.public void registerPendingChange(java.lang.Object client, java.lang.Object lockObject)
client
- the object that will perform the change. This allows the
canvas (and developers) identify who has registered the change.lockObject
- object identifying the change.public void pendingChanges(java.util.Map<java.lang.Object,java.lang.Object> changes)
changes
- a Map to which the changes will be added.getChangesPending()
public void performingChange(java.lang.Object client, java.lang.Object lockObject)
client
- the object that is mutating the bean.lockObject
- an object identifying the change.public void changePerformed(java.lang.Object client, java.lang.Object lockObject)
client
- the object that is mutating the bean.lockObject
- an object identifying the change.public boolean isPendingChanges()
public boolean isPendingChanges(java.lang.Object lockObject)
lockObject
- object identifying the change.public java.util.Map getChangesPending()
pendingChanges(java.util.Map<java.lang.Object, java.lang.Object>)
public boolean isValueAdjusting()
public java.util.concurrent.locks.Lock mutatorLock()
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)