DefaultMutableTreeNode root = (DefaultMutableTreeNode) tree.getModel().getRoot();
for (int i = 0; i < root.getChildCount(); i++) {
DefaultMutableTreeNode event = (DefaultMutableTreeNode) root.getChildAt(i);
for (int j = 0; j < event.getChildCount(); j++) {
DefaultMutableTreeNode subEvent = (DefaultMutableTreeNode) event.getChildAt(j);
for (int k = 0; k < subEvent.getChildCount(); k++) {
DefaultMutableTreeNode rec = (DefaultMutableTreeNode) subEvent.getChildAt(k);
Object ob = rec.getUserObject();
if (ob instanceof DescriptionResult) {
DescriptionResult temp = (DescriptionResult) ob;
allActiveTemplateRecords.add(temp);
DESCRIPTION_RESULT dt = new DESCRIPTION_RESULT(Global.conn, temp.getId(), true);
formPanel.addRow(temp.getName(), temp.getId(), dt.getCText());
}
if (ob instanceof DescriptionTemplate) {
DescriptionTemplate temp = (DescriptionTemplate) ob;
if(temp.getEditStatus()) {
allActiveTemplateRecords.add(temp);
DESCRIPTION_TEMPLATE dt = new DESCRIPTION_TEMPLATE(Global.conn, temp.getId(), true);
formPanel.addRow(temp.getText(), temp.getId(), dt.getCText());
}
}
if (ob instanceof Protocol) {
Protocol temp = (Protocol) ob;
formPanel.addProtocolFormRow(temp.getId(), visitId, temp.getFormId(), temp.getText());
}
}
}
}