org.jminor.common.model.valuemap
Class ValueChangeEvent<K,V>

java.lang.Object
  extended by java.util.EventObject
      extended by java.awt.AWTEvent
          extended by java.awt.event.ActionEvent
              extended by 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

Field Summary
 
Fields inherited from class java.awt.event.ActionEvent
ACTION_FIRST, ACTION_LAST, ACTION_PERFORMED, ALT_MASK, CTRL_MASK, META_MASK, SHIFT_MASK
 
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
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ValueChangeEvent(Object source, ValueChangeMap<K,V> valueOwner, K key, V newValue, V oldValue, boolean isModelChange, boolean initialization)
          Instantiates a new PropertyEvent
 
Method Summary
 K getKey()
           
 Object getNewValue()
           
 Object getOldValue()
           
 ValueChangeMap<K,V> getValueOwner()
           
 boolean isInitialization()
           
 boolean isModelChange()
           
 boolean isNewValueEqual(Object value)
          Returns true if the new value is equal to the given value
 boolean isNewValueNull()
           
 boolean isOldValueEqual(Object value)
          Returns true if the old value is equal to the given value
 boolean isOldValueNull()
           
 boolean isUIChange()
           
 
Methods inherited from class java.awt.event.ActionEvent
getActionCommand, getModifiers, getWhen, paramString
 
Methods inherited from class java.awt.AWTEvent
consume, getID, isConsumed, setSource, toString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 change
valueOwner - the map
key - the key associated with the value
newValue - the new value
oldValue - the old value
isModelChange - true if the value change originates from the model, false if it originates in the UI
initialization - true if the value was being initialized
Method Detail

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