Ejemplo n.º 1
0
 public Vector getAssociatedLevelLists() {
   Vector levelLists = new Vector();
   Vector endPts = CollectionHelper.makeVector("Keyword");
   Hashtable keywordParents =
       oncotcap.Oncotcap.getDataSource()
           .getParentTree(
               "Keyword", endPts, CollectionHelper.makeVector(this), TreeDisplayModePanel.ROOT);
   // Take each of the parents and get the associated level lists
   if (keywordParents.size() <= 0) return levelLists;
   Hashtable levelListsHashtable =
       oncotcap.Oncotcap.getDataSource()
           .getInstanceTree(
               "EnumLevelList",
               new Vector(),
               makeLevelListFilter(keywordParents),
               TreeDisplayModePanel.ROOT);
   for (Enumeration e = keywordParents.keys(); e.hasMoreElements(); ) {
     System.out.println("Keyword.getAssociatedLevelLists: " + e.nextElement());
   }
   // Collect all the level lists from the hashtable
   Vector selectedItems = CollectionHelper.makeVector(keyword);
   for (Enumeration e = levelListsHashtable.keys(); e.hasMoreElements(); ) {
     Object obj = e.nextElement();
     if (obj instanceof EnumLevelList) {
       levelLists.addElement(obj);
     }
   }
   return levelLists;
 }
Ejemplo n.º 2
0
 private Vector getChildren(Keyword keyword, Vector allKids) {
   allKids.addElement(keyword);
   // 			System.out.println("Addtoallkids " + keyword + "  " + allKids );
   Vector children = keyword.getChildren();
   if (children != null) {
     Iterator i = children.iterator();
     while (i.hasNext()) {
       Keyword child = (Keyword) i.next();
       getChildren(child, allKids);
     }
   }
   return allKids;
 }
Ejemplo n.º 3
0
  public static Vector extractKeywordFromText(String text) {
    // see if there are any existing keywords represented
    // in this text
    // Get all keywords

    Vector extractedKeywords = new Vector();
    Iterator keywords = allKeywords.iterator();
    while (keywords.hasNext()) {
      Keyword keyword = (Keyword) keywords.next();
      if (text != null
          && keyword.toString() != null
          && text.toLowerCase().indexOf(keyword.toString().toLowerCase()) > -1) {
        extractedKeywords.addElement(keyword);
      }
    }
    return extractedKeywords;
  }
Ejemplo n.º 4
0
 public void unlink(oncotcap.datalayer.Persistible relatedPersistible) {
   if (relatedPersistible instanceof Keyword) {
     // 						System.out.println("removing the keyword p/c" + relatedPersistible);
     if (children != null) children.remove(relatedPersistible);
     if (parentKeywords != null) parentKeywords.remove(relatedPersistible);
   } else {
     // 					System.out.println("removing the keyword described instance"
     // 															 + relatedPersistible
     // 															 + " from list " + describedInstances);
     if (describedInstances != null) describedInstances.remove(relatedPersistible);
   }
 }
Ejemplo n.º 5
0
 private void init() {
   initGetterMap();
   initSetterMap();
   allKeywords.addElement(this);
   initPopupMenu();
 }
Ejemplo n.º 6
0
 public Collection getConnectedNodes() {
   Vector connectedNodes = new Vector();
   connectedNodes.addElement(Keyword.class);
   return connectedNodes;
 }
Ejemplo n.º 7
0
 public Iterator getChildrenIterator() {
   return (children.iterator());
 }
Ejemplo n.º 8
0
 public void addChild(Keyword keyword) {
   if (!children.contains(keyword)) children.add(keyword);
 }