Search in sources :

Example 41 with BioPaxObject

use of org.vcell.pathway.BioPaxObject in project vcell by virtualcell.

the class PhysiologyRelationshipTableModel method getValueAt.

public Object getValueAt(int iRow, int iCol) {
    PhysiologyRelationshipTableRow entitySelectionTableRow = getValueAt(iRow);
    BioPaxObject bpObject = entitySelectionTableRow.getBioPaxObject();
    switch(iCol) {
        case iColSelected:
            {
                return entitySelectionTableRow.selected();
            }
        case iColEntity:
            {
                return getLabel(bpObject);
            }
        case iColType:
            {
                return getType(bpObject);
            }
        default:
            {
                return null;
            }
    }
}
Also used : BioPaxObject(org.vcell.pathway.BioPaxObject)

Example 42 with BioPaxObject

use of org.vcell.pathway.BioPaxObject in project vcell by virtualcell.

the class PhysiologyRelationshipTableModel method refreshData.

private void refreshData() {
    ArrayList<PhysiologyRelationshipTableRow> pathwayObjectList = new ArrayList<PhysiologyRelationshipTableRow>();
    if (bioModel != null) {
        HashSet<RelationshipObject> relationshipObjects = null;
        if (bioModelEntityObject != null) {
            relationshipObjects = bioModel.getRelationshipModel().getRelationshipObjects(bioModelEntityObject);
        }
        List<PhysiologyRelationshipTableRow> allPathwayObjectList = new ArrayList<PhysiologyRelationshipTableRow>();
        for (BioPaxObject bpObject1 : bioModel.getPathwayModel().getBiopaxObjects()) {
            if ((bpObject1 instanceof PhysicalEntity && (bioModelEntityObject == null || bioModelEntityObject instanceof SpeciesContext)) || (bpObject1 instanceof Conversion && (bioModelEntityObject == null || bioModelEntityObject instanceof ModelProcess)) || (bpObject1 instanceof PhysicalEntity && (bioModelEntityObject == null || bioModelEntityObject instanceof MolecularType))) {
                PhysiologyRelationshipTableRow entityRow = new PhysiologyRelationshipTableRow(bpObject1);
                if (relationshipObjects != null) {
                    for (RelationshipObject ro : relationshipObjects) {
                        if (ro.getBioPaxObject() == entityRow.getBioPaxObject()) {
                            entityRow.setSelected(true);
                            break;
                        }
                    }
                }
                if (!bShowLinkOnly || entityRow.selected) {
                    allPathwayObjectList.add(entityRow);
                }
            }
        }
        if (searchText == null || searchText.length() == 0) {
            pathwayObjectList.addAll(allPathwayObjectList);
        } else {
            for (PhysiologyRelationshipTableRow rs : allPathwayObjectList) {
                BioPaxObject bpObject = rs.getBioPaxObject();
                String lowerCaseSearchText = searchText.toLowerCase();
                if (getLabel(bpObject).toLowerCase().contains(lowerCaseSearchText) || getType(bpObject).toLowerCase().contains(lowerCaseSearchText)) {
                    pathwayObjectList.add(rs);
                }
            }
        }
    }
    setData(pathwayObjectList);
    GuiUtils.flexResizeTableColumns(ownerTable);
}
Also used : BioPaxObject(org.vcell.pathway.BioPaxObject) ArrayList(java.util.ArrayList) ModelProcess(cbit.vcell.model.ModelProcess) SpeciesContext(cbit.vcell.model.SpeciesContext) RelationshipObject(org.vcell.relationship.RelationshipObject) Conversion(org.vcell.pathway.Conversion) MolecularType(org.vcell.model.rbm.MolecularType) PhysicalEntity(org.vcell.pathway.PhysicalEntity)

Example 43 with BioPaxObject

use of org.vcell.pathway.BioPaxObject in project vcell by virtualcell.

the class RelationshipObject method createRelationshipObject.

public static RelationshipObject createRelationshipObject(VCID bioModelObjectID, VCID bioPaxObjectID, IdentifiableProvider provider) {
    if (bioModelObjectID == null || bioPaxObjectID == null) {
        return null;
    }
    BioModelEntityObject bmo = (BioModelEntityObject) provider.getIdentifiableObject(bioModelObjectID);
    BioPaxObject bpo = (BioPaxObject) provider.getIdentifiableObject(bioPaxObjectID);
    return new RelationshipObject(bmo, bpo);
}
Also used : BioPaxObject(org.vcell.pathway.BioPaxObject) BioModelEntityObject(cbit.vcell.model.BioModelEntityObject)

Example 44 with BioPaxObject

use of org.vcell.pathway.BioPaxObject in project vcell by virtualcell.

the class PathwayReaderBiopax3 method addAttributes.

