use of org.vcell.pathway.GroupNeighbor in project vcell by virtualcell.
the class PathwayGraphModel method refreshGroup.
private BioPaxGroupNeighborShape refreshGroup(PathwayContainerShape pathwayContainerShape, BioPaxObject ancObject, BioPaxShape bioPaxShape, InteractionParticipant participant) {
if (ancObject == null)
return null;
if (ancObject instanceof GroupObject) {
GroupObject groupObject = (GroupObject) ancObject;
Shape shapeG = getShapeFromModelObject(groupObject);
if (shapeG instanceof BioPaxGroupShape) {
BioPaxGroupShape groupShape = (BioPaxGroupShape) shapeG;
if (bioPaxShape instanceof BioPaxInteractionShape) {
BioPaxInteractionShape interactionShape = (BioPaxInteractionShape) bioPaxShape;
GroupNeighbor groupNeighbor = new GroupNeighbor(groupObject, interactionShape.getInteraction(), participant.getType());
BioPaxGroupNeighborShape neighborShape = (BioPaxGroupNeighborShape) getShapeFromModelObject(groupNeighbor);
if (neighborShape == null) {
neighborShape = new BioPaxGroupNeighborShape(groupNeighbor, interactionShape, groupShape, this);
pathwayContainerShape.addChildShape(neighborShape);
addShape(neighborShape);
}
return neighborShape;
} else if (bioPaxShape instanceof BioPaxGroupShape) {
BioPaxGroupShape groupConversionShape = (BioPaxGroupShape) bioPaxShape;
GroupNeighbor groupNeighbor = new GroupNeighbor(groupConversionShape.getGroupObject(), groupObject, participant.getType());
BioPaxGroupNeighborShape neighborShape = (BioPaxGroupNeighborShape) getShapeFromModelObject(groupNeighbor);
if (neighborShape == null) {
neighborShape = new BioPaxGroupNeighborShape(groupNeighbor, groupConversionShape, groupShape, this);
pathwayContainerShape.addChildShape(neighborShape);
addShape(neighborShape);
}
return neighborShape;
}
}
}
return null;
}
use of org.vcell.pathway.GroupNeighbor in project vcell by virtualcell.
the class PathwayGraphModel method refreshGroupInteraction.
private void refreshGroupInteraction(GroupObject groupObject, InteractionParticipant participant) {
BioPaxGroupShape groupShape = (BioPaxGroupShape) getShapeFromModelObject(groupObject);
PhysicalEntity physicalEntity = participant.getPhysicalEntity();
GroupNeighbor groupNeighbor = new GroupNeighbor(groupObject, physicalEntity, participant.getType());
BioPaxGroupNeighborShape edgeShape = (BioPaxGroupNeighborShape) getShapeFromModelObject(groupNeighbor);
BioPaxObject ancestorObject = pathwayModel.findTopLevelGroupAncestor(physicalEntity);
if (edgeShape == null) {
Shape shape = getShapeFromModelObject(physicalEntity);
if (shape instanceof BioPaxPhysicalEntityShape) {
BioPaxPhysicalEntityShape physicalEntityShape = (BioPaxPhysicalEntityShape) shape;
edgeShape = new BioPaxGroupNeighborShape(groupNeighbor, groupShape, physicalEntityShape, this);
pathwayContainerShape.addChildShape(edgeShape);
addShape(edgeShape);
}
} else {
// edges without end objects will be removed
if (ancestorObject != physicalEntity) {
// for grouped objects
removeEdgeShape(edgeShape);
}
}
unwantedShapes.remove(refreshGroup(pathwayContainerShape, ancestorObject, groupShape, participant));
unwantedShapes.remove(edgeShape);
}
Aggregations