public void update(Observable sender, Object h) {
		if (h != null) {
			// new object
			Host host = (Host) h;
			LANHostTreeItem lhti = new LANHostTreeItem ();
			lhti.setHost(host);
			
			if (host.state == Host.HostStateType.ONLINE) {
				this.onlineHosts.add(lhti);
			} else {
				this.offlineHosts.add (lhti);
			}
		} else {
			// only the online/offline state has changed
			synchronized (this.synchronizer) {
				// check if any online hosts are now offline
				Iterator<LANHostTreeItem> iterator = this.onlineHosts.iterator();
				while (iterator.hasNext()) {
					LANHostTreeItem item = iterator.next();
					
					if (item.getHost().state == Host.HostStateType.OFFLINE) {
						this.offlineHosts.add(item);
						//onlineHosts.remove(item);
						iterator.remove();
					}
				}
				
				// check if any offline hosts are now online
				iterator = this.offlineHosts.iterator();
				while (iterator.hasNext()) {
					LANHostTreeItem item = iterator.next();
					
					if (item.getHost().state == Host.HostStateType.ONLINE) {
						this.onlineHosts.add(item);
						//offlineHosts.remove(item);
						iterator.remove();
					}
				}
			}
		}
		
		// tell the tree model that we changed
		synchronized (this.onlineHosts) {
			java.util.Collections.sort(this.onlineHosts, CaseInsensitiveStringComparator.instance());
			java.util.Collections.sort(this.offlineHosts, CaseInsensitiveStringComparator.instance());
			
			allHosts.clear();
			allHosts.addAll(onlineHosts);
			allHosts.addAll(offlineHosts);
		}
		
		final LANHostsTreeItem t = this;
		SwingUtilities.invokeLater(new Runnable () {

			public void run() {
				MainDialogTreeModel.instance ().reload(t);
				
			}});
		
		
	}