We have started using swixml in code, which will eventually become production code. As expected, some things work great, other don't and there are still some missing features. One of the things that doesn't work out is the merge. Merge is only useful when used with the same instance of a SwingEngine. This however, is not practical when 2 or more GUIs need to be merged.
Therefore, the upcoming 0.70 release, will have all merge functionally removed from the swixml library. Moreover, we will use lazy initialization for some collections, which means that collections are only being created when initially requested. I.e. if you would never call getAllComponentItertor() on your SwingEngine instance, then the main collection would never have to be created.
Anyway, what all this means is that the GUI generation goes faster and the library got smaller.
 
Please note:
The SwingEngine will never remove GUI components from the screen nor from the idmap. If you remove the content of an UI container, let's say with
 
    mypanel.removeAll();
 
and that container contained UI components that had id attributes in their original tags, then those UI components are still referenced in the idmap and therefore are not available for garbage collection. 
You may have to remove those object manually i.e.
 
    mySwingEngine.getIdMap.remove("myButton");
 
I don't think that if the SwingEngine is properly used, a lot of those ...removeAll() calls are necessary. However, 0.70 will included a cleanup method that can be used to detect and remove those zombies ...
 
 /**
   * Removes all un-displayable components from the id map.
   * <pre>
   * A component is made undisplayable either when it is removed from a displayable
   * containment hierarchy or when its containment hierarchy is made undisplayable.
   * A containment hierarchy is made undisplayable when its ancestor window is disposed.
   * </pre>
   * @return <code>int</code> number of removed components.
   */
  public int cleanup();
 
--
Wolf Paulus
C a r l s b a d   C u b e s
mailto:[EMAIL PROTECTED]
 
CONFIDENTIALITY NOTICE:
This message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law.
If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
 
 

Reply via email to