@Override public void addInstance(GKInstance instance) { SchemaClass cls = instance.getSchemClass(); if (!cls.isa(ReactomeJavaConstants.PhysicalEntity) || cls.isa(ReactomeJavaConstants.Complex)) return; // Only display non-complex PE in this class. DefaultMutableTreeNode clsNode = getClassNode(cls); DefaultMutableTreeNode instanceNode = new DefaultMutableTreeNode(instance); insertInstanceNodeAlphabetically(clsNode, instanceNode); }
private SchemaClass getDisplayedPESubclass(SchemaClass cls) { SchemaClass displayedCls = cls; // Only the first level of PE is displayed. Need to map it to one of // these subclasses XMLFileAdaptor fileAdaptor = PersistenceManager.getManager().getActiveFileAdaptor(); GKSchemaClass pe = (GKSchemaClass) fileAdaptor.getSchema().getClassByName(ReactomeJavaConstants.PhysicalEntity); for (Iterator it = pe.getSubClasses().iterator(); it.hasNext(); ) { GKSchemaClass sub = (GKSchemaClass) it.next(); if (cls.isa(sub)) { displayedCls = sub; break; } } return displayedCls; }