| Indicates which style constructs have been changed.
Acts as a series of breadcrumbs stored up by a StyleEvent to communicate
changes.
This delta is constructed a fashion following the outline of the style
document, allowing you to skip over entire branches of changes if you are
not interested.
Example Use
The following examples will make use of the following
allegorical data structure
Root
+--Parent
+-- Child
+-- List
[0]--Element
These roles are allegorical in nature any may be played
in real life by arrays, beans, collections, etc..
(as example StyleLayerDescriptor is a "Root").
Example 0: An Child is changed.
Event.POST_CHANGE
+---Delta1 "" -1 NO_CHANGE(Root,null,)
+---Delta2 "Parent" -1 NO_CHANGE (Parent, null )
+---Delta3 "Child" -1 CHANGED (Child, oldChild )
Location of change is indicated by delta, including
name of "Child". The oldChild is provided incase you need to
un-listen or something. Parent is not considered to have
changed itself (it is still has the same structure).
Example 1: An Element is changed:
Event.POST_CHANGE
+---Delta1 "" -1 NO_CHANGE(Root,null,)
+---Delta2 "Parent" -1 NO_CHANGE (Parent, null )
+---Delta3 "List" 0 CHANGED (Element, null )
Location of change is indicated by delta, including position
in list. Children in lists are children too, delta intentionally
similar to the last.
Example 2: A new Element2 is added:
Event.POST_CHANGE
+---Delta1 "" -1 NO_CHANGE(Root,null,)
+---Delta2 "Parent" -1 CHANGED (Parent, null )
+---Delta3 "List" 1 ADDED (Element2, null )
Adding Element2 results in a change to Parent (it is structured
diffrently). Position of the change in the "List" is indicated.
Example 3: Swap Element and Element2
Event.POST_CHANGE
+---Delta1 "" -1 NO_CHANGE(Root,null,)
+---Delta2 "Parent" -1 CHANGED (Parent, null )
+---Delta3 "List" 1 NO_CHANGE (Element, null )
+---Delta4 "List" 0 NO_CHANGE (Element2, null )
Moving things around does not change them, but it is a change to the
Parent.
Example 5: Remove Element2
Event.POST_CHANGE
+---Delta1 "" -1 NO_CHANGE(Root,null,)
+---Delta2 "Parent" -1 CHANGED (Parent, null )
+---Delta3 "List" -1 REMOVED ( null, Element2 )
+---Delta4 "List" 0 NO_CHANGE (Element, null )
Removing also is a considered a change to Parent, note
this is a POST_CHANGE event so Element2 is an oldValue.
The NO_CHANGE for Element is similar to Example4, it still
indicates a change of position.
Example 6: Go Fish
Event.POST_CHANGE
+---Delta1 "" -1 CHANGED(Root,null,)
Something changed somewhere, similar to "touch".
Example 7: Shutting Down
Event.PRE_CLOSE
+---Delta1 "" -1 NO_CHANGE(Root,null,)
That was easy then...
You should be aware that the event system may "collapse"
events that duplicate information, especially when
considering batch changes resulting from the application
of a visitor or transformation.
author: Jody Garnett, Refractions Research |