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