Package org.sbml.jsbml

Examples of org.sbml.jsbml.SBMLDocument


      // TODO: add all other namespaces !!

      if (isSBMLNamespaceNeeded) {
        // writing the SBML namespace
        SBMLDocument doc = null;
        SBase sbase = m.getMath().getParentSBMLObject();
        String sbmlNamespace = SBMLDocument.URI_NAMESPACE_L3V1Core;
       
        if (sbase != null) {
          doc = sbase.getSBMLDocument();
          sbmlNamespace = doc.getSBMLDocumentNamespaces().get("xmlns");
         
          if (sbmlNamespace == null) {
            logger.warn("writeMathML: the SBML namespace of this SBMLDocument" +
                " could not be found, using the default namespace (" +
                SBMLDocument.URI_NAMESPACE_L3V1Core + ") instead.");
View Full Code Here


   * @throws ParseException
   */
  public static void main(String[] args) throws XMLStreamException,
      SBMLException, ParseException {
       
    SBMLDocument doc = new SBMLDocument(2, 4);
    doc.addTreeNodeChangeListener(new SimpleTreeNodeChangeListener());
    Model model = doc.createModel("test_model");
   
    Creator c = new Creator("Hans", "Wurst",
      "Institute for Interesting Biology", "ovidiu.radulescu@univ-rennes1.fr");
    History h = new History();
    h.addCreator(c);
View Full Code Here

  @SuppressWarnings("unchecked")
  public List<Object> getListOfSBMLElementsToWrite(Object sbase) {
    ArrayList<Object> listOfElementsToWrite = null;
    if (sbase instanceof SBase) {
      if (sbase instanceof SBMLDocument) {
        SBMLDocument sbmlDocument = (SBMLDocument) sbase;
        if (sbmlDocument.isSetModel()) {
          listOfElementsToWrite = new ArrayList<Object>();
          listOfElementsToWrite.add(sbmlDocument.getModel());
        }
      } else if (sbase instanceof Model) {

        Model model = (Model) sbase;
        listOfElementsToWrite = new ArrayList<Object>();
View Full Code Here

   */
  public void processNamespace(String elementName, String URI, String prefix,
      String localName, boolean hasAttributes, boolean isLastNamespace,
      Object contextObject) {
    if (contextObject instanceof SBMLDocument) {
      SBMLDocument sbmlDocument = (SBMLDocument) contextObject;
      if (!URI.equals(SBMLDocument.URI_NAMESPACE_L1)) {
        sbmlDocument.addNamespace(localName, prefix, URI);
      }
    }
  }
View Full Code Here

          Annotation annotation = (Annotation) newContextObject;
          sbase.setAnnotation(annotation);

          return annotation;
        } else if (contextObject instanceof SBMLDocument) {
          SBMLDocument sbmlDocument = (SBMLDocument) contextObject;
          if (elementName.equals("model")) {
            Model model = (Model) newContextObject;
            sbmlDocument.setModel(model);

            return model;
          }
        } else if (contextObject instanceof Model) {
View Full Code Here

  private Compartment compartment2;
  private KineticLaw k;
 
  @Before public void setUp() throws Exception
  {
    doc = new SBMLDocument(3, 1);
    model = doc.createModel("test_model");
    model.setMetaId("M1");
    compartment = model.createCompartment("cytoplasm");
    compartment.setMetaId("M2");
    compartment2 = model.createCompartment("periplasm");
View Full Code Here

      Object sbmlElementToWrite) {
    if (sbmlElementToWrite instanceof SBase) {
      SBase sbase = (SBase) sbmlElementToWrite;

      if (sbase instanceof SBMLDocument) {
        SBMLDocument sbmlDocument = (SBMLDocument) sbmlElementToWrite;

        xmlObject.addAttributes(sbmlDocument
            .getSBMLDocumentNamespaces());
      }

      xmlObject.setPrefix("");
    }
View Full Code Here

* @version $Rev: 1524 $
*/
public class SBMLWriterTest {

  public static void main(String args[]) {
    SBMLDocument doc = new SBMLDocument(2, 4);
    doc.setNotes("<body>Senseless test commentar</body>");

    Model m = doc.createModel("model");

    CVTerm term = new CVTerm();
    term.setQualifierType(Type.MODEL_QUALIFIER);
    term.setModelQualifierType(Qualifier.BQM_IS);
    term.addResource("urn:miriam:kegg.pathway:hsa00010");
View Full Code Here

    updateCurrentDocument();
    return currentDocument;
  }
 
  public SBMLDocument getDocumentForNetworkId(String networkId){
    SBMLDocument doc = null;
    if (documentMap.containsKey(networkId)){
      doc = documentMap.get(networkId);
    }
    return doc;
  }
View Full Code Here

      writer.writeStartElement("math");
      writer.writeNamespace(null, ASTNode.URI_MATHML_DEFINITION)
     
      if (isSBMLNamespaceNeeded) {
        // writing the SBML namespace
        SBMLDocument doc = null;
        SBase sbase = astNode.getParentSBMLObject();
        String sbmlNamespace = SBMLDocument.URI_NAMESPACE_L3V1Core;
       
        if (sbase != null) {
          doc = sbase.getSBMLDocument();
          sbmlNamespace = doc.getSBMLDocumentNamespaces().get("xmlns");         
        }
        writer.writeNamespace("sbml", sbmlNamespace);
      }
     
      writer.writeCharacters("\n");
View Full Code Here

TOP

Related Classes of org.sbml.jsbml.SBMLDocument

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.