Package org.sbml.jsbml.ext.render

Examples of org.sbml.jsbml.ext.render.GlobalRenderInformation


      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)) {
        newElement = new Style();
      }
      else if (elementName.equals(RenderConstants.gradientStop)) {
        newElement = new GradientStop();
      }
      else if (elementName.equals(RenderConstants.colorDefiniton)) {
        newElement = new ColorDefinition();
      }
      else if (elementName.equals(RenderConstants.gradientBase)) {
        newElement = new GradientBase();
      }
      else if (elementName.equals(RenderConstants.lineEnding)) {
        newElement = new LineEnding();
      }
      else if (elementName.equals(RenderConstants.localRenderInformation)) {
        newElement = new LocalRenderInformation();
      }
      else if (elementName.equals(RenderConstants.globalRenderInformation)) {
        newElement = new GlobalRenderInformation();
      }


      if (newElement != null) {
        listOf.registerChild(newElement);
View Full Code Here

TOP

Related Classes of org.sbml.jsbml.ext.render.GlobalRenderInformation

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.