featVal = featVal.substring(0, 64) + "...";
}
} else if (rangeType.isPrimitive()) {
featVal = aFS.getFeatureValueAsString(feat);
} else if (mCAS.getTypeSystem().subsumes(mFsArrayType, rangeType)) {
ArrayFS arrayFS = (ArrayFS) aFS.getFeatureValue(feat);
if (arrayFS != null) {
// Add featName = FSArray node, then add each array element as a child
DefaultMutableTreeNode arrayNode = new DefaultMutableTreeNode(featName + " = FSArray");
for (int i = 0; i < arrayFS.size(); i++) {
FeatureStructure fsVal = arrayFS.get(i);
if (fsVal != null) {
// Add the FS node and a dummy child, so that user can expand it.
// When user expands it, new nodes for feature values will be created.
DefaultMutableTreeNode fsValNode = new DefaultMutableTreeNode(new FsTreeNodeObject(
fsVal, featName));
if (!fsVal.getType().getFeatures().isEmpty()) {
fsValNode.add(new DefaultMutableTreeNode(null));
}
arrayNode.add(fsValNode);
} else {
arrayNode.add(new DefaultMutableTreeNode("null"));
}
}
aParentNode.add(arrayNode);
continue;
}
} else if (rangeType.isArray()) // primitive array
{
String[] vals = null;
if (CAS.TYPE_NAME_STRING_ARRAY.equals(rangeTypeName)) {
StringArrayFSImpl arrayFS = (StringArrayFSImpl) aFS.getFeatureValue(feat);
if (arrayFS != null)
vals = arrayFS.toArray();
} else if (CAS.TYPE_NAME_INTEGER_ARRAY.equals(rangeTypeName)) {
IntArrayFSImpl arrayFS = (IntArrayFSImpl) aFS.getFeatureValue(feat);
if (arrayFS != null)
vals = arrayFS.toStringArray();
} else if (CAS.TYPE_NAME_FLOAT_ARRAY.equals(rangeTypeName)) {
FloatArrayFSImpl arrayFS = (FloatArrayFSImpl) aFS.getFeatureValue(feat);
if (arrayFS != null)
vals = arrayFS.toStringArray();
} else if (CAS.TYPE_NAME_BOOLEAN_ARRAY.equals(rangeTypeName)) {
BooleanArrayFSImpl arrayFS = (BooleanArrayFSImpl) aFS.getFeatureValue(feat);
if (arrayFS != null)
vals = arrayFS.toStringArray();
} else if (CAS.TYPE_NAME_BYTE_ARRAY.equals(rangeTypeName)) {
ByteArrayFSImpl arrayFS = (ByteArrayFSImpl) aFS.getFeatureValue(feat);
if (arrayFS != null)
vals = arrayFS.toStringArray();
} else if (CAS.TYPE_NAME_SHORT_ARRAY.equals(rangeTypeName)) {
ShortArrayFSImpl arrayFS = (ShortArrayFSImpl) aFS.getFeatureValue(feat);
if (arrayFS != null)
vals = arrayFS.toStringArray();
} else if (CAS.TYPE_NAME_LONG_ARRAY.equals(rangeTypeName)) {
LongArrayFSImpl arrayFS = (LongArrayFSImpl) aFS.getFeatureValue(feat);
if (arrayFS != null)
vals = arrayFS.toStringArray();
}
if (CAS.TYPE_NAME_DOUBLE_ARRAY.equals(rangeTypeName)) {
DoubleArrayFSImpl arrayFS = (DoubleArrayFSImpl) aFS.getFeatureValue(feat);
if (arrayFS != null)
vals = arrayFS.toStringArray();
}
if (vals == null) {
featVal = "null";
} else {
StringBuffer displayVal = new StringBuffer();