private void addAttributes(BioPaxObject bioPaxObject, Element element) {
    int count = 0;
    for (Object attr : element.getAttributes()) {
        Attribute attribute = (Attribute) attr;
        if (attribute.getName().equals("ID")) {
            if (bioPaxObject instanceof RdfObjectProxy) {
                showUnexpected(attribute);
            } else {
                String uri = context.unAbbreviateURI(element, attribute.getValue());
                bioPaxObject.setID(uri);
                count++;
            }
        } else if (attribute.getName().equals("resource")) {
            if (bioPaxObject instanceof RdfObjectProxy) {
                String uri = context.unRelativizeURI(element, attribute.getValue());
                bioPaxObject.setID(uri);
                count++;
            } else {
                showUnexpected(attribute);
            }
        } else if (attribute.getName().equals("about")) {
            if (bioPaxObject instanceof RdfObjectProxy) {
                // TODO: can this ever happen?
                String uri = context.unRelativizeURI(element, attribute.getValue());
                bioPaxObject.setID(uri);
                count++;
            } else {
                String uri = context.unRelativizeURI(element, attribute.getValue());
                bioPaxObject.setID(uri);
                count++;
            }
        } else if (attribute.getName().equals("nodeID")) {
            if (bioPaxObject instanceof RdfObjectProxy) {
                // TODO: can this ever happen?
                ((RdfObjectProxy) bioPaxObject).setID(attribute.getValue());
                count++;
            } else {
                bioPaxObject.setID(attribute.getValue());
                count++;
            }
        } else {
            showUnexpected(attribute);
        }
    }
    if (count < 1) {
        System.out.println(element + " has neither ID nor resource attributes.");
    }
    if (count > 1) {
        System.out.println(element + " has multiple ID and/or resource attributes.");
    }
}
Also used : Attribute(org.jdom.Attribute) GroupObject(org.vcell.pathway.GroupObject) BioPaxObject(org.vcell.pathway.BioPaxObject) RdfObjectProxy(org.vcell.pathway.persistence.BiopaxProxy.RdfObjectProxy)

Example 45 with BioPaxObject

use of org.vcell.pathway.BioPaxObject in project vcell by virtualcell.

the class BioPAXPathwayModelTreeNode method getNewChildren.

public List<BioPAXTreeNode> getNewChildren() {
    Set<BioPaxObject> objects = getPathwayModel().getBiopaxObjects();
    Map<Class<?>, Set<BioPaxObject>> subclassMap = BioPAXTreeMaker.divideBySubclasses(BioPaxObject.class, objects);
    List<BioPAXTreeNode> childrenNew = new ArrayList<BioPAXTreeNode>();
    for (Map.Entry<Class<?>, Set<BioPaxObject>> entry : subclassMap.entrySet()) {
        Class<?> subclass = entry.getKey();
        Set<BioPaxObject> objectsOfSubclass = entry.getValue();
        List<BioPaxObject> objectsOfSubclassList = new ArrayList<BioPaxObject>();
        objectsOfSubclassList.addAll(objectsOfSubclass);
        childrenNew.add(new BioPAXObjectListTreeNode<BioPaxObject>(getPathwayModel(), objectsOfSubclassList, subclass, this));
    }
    // for(BioPaxObject object : objects) {
    // children.add(
    // new BioPAXMessageTreeNode(getPathwayModel(), object.toString(), this));
    // }
    // TODO
    int nObjects = pathwayModel.getBiopaxObjects().size();
    Pathway topLevelPathway = pathwayModel.getTopLevelPathway();
    if (topLevelPathway != null) {
        List<String> nameList = topLevelPathway.getName();
        if (nameList != null && !nameList.isEmpty()) {
        }
    }
    labelText = nObjects + " objects";
    return childrenNew;
}
Also used : Set(java.util.Set) BioPaxObject(org.vcell.pathway.BioPaxObject) Pathway(org.vcell.pathway.Pathway) ArrayList(java.util.ArrayList) Map(java.util.Map)

Aggregations

BioPaxObject (org.vcell.pathway.BioPaxObject)53 GroupObject (org.vcell.pathway.GroupObject)21 ArrayList (java.util.ArrayList)15 HashSet (java.util.HashSet)14 PhysicalEntity (org.vcell.pathway.PhysicalEntity)14 RelationshipObject (org.vcell.relationship.RelationshipObject)14 ActiveView (cbit.vcell.client.desktop.biomodel.SelectionManager.ActiveView)9 Conversion (org.vcell.pathway.Conversion)9 BioModelEntityObject (cbit.vcell.model.BioModelEntityObject)8 SpeciesContext (cbit.vcell.model.SpeciesContext)7 Entity (org.vcell.pathway.Entity)7 Complex (org.vcell.pathway.Complex)6 Control (org.vcell.pathway.Control)6 InteractionParticipant (org.vcell.pathway.InteractionParticipant)6 Dimension (java.awt.Dimension)5 MouseAdapter (java.awt.event.MouseAdapter)5 MouseEvent (java.awt.event.MouseEvent)5 JLabel (javax.swing.JLabel)5 JPanel (javax.swing.JPanel)5 MolecularType (org.vcell.model.rbm.MolecularType)5