org.jminor.common.model.valuemap
Class ValueChangeEvent<K,V>
java.lang.Object
java.util.EventObject
java.awt.AWTEvent
java.awt.event.ActionEvent
org.jminor.common.model.valuemap.ValueChangeEvent<K,V>
- All Implemented Interfaces:
- Serializable
public final class ValueChangeEvent<K,V>
- extends ActionEvent
Used when value change events are fired
- See Also:
- Serialized Form
Fields inherited from class java.awt.AWTEvent |
ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, consumed, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, id, INPUT_METHOD_EVENT_MASK, INVOCATION_EVENT_MASK, ITEM_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, MOUSE_WHEEL_EVENT_MASK, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK, WINDOW_FOCUS_EVENT_MASK, WINDOW_STATE_EVENT_MASK |
ValueChangeEvent
public ValueChangeEvent(Object source,
ValueChangeMap<K,V> valueOwner,
K key,
V newValue,
V oldValue,
boolean isModelChange,
boolean initialization)
- Instantiates a new PropertyEvent
- Parameters:
source
- the source of the value changevalueOwner
- the mapkey
- the key associated with the valuenewValue
- the new valueoldValue
- the old valueisModelChange
- true if the value change originates from the model, false if it originates in the UIinitialization
- true if the value was being initialized
getValueOwner
public ValueChangeMap<K,V> getValueOwner()
- Returns:
- the object owning the value
getKey
public K getKey()
- Returns:
- the key of the associated with the changed value
getOldValue
public Object getOldValue()
- Returns:
- the old value
getNewValue
public Object getNewValue()
- Returns:
- the new value
isNewValueNull
public boolean isNewValueNull()
- Returns:
- true if the new value is null
isNewValueEqual
public boolean isNewValueEqual(Object value)
- Returns true if the new value is equal to the given value
- Parameters:
value
- the value
- Returns:
- true if the given value is the new value
isOldValueEqual
public boolean isOldValueEqual(Object value)
- Returns true if the old value is equal to the given value
- Parameters:
value
- the value
- Returns:
- true if the given value is the old value
isOldValueNull
public boolean isOldValueNull()
- Returns:
- true if the old value is null
isModelChange
public boolean isModelChange()
- Returns:
- true if this property change is coming from the model,
false if it is coming from the UI
isUIChange
public boolean isUIChange()
- Returns:
- true if this property change is coming from the UI,
false if it is coming from the model
isInitialization
public boolean isInitialization()
- Returns:
- true if this key had no associated value prior to this value change