Package org.apache.uima.ruta.caseditor.view.tree

Examples of org.apache.uima.ruta.caseditor.view.tree.TypeTreeNode


        String name = TextUtils.shrinkNamespace(fnNode.getAnnotation().getType().getName());
        return (name + ": " + coveredText);
      }
    }
    if (element instanceof TypeTreeNode) {
      TypeTreeNode testNode = (TypeTreeNode) element;
      return TextUtils.shrinkNamespace(testNode.getType().getName());
    }
    if (element instanceof PrimitiveFeatureTreeNode) {
      PrimitiveFeatureTreeNode fNode = (PrimitiveFeatureTreeNode) element;
      return fNode.getName();
    }
View Full Code Here


    this.type = type;
  }

  public Object[] getChildren(Object parentElement) {
    if (parentElement instanceof TestEvaluationTree) {
      TypeTreeNode root = (TypeTreeNode) ((TestEvaluationTree) parentElement).getRoot();
      if (root == null) {
        return empty;
      }
      for (ITreeNode node : root.getChildren()) {
        if (node instanceof TypeTreeNode) {
          if (((TypeTreeNode) node).getType().getName().equals(type)) {
            return node.getChildren();
          }
        }
      }
    }
    if (parentElement instanceof TypeTreeNode) {
      TypeTreeNode node = (TypeTreeNode) parentElement;
      return node.getChildren();
    }
    if (parentElement instanceof AnnotationTreeNode) {
      AnnotationTreeNode node = (AnnotationTreeNode) parentElement;
      return node.getChildren();
    }
    return empty;
  }
View Full Code Here

    return null;
  }

  public boolean hasChildren(Object element) {
    if (element instanceof TestEvaluationTree) {
      TypeTreeNode root = (TypeTreeNode) ((TestEvaluationTree) element).getRoot();
      return root.hasChildren();

    }
    if (element instanceof ITreeNode) {
      return ((ITreeNode) element).hasChildren();
    }
View Full Code Here

    if (falsePositiveType == null || falseNegativeType == null) {
      return;
    }
    // Creating RootNode and children that function as root nodes
    // for the FalsePositive /FalseNegative subtrees
    root = new TypeTreeNode(null, cas.getAnnotationType());

    TypeTreeNode fproot = new TypeTreeNode(root, falsePositiveType);
    TypeTreeNode fnroot = new TypeTreeNode(root, falseNegativeType);
    TypeTreeNode tproot = new TypeTreeNode(root, truePositiveType);

    // Iterating through CAS and adding nodes to according subtrees

    addEvalNodes(cas, falsePositiveType, fproot);
    addEvalNodes(cas, falseNegativeType, fnroot);
View Full Code Here

      FeatureStructure fs = iter.get();
      if (fs instanceof AnnotationFS) {
        AnnotationFS a = (AnnotationFS) fs;
        Feature original = fs.getType().getFeatureByBaseName(ICasEvaluator.ORIGINAL);
        FeatureStructure originalfs = fs.getFeatureValue(original);
        TypeTreeNode parentTypeNode = containsTypeNode(fproot, originalfs);
        if (parentTypeNode == null && originalfs != null) {
          parentTypeNode = new TypeTreeNode(fproot, originalfs.getType());
          fproot.addChild(parentTypeNode);
        }
        AnnotationTreeNode newNode = new AnnotationTreeNode(parentTypeNode, a);
        if (parentTypeNode != null) {
          parentTypeNode.addChild(newNode);
        } else {
          RutaAddonsPlugin.error(new IllegalArgumentException(
                  "Trying to display unknown type for " + a));
        }
      }
View Full Code Here

  private TypeTreeNode containsTypeNode(TypeTreeNode fproot, FeatureStructure originalfs) {
    ITreeNode[] children = fproot.getChildren();
    for (ITreeNode each : children) {
      if (each instanceof TypeTreeNode) {
        TypeTreeNode node = (TypeTreeNode) each;
        if (node.getType().equals(originalfs.getType())) {
          return node;
        }
      }
    }
    return null;
View Full Code Here

        String name = TextUtils.shrinkNamespace(fnNode.getAnnotation().getType().getName());
        return (name + ": " + coveredText);
      }
    }
    if (element instanceof TypeTreeNode) {
      TypeTreeNode testNode = (TypeTreeNode) element;
      return TextUtils.shrinkNamespace(testNode.getType().getName());
    }
    if (element instanceof FeatureTreeNode) {
      FeatureTreeNode fNode = (FeatureTreeNode) element;
      return fNode.getName();
    }
View Full Code Here

TOP

Related Classes of org.apache.uima.ruta.caseditor.view.tree.TypeTreeNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.