Example #1
0
  // print formatted info in no particular order
  public String getInfoString() {
    String s = "<HTML>";

    // gene info
    if (geneInfoSet) {
      s += "<B>";
      if (gene.getGeneType().equals(Gene.geneType.ENTREZ)) {
        s += "Entrez Gene";
      } else if (gene.getGeneType().equals(Gene.geneType.ENSEMBL)) {
        s += "Ensembl Gene";
      }
      s += "</B><BR>";
      String name = gene.getName();
      if (name != null) s += "Name: " + name + "<BR>";
      String description = gene.getDescription();
      if (description != null) s += "Description: " + description + "<BR>";
      String chromosome = gene.getChromosome();
      if (chromosome != null) s += "Chromosome: " + chromosome + "<BR>";
      s += "Start: " + gene.getStart() + "<BR>";
      s += "End: " + gene.getEnd() + "<BR>";
      s += "<BR>";
    }

    Iterator it = attributes.keySet().iterator();
    while (it.hasNext()) {
      String node = (String) it.next();
      if (node.equals("Graphics")) continue;
      s += "<B>" + node + "</B><BR>";
      Iterator currentIt = attributes.get(node).keySet().iterator();
      while (currentIt.hasNext()) {
        String key = (String) currentIt.next();
        s += key + ": " + attributes.get(node).get(key) + "<BR>";
      }
      s += "<BR>";
    }
    s += "</HTML>";
    return s;
  }