While looking through the current CVS source, I have a question concerning on propagation of events in GraphElement:
// event handling ///////////////////////////////////////////////////////////
public void fireEvent(String eventType, ExecutionContext executionContext) {
Token token = executionContext.getToken();
log.debug( "event '"+eventType+"' on '"+this+"' for '"+token+"'" );
try {
executionContext.setEventSource(this);
fireAndPropagateEvent(eventType, executionContext);
} finally {
executionContext.setEventSource(null);
}
}
public void fireAndPropagateEvent(String eventType, ExecutionContext executionContext) {
// calculate if the event was fired on this element or if it was a propagated event
boolean isPropagated = (this.equals(executionContext.getEventSource()));
// execute static actions
// .....
}
void executeActions(List actions, ExecutionContext executionContext, boolean isPropagated) {
if (actions!=null) {
Iterator iter = actions.iterator();
while (iter.hasNext()) {
Action action = (Action) iter.next();
if ( action.acceptsPropagatedEvents()
|| (!isPropagated)
) {
.....
}
}
}
boolean isPropagated = (this.equals(executionContext.getEventSource()));