Exemplo 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;
 }
Exemplo 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;
 }
Exemplo 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;
  }
Exemplo 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);
   }
 }
Exemplo n.º 5
0
 private void init() {
   initGetterMap();
   initSetterMap();
   allKeywords.addElement(this);
   initPopupMenu();
 }
Exemplo n.º 6
0
 public Collection getConnectedNodes() {
   Vector connectedNodes = new Vector();
   connectedNodes.addElement(Keyword.class);
   return connectedNodes;
 }
Exemplo n.º 7
0
 public Iterator getChildrenIterator() {
   return (children.iterator());
 }
Exemplo n.º 8
0
 public void addChild(Keyword keyword) {
   if (!children.contains(keyword)) children.add(keyword);
 }