Examples of PhyloTree


Examples of org.cipres.treebase.domain.tree.PhyloTree

  public ModelAndView handleRequest(HttpServletRequest pRequest, HttpServletResponse pResponse)
  throws Exception {
    Study study = null;
    if (pRequest.getParameter("treeid") != null) {
      String treeId = pRequest.getParameter("treeid");
      PhyloTree tree = getPhyloTreeService().findByID(Long.parseLong(treeId));
      study = tree.getStudy();
    }
    if (pRequest.getParameter("treeblockid") != null) {
      String treeBlockId = pRequest.getParameter("treeblockid");
      Long value = Long.parseLong(treeBlockId);
      TreeBlock treeBlock = getPhyloTreeHome().findTreeBlockById(value);
View Full Code Here

Examples of org.cipres.treebase.domain.tree.PhyloTree

  }
 
  private void checkAnalyzed(Collection<PhyloTree> mylist, Study study) { 
    Iterator<PhyloTree> treeIterator = mylist.iterator();
    while ( treeIterator.hasNext() ) {
      PhyloTree tree = treeIterator.next();
      if ( tree.isPublished() ) {
        tree.setAnalyzed(true);
      }
      else {
        if ( study != null ) {
          Iterator<PhyloTree> analyzedTreeIterator = study.getTrees().iterator();
          ANALYZED: while ( analyzedTreeIterator.hasNext() ) {
            PhyloTree analyzedTree = analyzedTreeIterator.next();
            if ( analyzedTree.getId() == tree.getId() ) {
              tree.setAnalyzed(true);
              break ANALYZED;
            }
          }
        }
View Full Code Here

Examples of org.cipres.treebase.domain.tree.PhyloTree

    StringBuilder oversizeLabelrowsbldr = new StringBuilder("");
    Iterator<PhyloTree> treeIter = mylist.iterator();

    int i = 0;
    while (treeIter.hasNext()) {
      PhyloTree aTree = treeIter.next();
      if ((aTree.getTitle() != null) && (aTree.getTitle().trim().length() > permittedlength)) {
        check = false;
        oversizeTitlerowsbldr.append(String.valueOf(i + 1)).append(",");
      }
      if ((aTree.getLabel() != null) && (aTree.getLabel().trim().length() > permittedlength)) {
        check = false;
        oversizeLabelrowsbldr.append(String.valueOf(i + 1)).append(",");
      }
      i++;
    }
View Full Code Here

Examples of org.cipres.treebase.domain.tree.PhyloTree

  public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
    throws Exception {

    if (request.getParameter("treeid") != null) {

      PhyloTree pt = getPhyloTreeService().findByID(
        Long.parseLong(request.getParameter("treeid")));

      Map<String, String> treemap = new HashMap<String, String>();
      treemap.put("TreeId:" + pt.getId(), pt.getNewickString());
      request.getSession().setAttribute("NEWICKSTRINGSMAP", treemap);

    }

    return new ModelAndView(getDefaultView());
View Full Code Here

Examples of org.cipres.treebase.domain.tree.PhyloTree

    }

    if (pRequest.getParameter("treeid") != null) {

      String TreeId = pRequest.getParameter("treeid");
      PhyloTree aTree = getPhyloTreeService().findByID(Long.parseLong(TreeId));
      treeList.add(aTree);

      // use "T" to enable the edit menu items.
      treeMap.put(getMapKey(aTree), TreeId + separator + aTree.getNewickString() + separator
        + "T");
      phylowsMap.put(getMapKey(aTree), aTree.getTreebaseIDString().getNamespacedGUID().toString());
      newickStringName = aTree.getTitle();
      Study study = aTree.getStudy();
      if ( study != null && study.isPublished() ) {
        pRequest.getSession().setAttribute("treeBlockID", aTree.getTreeBlock().getId());
        pRequest.getSession().setAttribute("studyID", study.getId());
      }
      defaultNewick = aTree.getNewickString();
    }
   
    pRequest.getSession().setAttribute("DEFAULTNEWICK", defaultNewick);
    pRequest.getSession().setAttribute("NEWICKSTRINGSMAP", treeMap);
    pRequest.getSession().setAttribute("PHYLOWSMAP", phylowsMap);
View Full Code Here

Examples of org.phylowidget.ui.PhyloTree

  // parseMe = s;
  // trigger(200);
  // }

  public void run() {
    PhyloTree t = new PhyloTree();
    TreeIO.setOldTree(PhyloWidget.trees.getTree());// In this method newick String for uploaded
    // tree (oldnewick String) is saved ..
                            // Madhu..
    PhyloWidget.trees.setTree(TreeIO.parseNewickString(t, parseMe));
  }
View Full Code Here

Examples of org.phylowidget.ui.PhyloTree

  public synchronized void paste(RootedTree destTree, PhyloNode destNode)
  {
    if (isEmpty())
      throw new Error("Called TreeClipboard.paste() with empty clipboard");
    // Translate the newick string into a RooteTree.
    PhyloTree tree = new PhyloTree();
    TreeIO.parseNewickString(tree, newickString);
    // Add the clone's vertices and edges to the destination tree.
    synchronized (destTree)
    {
      Graphs.addGraph(destTree, tree);
      // Insert the clone's root vertex into the midpoint above destNode.
      if (destTree.getParentOf(destNode) == null)
      {
        destTree.addEdge(destNode, tree.getRoot());
      } else
      {
        Object internalVertex = destTree.createAndAddVertex("");
        destTree.insertNodeBetween(destTree.getParentOf(destNode),
            destNode, internalVertex);
        destTree.addEdge(internalVertex, tree.getRoot());
      }

      if (origTree != null)
      {
        if (origVertex.getState() == PhyloNode.CUT)
View Full Code Here

Examples of org.phylowidget.ui.PhyloTree

    /*
     * If we have a hovered node, always draw it.
     */
    if (tree instanceof PhyloTree)
    {
      PhyloTree pt = (PhyloTree) tree;
      PhyloNode h = pt.hoveredNode;
      if (h != null)
      {
        Point point = new Point(getX(h), getY(h));
        float dist = (float) point.distance(mousePt);
View Full Code Here

Examples of org.phylowidget.ui.PhyloTree

     * If we've got a PhyloTree on our hands,
     * let's take care of the hovered node.
     */
    if (tree instanceof PhyloTree)
    {
      PhyloTree pt = (PhyloTree) tree;
      PhyloNode h = pt.hoveredNode;
      if (h != null && h.getParent() != null)
      {
        canvas.stroke(style.hoverColor.getRGB());
        float weight = baseStroke * style.hoverStroke;
 
View Full Code Here

Examples of org.phylowidget.ui.PhyloTree

  // parseMe = s;
  // trigger(200);
  // }

  public void run() {
    PhyloTree t = new PhyloTree();
    TreeIO.setOldTree(PhyloWidget.trees.getTree());// In this method newick String for uploaded
    // tree (oldnewick String) is saved ..
    // Madhu..
    PhyloWidget.trees.setTree(TreeIO.parseNewickString(t, parseMe));
  }
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.