Typical dispose operations are: disable event listeners and disconnect data and selection models. A component "disposed" should be garbage collected.
768769770771772773774775776777778
ItsNatComponent[] listRes = new ItsNatComponent[components.size()]; int i = 0; for (Map.Entry<Node,ItsNatComponent> entry : components.entrySet()) { ItsNatComponent comp = entry.getValue(); if (dispose) comp.dispose(); listRes[i] = comp; i++; } components.clear(); return listRes;