Search in sources :

Example 1 with SBState

use of org.vcell.pathway.sbpax.SBState in project vcell by virtualcell.

the class PathwayReaderBiopax3 method addObjectSBState.

private SBState addObjectSBState(Element element) {
    if (element.getChildren().size() == 0) {
        SBStateProxy proxy = new SBStateProxy();
        addAttributes(proxy, element);
        pathwayModel.add(proxy);
        return proxy;
    }
    SBState sbState = new SBState();
    addAttributes(sbState, element);
    for (Object child : element.getChildren()) {
        if (child instanceof Element) {
            Element childElement = (Element) child;
            if (!addContentSBState(sbState, element, childElement)) {
                showUnexpected(childElement);
            }
        }
    }
    pathwayModel.add(sbState);
    return sbState;
}
Also used : SBStateProxy(org.vcell.pathway.persistence.BiopaxProxy.SBStateProxy) Element(org.jdom.Element) GroupObject(org.vcell.pathway.GroupObject) BioPaxObject(org.vcell.pathway.BioPaxObject) SBState(org.vcell.pathway.sbpax.SBState)

Example 2 with SBState

use of org.vcell.pathway.sbpax.SBState in project vcell by virtualcell.

the class PathwayReaderBiopax3 method addObjectSBEntity.

// ---------------- addObject section ---------------------
// 
private SBEntity addObjectSBEntity(Element element) {
    if (element.getChildren().size() == 0) {
        SBEntityProxy proxy = new SBEntityProxy();
        addAttributes(proxy, element);
        pathwayModel.add(proxy);
        return proxy;
    }
    for (Object child : element.getChildren()) {
        if (child instanceof Element) {
            Element childElement = (Element) child;
            if (childElement.getName().equals("SBMeasurable")) {
                SBMeasurable thingie = addObjectSBMeasurable(childElement);
                pathwayModel.add(thingie);
                return thingie;
            } else if (childElement.getName().equals("SBState")) {
                SBState thingie = addObjectSBState(childElement);
                pathwayModel.add(thingie);
                return thingie;
            }
        }
    }
    SBEntity sbSubEntity = new SBEntityImpl();
    if (element.getAttributes().size() > 0) {
        addAttributes(sbSubEntity, element);
    }
    for (Object child : element.getChildren()) {
        if (child instanceof Element) {
            Element childElement = (Element) child;
            if (!addContentSBEntity(sbSubEntity, element, childElement)) {
                showUnexpected(childElement);
            }
        }
    }
    pathwayModel.add(sbSubEntity);
    return sbSubEntity;
}
Also used : SBEntityImpl(org.vcell.pathway.sbpax.SBEntityImpl) Element(org.jdom.Element) GroupObject(org.vcell.pathway.GroupObject) BioPaxObject(org.vcell.pathway.BioPaxObject) SBEntity(org.vcell.pathway.sbpax.SBEntity) SBEntityProxy(org.vcell.pathway.persistence.BiopaxProxy.SBEntityProxy) SBState(org.vcell.pathway.sbpax.SBState) SBMeasurable(org.vcell.pathway.sbpax.SBMeasurable)

Aggregations

Element (org.jdom.Element)2 BioPaxObject (org.vcell.pathway.BioPaxObject)2 GroupObject (org.vcell.pathway.GroupObject)2 SBState (org.vcell.pathway.sbpax.SBState)2 SBEntityProxy (org.vcell.pathway.persistence.BiopaxProxy.SBEntityProxy)1 SBStateProxy (org.vcell.pathway.persistence.BiopaxProxy.SBStateProxy)1 SBEntity (org.vcell.pathway.sbpax.SBEntity)1 SBEntityImpl (org.vcell.pathway.sbpax.SBEntityImpl)1 SBMeasurable (org.vcell.pathway.sbpax.SBMeasurable)1