예제 #1
0
  public void run() {
    Controller controller = Controller.getController();
    try {
      String ST_OPENING_FILE = controller.getMsgString("ST_OPENING_FILE");
      controller.setStatusMessage(ST_OPENING_FILE);
      try {
        Thread.sleep(10);
      } catch (Exception e) {
        e.printStackTrace();
      }
      controller.setWaitCursors();

      TreeGrowXMLReader xUtil = new TreeGrowXMLReader(m_FileName, true);
      controller.setEditableContributors(new Vector(xUtil.getEditableContributors()));
      xUtil.gatherContent();

      String treeString = xUtil.getTreeStructure();

      ArrayList actualNodes = new ArrayList();
      ArrayList terminalChildrenNodes = new ArrayList();
      Iterator it = xUtil.getNodeList().iterator();
      while (it.hasNext()) {
        Node node = (Node) it.next();
        if (treeString.indexOf("" + node.getId()) != -1) {
          actualNodes.add(node);
        } else {
          terminalChildrenNodes.add(node);
        }
      }
      Tree tree = xUtil.getTree();
      controller.openTreeEditor(tree);
      controller.getTree().setImages(xUtil.getImageList());
      if (prevUploadId != -1) {
        controller.setUploadId(prevUploadId);
      }
      controller.setDefaultCursors();
      controller.getTreeEditor().setToolbarEnabled();
      it = tree.getNodeList().iterator();
      while (it.hasNext()) {
        Node node = (Node) it.next();
        TreePanel.getTreePanel().setNodeComplete(node);
      }
      it = tree.getImages().iterator();
      while (it.hasNext()) {
        NodeImage img = (NodeImage) it.next();
        img.initializeThumbnail();
      }
      controller.setDownloadComplete(true);
    } catch (Exception error) {
      error.printStackTrace();
      controller.setDefaultCursors();
    }
  }
  /** Pull collapsed node bak onto the tree */
  public void undo() {
    if (nodeToCollapse != null) {
      NodeGraveyard.getGraveyard().getNode(nodeToCollapse.getId());
    }

    node.getParent().setChildrenChanged(oldParentHasChanged);
    if (node.getParent().getParent() != null) {
      node.getParent().getParent().setChildrenChanged(oldGrandParentHasChanged);
    }
    TreePanel.getTreePanel().getTree().updateTree(oldTreeString);

    updateTreePanel();
  }
 /** Rebuild treepanels to reflect new tree structure */
 public void updateTreePanel() {
   TreePanel treePanel = TreePanel.getTreePanel();
   treePanel.setActiveNode(node);
   TreePanelUpdateManager.getManager().rebuildTreePanels(affectedNodes);
 }