Package gml4u.model

Examples of gml4u.model.GmlEnvironment


    else {
      expression = root+"/tag/header/environment/child::*";
    }

    elements = (List<Element>) JDomParsingUtils.selectNodes(document, expression);
    GmlEnvironment environment = getGmlEnvironment(elements);
    gml.environment = environment;

    // TODO loop through all tags or skip multiple tags

    // Get Drawing
View Full Code Here


   * @return GmlEnvironment
   */
  @SuppressWarnings("unchecked")
  private static GmlEnvironment getGmlEnvironment(List<Element> elements) {

    GmlEnvironment environment = new GmlEnvironment(new Vec3D(1, 1, 1));

    // TODO GmlGenericContainer
   
    // loop through environment nodes
    for (Element e: elements) {
      String name = e.getName();

      if (e.getChildren().size() == 1) {
        String value = e.getValue();
        environment.set(name, value);
        LOGGER.log(Level.FINEST, name+"="+ value);       
      }
     
      // loop through sub nodes to create vectors
      else if (e.getChildren().size() >= 3) {

        Vec3D v = getGmlVec3D(e.getChildren());
        environment.set(name, v);
        LOGGER.log(Level.FINEST, name+"="+ v);       
       
        // Specific case for realScale "unit" subnode
        if (e.getName().equalsIgnoreCase("realScale")) {
          String realScaleUnit;
          try {
            realScaleUnit = e.getChild("unit").getValue();
          }
          catch (Exception ex) {
            realScaleUnit = "";
          }

          environment.set("realScaleUnit", realScaleUnit);
          LOGGER.log(Level.FINEST, "realScaleUnit"+"="+ realScaleUnit);       
        }
      }
    }

View Full Code Here

TOP

Related Classes of gml4u.model.GmlEnvironment

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.