Search in sources :

Example 31 with ComponentStateDefinition

use of org.vcell.model.rbm.ComponentStateDefinition in project vcell by virtualcell.

the class XmlReader method getRbmMolecularComponent.

private MolecularComponent getRbmMolecularComponent(Element e, Model newModel) {
    String s = e.getAttributeValue(XMLTags.NameAttrTag);
    if (s == null || s.isEmpty()) {
        System.out.println("XMLReader: getRbmMolecularComponent: name is missing.");
        return null;
    }
    MolecularComponent mc = new MolecularComponent(s);
    s = e.getAttributeValue(XMLTags.RbmIndexAttrTag);
    if (s == null || s.isEmpty()) {
        System.out.println("XMLReader: getRbmMolecularComponent: index is missing.");
        return null;
    }
    int index = Integer.parseInt(s);
    mc.setIndex(index);
    List<Element> children = e.getChildren(XMLTags.RbmMolecularTypeAllowableStateTag, vcNamespace);
    for (Element element : children) {
        ComponentStateDefinition cs = getRbmComponentStateDefinition(element, newModel);
        if (cs != null) {
            mc.addComponentStateDefinition(cs);
        }
    }
    return mc;
}
Also used : ParticleMolecularComponent(cbit.vcell.math.ParticleMolecularComponent) MolecularComponent(org.vcell.model.rbm.MolecularComponent) Element(org.jdom.Element) ParticleComponentStateDefinition(cbit.vcell.math.ParticleComponentStateDefinition) ComponentStateDefinition(org.vcell.model.rbm.ComponentStateDefinition)

Aggregations

ComponentStateDefinition (org.vcell.model.rbm.ComponentStateDefinition)31 MolecularComponent (org.vcell.model.rbm.MolecularComponent)23 MolecularType (org.vcell.model.rbm.MolecularType)15 SpeciesPattern (org.vcell.model.rbm.SpeciesPattern)12 MolecularComponentPattern (org.vcell.model.rbm.MolecularComponentPattern)10 MolecularTypePattern (org.vcell.model.rbm.MolecularTypePattern)10 BioModelNode (cbit.vcell.desktop.BioModelNode)8 LinkedHashMap (java.util.LinkedHashMap)7 Icon (javax.swing.Icon)7 Point (java.awt.Point)6 ComponentStatePattern (org.vcell.model.rbm.ComponentStatePattern)6 ParticleComponentStateDefinition (cbit.vcell.math.ParticleComponentStateDefinition)5 List (java.util.List)5 Graphics (java.awt.Graphics)4 ActionEvent (java.awt.event.ActionEvent)4 ActionListener (java.awt.event.ActionListener)4 JMenuItem (javax.swing.JMenuItem)4 BondType (org.vcell.model.rbm.MolecularComponentPattern.BondType)4 Bond (org.vcell.model.rbm.SpeciesPattern.Bond)4 BioPaxObject (org.vcell.pathway.BioPaxObject)4