Examples of SBase


Examples of org.sbml.jsbml.SBase

  }
 
 
  public boolean isSBMLNamespaceNeeded(ASTNode astNode) {

    SBase sbase = astNode.getParentSBMLObject();
   
    if (sbase != null && sbase.getLevel() < 3) {
      return false;
    }

    findUnitsCompiler.reset();
   
View Full Code Here

Examples of org.sbml.jsbml.SBase

  /**
   * create a new GlobalRenderInformation element and adds it to the ListOfGlobalRenderInformation list
   */
  public GlobalRenderInformation createGlobalRenderInformation(String id) {
    SBase sBase = getExtendedSBase();
    GlobalRenderInformation field = new GlobalRenderInformation(id, sBase.getLevel(), sBase.getVersion());
    addGlobalRenderInformation(field);
    return field;
  }
View Full Code Here

Examples of org.sbml.jsbml.SBase

  /**
   * @return the listOfGlobalRenderInformation
   */
  public ListOf<GlobalRenderInformation> getListOfGlobalRenderInformation() {
    if (!isSetListOfGlobalRenderInformation()) {
      SBase sBase = getExtendedSBase();
      listOfGlobalRenderInformation = new ListOf<GlobalRenderInformation>(sBase.getLevel(), sBase.getVersion());
      listOfGlobalRenderInformation.setNamespace(RenderConstants.namespaceURI);
      listOfGlobalRenderInformation.setSBaseListType(ListOf.Type.other);
      sBase.registerChild(listOfGlobalRenderInformation);
    }
    return listOfGlobalRenderInformation;
  }
View Full Code Here

Examples of org.sbml.jsbml.SBase

    // If not other elements recognized the new element to read, it might be
    // on of the extended SBase children
    if (contextObject instanceof SBase)
    {
      SBase sbase = (SBase) contextObject;
      CompSBasePlugin compSBase = null;

      if (sbase.getExtension(namespaceURI) != null) {
        compSBase = (CompSBasePlugin) sbase.getExtension(namespaceURI);
      } else {
        compSBase = new CompSBasePlugin(sbase);
        sbase.addExtension(namespaceURI, compSBase);
      }

      if (elementName.equals(CompConstants.listOfReplacedElements))
      {
        return compSBase.getListOfReplacedElements();
View Full Code Here

Examples of org.sbml.jsbml.SBase

   * @return the actual SBase instance referred by the {@code idRef} or {@code metaIdRef}, returns null
   * if nothing is found.
   */
  public SBase getSBaseInstance() {

    SBase instance = null;

    if (isSetIdRef()) {
      Model model = getModel();

      if (model != null) {
View Full Code Here

Examples of org.sbml.jsbml.SBase

    logger.debug("logger called, " + prefix + ":" + elementName + " in context of: " + contextObject.toString());
    if (contextObject instanceof LayoutModelPlugin) {
      LayoutModelPlugin layoutModel = (LayoutModelPlugin) contextObject;
      // TODO not sure if necessary to check if listOfLayouts != null
      ListOf<Layout> listOfLayouts = layoutModel.getListOfLayouts();
      SBase newElement = null;

      if (elementName.equals(RenderConstants.listOfGlobalRenderInformation)) {
        RenderListOfLayoutsPlugin renderPlugin = new RenderListOfLayoutsPlugin(listOfLayouts);
        listOfLayouts.addExtension(RenderConstants.namespaceURI, renderPlugin);
        newElement = renderPlugin.getListOfGlobalRenderInformation();
      }

      if (newElement != null) {
        listOfLayouts.registerChild(newElement);
        return newElement;
      }
    }
    else if (contextObject instanceof Layout) {
      Layout layout = (Layout) contextObject;
      SBase newElement = null;

      if (elementName.equals(RenderConstants.listOfLocalRenderInformation)) {
        RenderLayoutPlugin renderPlugin = new RenderLayoutPlugin(layout);
        layout.addExtension(RenderConstants.namespaceURI, renderPlugin);
        newElement = renderPlugin.getListOfLocalRenderInformation();
      }
      if (newElement != null) {
        layout.registerChild(newElement);
        return newElement;
      }
    }
    else if (contextObject instanceof RenderInformationBase) {
      RenderInformationBase renderInformation = (RenderInformationBase) contextObject;
      SBase newElement = null;

      if (elementName.equals(RenderConstants.listOfGradientDefinitions)) {
        newElement = renderInformation.getListOfGradientDefintions();
      }
      if (elementName.equals(RenderConstants.listOfColorDefinitions)) {
        newElement = renderInformation.getListOfColorDefinitions();
      }
      if (elementName.equals(RenderConstants.listOfLineEndings)) {
        newElement = renderInformation.getListOfLineEndings();
      }

      if (renderInformation instanceof GlobalRenderInformation) {
        GlobalRenderInformation globalRenderInformation =
            (GlobalRenderInformation) renderInformation;
        if (elementName.equals(RenderConstants.listOfStyles)) {
          newElement = globalRenderInformation.getListOfStyles();
        }
      }

      if (renderInformation instanceof LocalRenderInformation) {
        LocalRenderInformation localRenderInformation =
            (LocalRenderInformation) renderInformation;
        if (elementName.equals(RenderConstants.listOfLocalStyles)) {
          newElement = localRenderInformation.getListOfLocalStyles();
        }
      }


      if (newElement != null) {
        renderInformation.registerChild(newElement);
        return newElement;
      }
    }

    else if (contextObject instanceof Style) {
      Style style = (Style) contextObject;
      if (elementName.equals(RenderConstants.group)) {
        Group g = new Group();
        style.setGroup(g);

        return g;
      }
    }

    else if (contextObject instanceof Polygon) {
      Polygon polygon = (Polygon) contextObject;
      SBase newElement = null;
      if (elementName.equals(RenderConstants.listOfElements)) {
        newElement = polygon.getListOfElements();
      }
      if (newElement != null) {
        polygon.registerChild(newElement);
        return newElement;
      }
    }

    else if (contextObject instanceof LineEnding) {
      LineEnding lineEnding = (LineEnding) contextObject;
      if (elementName.equals(RenderConstants.boundingBox)) {
        BoundingBox bbox = new BoundingBox();
        lineEnding.setBoundingBox(bbox);

        return bbox;
      }
      else if (elementName.equals(RenderConstants.group)) {
        Group g = new Group();
        lineEnding.setGroup(g);

        return g;
      }
    }

    else if (contextObject instanceof Curve) {
      Curve curve = (Curve) contextObject;
      SBase newElement = null;

      if (elementName.equals(RenderConstants.listOfElements)) {
        newElement = curve.getListOfElements();
      }

      if (newElement != null) {
        curve.registerChild(newElement);
        return newElement;
      }
    }

    else if (contextObject instanceof GradientBase) {
      GradientBase gradientBase = (GradientBase) contextObject;
      SBase newElement = null;

      if (elementName.equals(RenderConstants.listOfGradientStops)) {
        newElement = gradientBase.getListOfGradientStops();
      }

      if (newElement != null) {
        gradientBase.registerChild(newElement);
        return newElement;
      }
    }
    /**
     * parsing lists
     */
    else if (contextObject instanceof ListOf<?>) {
      ListOf<SBase> listOf = (ListOf<SBase>) contextObject;
      SBase newElement = null;

      if (elementName.equals(RenderConstants.renderPoint)) {
        newElement = new RenderPoint();
      }
      else if (elementName.equals(RenderConstants.style)) {
View Full Code Here

Examples of org.sbml.jsbml.SBase

    // If not other elements recognized the new element to read, it might be
    // one of the extended SBase children
    if (contextObject instanceof SBase)
    {
      SBase sbase = (SBase) contextObject;
      ReqSBasePlugin reqSBase = null;

      if (sbase.getExtension(getNamespaceURI()) != null) {
        reqSBase = (ReqSBasePlugin) sbase.getExtension(getNamespaceURI());
      } else {
        reqSBase = new ReqSBasePlugin(sbase);
        sbase.addExtension(getNamespaceURI(), reqSBase);
      }

      if (elementName.equals(ReqConstants.listOfChangedMaths))
      {
        return reqSBase.getListOfChangedMaths();
View Full Code Here

Examples of org.sbml.jsbml.SBase

        ListOf<SBase> listOf = (ListOf<SBase>) sbase;

        if (!listOf.isEmpty()) {
          listOfElementsToWrite = new ArrayList<Object>();
          for (int i = 0; i < listOf.size(); i++) {
            SBase element = listOf.get(i);

            if (element != null) {
              boolean add = true;
              if (element instanceof UnitDefinition) {
                UnitDefinition ud = (UnitDefinition) element;
View Full Code Here

Examples of org.sbml.jsbml.SBase

    // A SBMLCoreParser can modify a contextObject which is an instance of
    // SBase.
    // Try to read the attributes.
    if (contextObject instanceof SBase) {
      SBase sbase = (SBase) contextObject;
      try {
        isAttributeRead = sbase.readAttribute(attributeName, prefix,
            value);
      } catch (Throwable exc) {
        log4jLogger.error(exc.getMessage());
        log4jLogger.info("Attribute = " + attributeName + ", element = " + elementName);
      }
View Full Code Here

Examples of org.sbml.jsbml.SBase

      }
     
      log4jLogger.debug("processNamespace : " + prefix + " = " + URI);
    }
    else if (contextObject instanceof SBase) {
      SBase sbase = (SBase) contextObject;
     
      if (prefix != null && prefix.length() > 0) {
        sbase.addDeclaredNamespace(prefix + ":" + localName, URI);
      } else {
        sbase.addDeclaredNamespace(localName, URI);
      }

      log4jLogger.debug("processNamespace : " + prefix + " = " + URI);
    }
    else if (contextObject instanceof Annotation) {
      Annotation sbase = (Annotation) contextObject;
      sbase.addAnnotationNamespace(localName, prefix, URI);
     
      log4jLogger.debug("processNamespace : " + prefix + " = " + URI);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.