in CasViewerEclipsePlugin/uimaj-ep-casviewer/src/main/java/org/apache/uima/uct/viewer/internal/page/CASViewControl.java [758:811]
protected void showTypeSystem() {
// Create Type System Tree
typesystemTree = casViewObject.getTypeTree();
// ONLY show background color to node of type having annotations.
// The type itself has the BG color from default style or imported style.
List<Type> typesHavingAnnotations = casViewObject.getTypesHavingAnnotations();
if (typesHavingAnnotations != null) {
for (Type t: typesHavingAnnotations) {
TypeNode node = typesystemTree.getTypeNode(t.getName());
if (node != null) {
// Assign color to node
TypeStyle s = typesystemStyle.getTypeStyle(t.getName());
if (s.isHidden()) {
node.setHidden(true);
}
node.setBgColor(s.getBackground());
}
}
}
// Set total annotations for each type's branch in the tree
List list = typesystemTree.getTypeListFromHierarchy(true, false);
if (list != null) {
for (int i = 0; i < list.size(); ++i) {
if (list.get(i) instanceof TypeDescription) {
Type type = casViewObject
.getTypeFromTypeSystem(((TypeDescription) list.get(i))
.getName());
if (type != null) {
TypeNode node = typesystemTree.getTypeNode(type.getName());
if (node == null) {
// Trace.trace("NOT in tree: " +
// type.getShortName());
continue;
}
// Set total FS for this type
FSIndex fsIndex = CasHelper.getIndexForType(
casViewObject.getCurrentView(), type);
if (fsIndex != null) {
// This number includes FS from sub-types
node.setFsTotal(fsIndex.size());
}
node.setFsCount(CasHelper.getTotalFSForType(
casViewObject.getCurrentView(), type));
}
}
}
}
// Update Type System Section
// typeTreeSection.setTypeSystemStyle(casViewObject.getTypeSystemStyle());
typeTreeSection.setInput(typesystemTree, null);
} // showTypeSystem