コード例 #1
0
 @Override
 public String getVertexName(String object) {
   Tree node = vertexMap.get(object);
   String name = "";
   if (node != null) {
     if (node.isLeaf()) {
       name = node.getLabel();
     } else {
       Iterator<Edge> e = node.childIterator();
       while (e.hasNext()) {
         SplitCondition condition = e.next().getCondition();
         name = condition.getAttributeName();
         break;
       }
     }
   }
   return name;
 }
コード例 #2
0
 @Override
 public String getVertexToolTip(String object) {
   Tree tree = vertexMap.get(object);
   if (tree != null) {
     StringBuffer result = new StringBuffer();
     if (tree.isLeaf()) {
       String labelString = tree.getLabel();
       if (labelString != null) {
         result.append("<html><b>Class:</b>&nbsp;" + labelString + "<br>");
         result.append("<b>Size:</b>&nbsp;" + tree.getFrequencySum() + "<br>");
         result.append(
             "<b>Class frequencies:</b>&nbsp;"
                 + SwingTools.transformToolTipText(tree.getCounterMap().toString())
                 + "</html>");
       }
     } else {
       result.append(
           "<html><b>Subtree Size:</b>&nbsp;" + tree.getSubtreeFrequencySum() + "</html>");
     }
     return result.toString();
   } else {
     return null;
   }
 }