insertExpandPreviousNode(node); if (node.getChildCount() == 0) { node.getAsset().propagateChildren(node); } insertExpandNextNode(node); } else { insertLoadingNode(node); MatrixStatusBar.setStatus(Matrix.translate("asset_map_status_bar_requesting")); Runnable runner = new Runnable() { public void run() { try { Asset asset = node.getAsset(); if (asset.getId().equals("1")) { AssetManager.refreshAsset(node, ""); removeLoadingNode(node); } else { removeChildNodes(node); AssetManager.refreshAsset(node, direction, start, limit); insertExpandPreviousNode(node); insertExpandNextNode(node); TreePath path = getPathToRoot(node); if (!isExpanded(path)) { expandPath(path);
int sort_order = 0; int totalKids = 0;  if (parent.getChildCount() > 0) {  sort_order = Integer.parseInt(sort_orders[level]); parent = (MatrixTreeNode)parent.getChildAt(sort_order);  if (parent.getAsset().getId().equals(assetids[level])) { found = true; path = getPathToRoot(parent); if (isExpanded(path)) {  tree.collapsePath(path); } level++; } }  if (found) { TreePath[] paths = new TreePath[numAssets+1]; paths[0] = path;  while (level < numAssets) { found = false; Asset asset = parent.getAsset(); totalKids = asset.getTotalKidsLoaded(); sort_order = Integer.parseInt(sort_orders[level]);  if (!sort_orders[level].equals("-1")) {  removeChildNodes(parent); int modifier = (int)(sort_order/AssetManager.getLimit());  AssetManager.refreshAsset(parent, "", AssetManager.getLimit()*modifier, -1); loadedNodes += parent.getChildCount(); if (parent.getChildCount() > 0) { int loc = (sort_order%AssetManager.getLimit()); if (loc >= parent.getChildCount()) { loc = parent.getChildCount()-1; } parent = (MatrixTreeNode)parent.getChildAt(loc); if (parent.getAsset().getId().equals(assetids[level])) { found = true; path = getPathToRoot(parent); paths[level] = path; level++; } } } else { MatrixTreeNode foundNode = findAssetUnderParent(parent, assetids[level], false); if (foundNode != null) { parent = foundNode; found = true; path = getPathToRoot(foundNode); paths[level] = path; level++; } }  if (!found) { break;
	public void loadChildAssets(final MatrixTreeNode node, final String direction, final int start, final int limit) {		if (node == null) {			return;		}		if (node.getChildCount() > 0 && direction.equals("") && start < 0) {			removeExpandPreviousNode(node);			removeExpandNextNode(node);			insertExpandPreviousNode(node);			if (node.getChildCount() == 0) {				node.getAsset().propagateChildren(node);			}			insertExpandNextNode(node);		} else {			insertLoadingNode(node);			MatrixStatusBar.setStatus(Matrix.translate("asset_map_status_bar_requesting"));			Runnable runner = new Runnable() {				public void run() {					try {						Asset asset = node.getAsset();						if (asset.getId().equals("1")) {							AssetManager.refreshAsset(node, "");							removeLoadingNode(node);						} else {							removeChildNodes(node);							AssetManager.refreshAsset(node, direction, start, limit);							insertExpandPreviousNode(node);							insertExpandNextNode(node);							TreePath path = getPathToRoot(node);							if (!isExpanded(path)) {								expandPath(path);							}						}						if (node.getChildCount() == 1) {							MatrixStatusBar.setStatusAndClear(Matrix.translate("asset_map_status_bar_loaded_child"), 1000);						} else {							Object[] transArgs = {								new Integer(node.getChildCount())							};							MatrixStatusBar.setStatusAndClear(Matrix.translate("asset_map_status_bar_loaded_children", transArgs), 1000);						}					} catch (IOException ioe) {						MatrixStatusBar.setStatusAndClear(Matrix.translate("asset_map_status_bar_requesting"), 1000);						Object[] transArgs = {							ioe.getMessage()						};						String message = Matrix.translate("asset_map_error_loading_children", transArgs);						GUIUtilities.error(message, Matrix.translate("asset_map_dialog_title_error"));						Log.log(message, MatrixTree.class, ioe);					}				}			};			SwingUtilities.invokeLater(runner);		}	}