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;
}
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);
}
}
}
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;
}
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;
}
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;
}
Aggregations