private static void setupAndDraw(DocumentInfo docInfo, OutlinerDocument doc, int openOrImportResult) {
		JoeTree tree = doc.tree;
		String filename = PropertyContainerUtil.getPropertyAsString(docInfo, DocumentInfo.KEY_PATH);
		
		tree.clearSelection();
		tree.getVisibleNodes().clear();
		
		// Insert nodes into the VisibleNodes Cache
		Node rootNode = tree.getRootNode();
		for (int i = 0, limit = tree.getRootNode().numOfChildren(); i < limit; i++) {
			tree.addNode(rootNode.getChild(i));
		}
		
		// Update the menuBar
		doc.setFileName(filename);
		doc.setModified(false);
		
		// case out on the form to build the title
		String title;
		switch (doc.getTitleNameForm()) {
			case FULL_PATHNAME:
			
			default: 
				title = filename;
				break;
				
			case TRUNC_PATHNAME: 
				title = StanStringTools.getTruncatedPathName(filename, TRUNC_STRING);
				break;
				
			case JUST_FILENAME: 
				title = StanStringTools.getFileNameFromPathName(filename) ;
				break;
		}
		
		doc.setTitle(title);
		
		Outliner.menuBar.windowMenu.updateWindow(doc);
		
		// Expand Nodes
		IntList expandedNodes = docInfo.getExpandedNodes();
		for (int i = 0, limit = expandedNodes.size(); i < limit; i++) {
			int nodeNum = expandedNodes.get(i);
			try {
				Node node = doc.tree.getVisibleNodes().get(nodeNum);
				node.setExpanded(true);
			} catch (Exception e) {
				break;
			}
		}
		
		// Record the current location
		Node firstVisibleNode;
		int index = -1;
		try {
			index = PropertyContainerUtil.getPropertyAsInt(docInfo, DocumentInfo.KEY_VERTICAL_SCROLL_STATE) - 1;
			firstVisibleNode = tree.getVisibleNodes().get(index);
		} catch (IndexOutOfBoundsException e) {
			index = 0;
			firstVisibleNode = tree.getVisibleNodes().get(0);
		}
		
		tree.setEditingNode(firstVisibleNode);
		tree.setCursorPosition(0);
		tree.setComponentFocus(OutlineLayoutManager.TEXT);
		
		// Redraw
		OutlineLayoutManager layout = doc.panel.layout;
		layout.setNodeToDrawFrom(firstVisibleNode,index);
		layout.redraw();
		
		// Set document as modified if something happened on open
		if (openOrImportResult == SUCCESS_MODIFIED) {
			doc.setModified(true);
		}
		
		// Maximize document if necessary
		//if (Outliner.desktop.isMaximized()) {
		//	Outliner.desktop.getDesktopManager().maximizeFrame(doc);
		//}
		Outliner.menuBar.windowMenu.changeToWindow(doc);
	}