Search in sources :

Example 51 with BioPaxObject

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

the class PathwayGrouping method findGroupAncestor.

public BioPaxObject findGroupAncestor(Map<BioPaxObject, BioPaxObject> groupMap, BioPaxObject bpObject) {
    BioPaxObject ancestor = groupMap.get(bpObject);
    if (ancestor == null)
        return bpObject;
    else {
        BioPaxObject temp = groupMap.get(ancestor);
        while (temp != null) {
            ancestor = temp;
            temp = groupMap.get(ancestor);
        }
        return ancestor;
    }
}
Also used : BioPaxObject(org.vcell.pathway.BioPaxObject)

Example 52 with BioPaxObject

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

the class PathwayGrouping method updateBioPaxObjectList.

// get a list of independent biopax Objects including groupObjects
public Set<BioPaxObject> updateBioPaxObjectList(PathwayModel pathwayModel) {
    Set<BioPaxObject> clonedOriginalList = new HashSet<BioPaxObject>(pathwayModel.getBiopaxObjects());
    Set<BioPaxObject> removedList = new HashSet<BioPaxObject>();
    for (BioPaxObject bpObject : clonedOriginalList) {
        if (bpObject instanceof GroupObject) {
            GroupObject gObject = (GroupObject) bpObject;
            for (BioPaxObject bpo : gObject.getGroupedObjects()) {
                removedList.add(bpo);
            }
        }
    }
    clonedOriginalList.removeAll(removedList);
    return clonedOriginalList;
}
Also used : BioPaxObject(org.vcell.pathway.BioPaxObject) GroupObject(org.vcell.pathway.GroupObject) HashSet(java.util.HashSet)

Example 53 with BioPaxObject

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

the class PathwayGrouping method updateGroupableList.

private HashSet<BioPaxObject> updateGroupableList(PathwayModel pathwayModel, HashSet<BioPaxObject> bpObjects) {
    HashSet<BioPaxObject> groupable = new HashSet<BioPaxObject>();
    Map<BioPaxObject, BioPaxObject> groupMap = pathwayModel.getGroupMap();
    // the group object should be a tree structure. so we will group the parents of the selected objects together.
    for (BioPaxObject bpObject : bpObjects) {
        groupable.add(findGroupAncestor(groupMap, bpObject));
    }
    return groupable;
}
Also used : BioPaxObject(org.vcell.pathway.BioPaxObject) HashSet(java.util.HashSet)

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