Esempio n. 1
0
 public PackageNode createNode(String oid) {
   DbPackage thePackage = DbPackage.read(db, oid);
   PackageNode n = new PackageNode(thePackage);
   n.updateTermNumber(db);
   n.setViewMode(defaultRelation);
   return n;
 }
Esempio n. 2
0
  /**
   * @param cutoff int , < 0 if no cutoff, >=0 the cutoff depth
   * @param from DBTreeNode
   * @since 2005-03-11
   */
  protected void buildTree(TypedTree tree, int cutoff, PackageNode from) {
    // if it's a null node
    if (from == null) {
      return;
    }
    if (cutoff != 0) {
      String ids = (String) from.getOid();
      Vector children = OntologyQuerier.getChildrenPackage(db, ids);

      System.out.println(ids + " -> " + children);
      for (int i = 0; i < children.size(); i++) {
        String kid = (String) children.elementAt(i);
        PackageNode node = createNode(kid);
        from.add(node);

        buildTree(tree, cutoff - 1, node);
      }
    }
    return;
  }