Search in sources :

Example 46 with BioPaxObject

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

the class RelationshipModel method removeRelationshipObjects.

public boolean removeRelationshipObjects(List<BioPaxObject> bioPaxObjects) {
    // deletebuttonPressed() in BioModelEditorPathwayDiagramPanel
    if (bioPaxObjects == null) {
        throw new RuntimeException("remove a null object from relationship model");
    }
    boolean bRemoved = false;
    for (BioPaxObject bpObject : bioPaxObjects) {
        Iterator<RelationshipObject> iter = relationshipObjects.iterator();
        while (iter.hasNext()) {
            RelationshipObject relationshipObject = iter.next();
            if (relationshipObject.getBioPaxObject() == bpObject) {
                iter.remove();
                fireRelationshipChanged(new RelationshipEvent(this, relationshipObject, RelationshipEvent.REMOVED));
                bRemoved = true;
            }
        }
    }
    return bRemoved;
}
Also used : BioPaxObject(org.vcell.pathway.BioPaxObject)

Example 47 with BioPaxObject

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

the class PathwayReader method addAttributes.

private void addAttributes(BioPaxObject bioPaxObject, Element element) {
    for (Object attr : element.getAttributes()) {
        Attribute attribute = (Attribute) attr;
        if (attribute.getName().equals("ID")) {
            if (bioPaxObject instanceof RdfObjectProxy) {
                showUnexpected(attribute, bioPaxObject);
            } else {
                String uri = context.unAbbreviateURI(element, attribute.getValue());
                bioPaxObject.setID(uri);
            }
        } else if (attribute.getName().equals("resource")) {
            if (bioPaxObject instanceof RdfObjectProxy) {
                String uri = context.unRelativizeURI(element, attribute.getValue());
                bioPaxObject.setID(uri);
            } else {
                showUnexpected(attribute, bioPaxObject);
            }
        } else {
            showUnexpected(attribute, bioPaxObject);
        }
    }
}
Also used : Attribute(org.jdom.Attribute) BioPaxObject(org.vcell.pathway.BioPaxObject) RdfObjectProxy(org.vcell.pathway.persistence.BiopaxProxy.RdfObjectProxy)

Example 48 with BioPaxObject

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

the class PathwayGrouping method updateGroupObjectList.

// get a list of group objects in a pathway model
public Set<BioPaxObject> updateGroupObjectList(PathwayModel pathwayModel) {
    Set<BioPaxObject> groupList = new HashSet<BioPaxObject>();
    Set<BioPaxObject> originalList = pathwayModel.getBiopaxObjects();
    for (BioPaxObject bpObject : originalList) {
        if (bpObject instanceof GroupObject) {
            groupList.add(bpObject);
        }
    }
    return groupList;
}
Also used : BioPaxObject(org.vcell.pathway.BioPaxObject) GroupObject(org.vcell.pathway.GroupObject) HashSet(java.util.HashSet)

Example 49 with BioPaxObject

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

the class PathwayGrouping method groupIdGenerator.

// generate auto-ID for groupObject
public String groupIdGenerator(PathwayModel pathwayModel) {
    String groupId = "GROUP_";
    int idx = 0;
    for (BioPaxObject bpo : updateGroupObjectList(pathwayModel)) {
        int i = Integer.parseInt(bpo.getID().substring(6));
        if (idx < i) {
            idx = i;
        }
    }
    groupId += (idx + 1);
    return groupId;
}
Also used : BioPaxObject(org.vcell.pathway.BioPaxObject)

Example 50 with BioPaxObject

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

the class PathwayGrouping method createGroupObject.

// create a group object in pathway model
public GroupObject createGroupObject(PathwayModel pathwayModel, ArrayList<String> names, String id, HashSet<BioPaxObject> bpObjects, GroupObject.Type newType) {
    HashSet<BioPaxObject> groupable = updateGroupableList(pathwayModel, bpObjects);
    if (groupable.size() <= 1)
        return null;
    GroupObject gObject = new GroupObject();
    gObject.setName(names);
    gObject.setID(id);
    gObject.setGroupedeObjects(groupable);
    gObject.setType(newType);
    return gObject;
}
Also used : BioPaxObject(org.vcell.pathway.BioPaxObject) GroupObject(org.vcell.pathway.GroupObject)

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