Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[gef-dev] changes to add/removeNotify in Figure


(Most GEF users should not have to worry about this change.  add/removeNotify is used by connections to hookup anchor listeners, and in a few other places.)

The Figure implementation now checks to prevent addNotify from being called 2 or more times successively.  Previously, addNotify() would be called if you added a figure to another figure.  Then, it would be called *again* if you added that parent figure to something else, etc.  This case is pretty rare but could cause listener leaks to occur.

The new behavior is:
- When adding, addNotify() is only called on a figure if it has been called on it's parent too.  Otherwise, it will be called later when/if the parent's addNotify() happens.
- Same behavior as before, except removeNotify() is only called on a figure if addNotify() was last called.  Also, removeNotify() will not be called more than once in succession.
- Any root figure needs to have addNotify() called on it to bootstrap the process.  LightweightSystem does this now.

This is nothing to get excited about.  The purpose of this change is to make the method do what you thought it was already doing.

-Randy

Back to the top