Examples of MyTreeNode


Examples of com.eastidea.qaforum.model.MyTreeNode

  public MyTreeNode getFuncPointTreeByProjectid(Long projectid) {

    List<FuncPoint> funcPointList = funcPointMaintDao
        .getFuncPointByProjectid(projectid);
   
    MyTreeNode rootTreeNode = new MyTreeNode(Long.valueOf(0));
    rootTreeNode.setNodeName("ROOT");
    rootTreeNode.setNodeDepth(Long.valueOf(-1));
    Map<Long, MyTreeNode> nodeCache = new LinkedHashMap<Long, MyTreeNode>();
   
    for (FuncPoint fp : funcPointList){

      MyTreeNode myTreeNode = new MyTreeNode(fp.getFpid());
      myTreeNode.setNodeName(fp.getName());
      myTreeNode.setOrderNum(fp.getOrderNum());
      myTreeNode.setNodeDepth(fp.getDepth());
      myTreeNode.setPid(fp.getParentid());

      if (myTreeNode.getNodeDepth() == 0) {
        rootTreeNode = myTreeNode;
      }
      nodeCache.put(myTreeNode.getNodeid(), myTreeNode);
    }
   
    Iterator it = nodeCache.keySet().iterator();
    while (it.hasNext()){
      Long key = (Long) it.next();
      MyTreeNode mt = nodeCache.get(key);
      if (mt.getNodeDepth() > 0){
        Long pid = mt.getPid();
        MyTreeNode pmt = nodeCache.get(pid);
        mt.setParent(pmt);
        pmt.addChild(mt);
      }
    }
   
    return rootTreeNode;
  }
View Full Code Here

Examples of com.eastidea.qaforum.model.MyTreeNode

    return rootTreeNode;
  }

  public void addChildTop(MyTreeNode newNode, MyTreeNode pNode, Project workProject) {

    MyTreeNode firstChild = pNode.getFirstChild();
    if (firstChild != null)
      newNode.setOrderNum(firstChild.getOrderNum() - 1);
    else
      newNode.setOrderNum(Long.valueOf(0));
   
    pNode.addChild(newNode);
    newNode.setParent(pNode);
View Full Code Here

Examples of com.eastidea.qaforum.model.MyTreeNode

  }

  public void addChildBottom(MyTreeNode newNode, MyTreeNode pNode, Project workProject) {

    MyTreeNode firstChild = pNode.getLastChild();
    if (firstChild != null)
      newNode.setOrderNum(firstChild.getOrderNum() + 1);
    else
      newNode.setOrderNum(Long.valueOf(0));

    pNode.addChild(newNode);
    newNode.setParent(pNode);
View Full Code Here

Examples of com.eastidea.qaforum.model.MyTreeNode

    if (cNode.getNodeDepth() < 0)
      return;
   
    FuncPoint ccNode = funcPointMaintDao.getFuncPoint(cNode.getNodeid());
   
    MyTreeNode pNode = (MyTreeNode) cNode.getParent()
    pNode.addChild(newNode);
    newNode.setParent(pNode);
    newNode.setOrderNum(ccNode.getOrderNum());   
   
    FuncPoint newfp = new FuncPoint();
   
    newfp.setParentid(pNode.getNodeid());
    newfp.setName(newNode.getNodeName());
    newfp.setOrderNum(newNode.getOrderNum());
    newfp.setDepth(pNode.getNodeDepth()+1);
    newfp.setProject(workProject);
   
    funcPointMaintDao.insertBefore(newfp);

    newNode.setNodeid(newfp.getFpid());
View Full Code Here

Examples of com.eastidea.qaforum.model.MyTreeNode

    if (cNode.getNodeDepth() < 0)
      return;
   
    FuncPoint ccNode = funcPointMaintDao.getFuncPoint(cNode.getNodeid());
   
    MyTreeNode pNode = (MyTreeNode) cNode.getParent()
    pNode.addChild(newNode);
    newNode.setParent(pNode);
    newNode.setOrderNum(ccNode.getOrderNum());
   
    FuncPoint newfp = new FuncPoint();
    newfp.setParentid(pNode.getNodeid());
    newfp.setName(newNode.getNodeName());
    newfp.setOrderNum(newNode.getOrderNum());
    newfp.setDepth(pNode.getNodeDepth()+1);
    newfp.setProject(workProject);
   
    funcPointMaintDao.insertAfter(newfp);

    newNode.setNodeid(newfp.getFpid());
View Full Code Here

Examples of com.eastidea.qaforum.model.MyTreeNode

  @In(value = "funcPointMaintService", create = true)
  private FuncPointMaintService funcPointMaintService;

  @Begin(nested = true)
  public void getFpTree() {
    MyTreeNode treeNode = funcPointMaintService
        .getFuncPointTreeByProjectid(workProject.getProjectid());
    // treeNode.setNodeName(workProject.getName());

    fpTreeNode = new MyTreeNode(Long.valueOf(-1));
    fpTreeNode.setNodeName("NOT_DISPLAY");
    fpTreeNode.addChild(treeNode);
    treeNode.setParent(fpTreeNode);
  }
View Full Code Here

Examples of com.eastidea.qaforum.model.MyTreeNode

    fpTreeNode.addChild(treeNode);
    treeNode.setParent(fpTreeNode);
  }
 
  public void update() {
    MyTreeNode cNode = (MyTreeNode) selectedNode;
    funcPointMaintService.update(cNode);

    getFpTree();

    selectNode(cNode);
View Full Code Here

Examples of com.eastidea.qaforum.model.MyTreeNode

  }

  public void delete() {

    MyTreeNode sNode = (MyTreeNode) selectedNode;
   
    List<FuncPoint> children = funcPointMaintService.getChildrenFuncPoint(sNode.getNodeid());
    if (children.size() > 0) {
      facesMessages.add(new FacesMessage ("Can not delete a no-empty Node"));
      return;
    }
   
    if (sNode.getNodeid() > 0 && sNode.getNodeDepth() > 0) {

      MyTreeNode pNode = (MyTreeNode) selectedNode.getParent();
      pNode.removeChild(sNode.getNodeid());

      funcPointMaintService.delete(sNode);

    }
View Full Code Here

Examples of com.eastidea.qaforum.model.MyTreeNode

    }

  }

  public void addChildTop() {
    MyTreeNode newNode = new MyTreeNode(Long.valueOf(count++));
    newNode.setNodeName("<NA-" + count + ">");
    MyTreeNode pNode = (MyTreeNode) selectedNode;

    funcPointMaintService.addChildTop(newNode, pNode, workProject);

    getFpTree();
View Full Code Here

Examples of com.eastidea.qaforum.model.MyTreeNode

    expandNode(newNode);

  }

  public void addChildBottom() {
    MyTreeNode newNode = new MyTreeNode(Long.valueOf(count++));
    newNode.setNodeName("<NA-" + count + ">");
    MyTreeNode pNode = (MyTreeNode) selectedNode;

    funcPointMaintService.addChildBottom(newNode, pNode, workProject);

    getFpTree();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.